James hace 4 meses
padre
commit
adea222376
Se han modificado 2 ficheros con 16 adiciones y 22 borrados
  1. 9 15
      lib/components/imageButton.dart
  2. 7 7
      lib/util/base64Utils.dart

+ 9 - 15
lib/components/imageButton.dart

@@ -13,18 +13,16 @@ class ImageButton extends StatelessWidget {
   final VoidCallback? onTap;
 
   ImageButton({
-    required Size buttonSize,
+    required this.buttonSize,
     required this.image,
     Size? imageSize,
-    Color bgColor = Colors.white,
+    this.bgColor = Colors.white,
     this.borderRadius = 5,
     Color? borderColor,
     this.borderWidth = 1,
     this.onTap,
   })
-    : buttonSize = buttonSize,
-      imageSize = imageSize ?? buttonSize,
-      bgColor = bgColor,
+    : imageSize = imageSize ?? buttonSize,
       borderColor = borderColor ?? bgColor
   ;
 
@@ -71,21 +69,19 @@ class ImageColumnTextButton extends StatelessWidget {
   final VoidCallback? onTap;
 
   ImageColumnTextButton({
-    required Size buttonSize,
+    required this.buttonSize,
     required this.image,
     Size? imageSize,
     required this.text,
     this.textStyle,
     this.space = 4,
-    Color bgColor = Colors.white,
+    this.bgColor = Colors.white,
     this.borderRadius = 5,
     Color? borderColor,
     this.borderWidth = 1,
     this.onTap,
   })
-      : buttonSize = buttonSize,
-        imageSize = imageSize ?? buttonSize,
-        bgColor = bgColor,
+      : imageSize = imageSize ?? buttonSize,
         borderColor = borderColor ?? bgColor
   ;
 
@@ -144,21 +140,19 @@ class ImageRowTextButton extends StatelessWidget {
   final VoidCallback? onTap;
 
   ImageRowTextButton({
-    required Size buttonSize,
+    required this.buttonSize,
     required this.image,
     Size? imageSize,
     required this.text,
     this.textStyle,
     this.space = 2,
-    Color bgColor = Colors.white,
+    this.bgColor = Colors.white,
     this.borderRadius = 5,
     Color? borderColor,
     this.borderWidth = 1,
     this.onTap,
   })
-      : buttonSize = buttonSize,
-        imageSize = imageSize ?? buttonSize,
-        bgColor = bgColor,
+      : imageSize = imageSize ?? buttonSize,
         borderColor = borderColor ?? bgColor
   ;
 

+ 7 - 7
lib/util/base64Utils.dart

@@ -22,7 +22,7 @@ String bytesToBase64(Uint8List data, {bool urlSafe = false}) {
     }
 
     return base64Str;
-  } on ArgumentError catch (e) {
+  } on ArgumentError {
     rethrow;
   } catch (e) {
     throw Exception('Failed to encode Uint8List to Base64: ${e.toString()}');
@@ -54,9 +54,9 @@ Uint8List base64ToBytes(String base64Str, {bool? urlSafe}) {
     }
 
     return base64Decode(normalizedStr);
-  } on ArgumentError catch (e) {
+  } on ArgumentError {
     rethrow;
-  } on FormatException catch (e) {
+  } on FormatException {
     rethrow;
   } catch (e) {
     throw Exception('Failed to decode Base64 to Uint8List: ${e.toString()}');
@@ -94,9 +94,9 @@ String hexToBase64(String hexStr, {bool urlSafe = false}) {
     return urlSafe
         ? base64.replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')
         : base64;
-  } on ArgumentError catch (e) {
+  } on ArgumentError {
     rethrow;
-  } on FormatException catch (e) {
+  } on FormatException {
     rethrow;
   } catch (e) {
     throw Exception('Failed to convert hex to Base64: ${e.toString()}');
@@ -145,9 +145,9 @@ String base64ToHex(String base64Str, {
     }).join('');
 
     return withPrefix ? '0x$hexString' : hexString;
-  } on ArgumentError catch (e) {
+  } on ArgumentError {
     rethrow;
-  } on FormatException catch (e) {
+  } on FormatException {
     rethrow;
   } catch (e) {
     throw Exception('Failed to convert Base64 to hex: ${e.toString()}');