From 08990aaa2cc4036573d05a73bd85c1a15cbb5a00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr>
Date: Wed, 25 Sep 2024 16:55:50 +0200
Subject: [PATCH] Fix/improve styled container widget

---
 android/gradle.properties         |  4 ++--
 lib/ui/screens/demo_page.dart     | 30 ++++++++++++------------------
 lib/ui/widgets/styles_widget.dart | 10 +++++-----
 pubspec.yaml                      |  2 +-
 4 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/android/gradle.properties b/android/gradle.properties
index 0d6ab80..d151a51 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,5 +1,5 @@
 org.gradle.jvmargs=-Xmx1536M
 android.useAndroidX=true
 android.enableJetifier=true
-app.versionName=1.0.54
-app.versionCode=55
+app.versionName=1.0.55
+app.versionCode=56
diff --git a/lib/ui/screens/demo_page.dart b/lib/ui/screens/demo_page.dart
index 94dcb72..ea6286e 100644
--- a/lib/ui/screens/demo_page.dart
+++ b/lib/ui/screens/demo_page.dart
@@ -22,38 +22,32 @@ class DemoPage extends StatelessWidget {
           const SizedBox(height: 8),
           const AppHeader(text: 'TOP'),
           const SizedBox(height: 20),
-          persistedCounterBlock(BlocProvider.of<DataCubit>(context)),
-          const SizedBox(height: 20),
-          testBlocConsumer(),
-          testBlocBuilder(),
-          const SizedBox(height: 20),
-          fakeApiCall(),
-          const SizedBox(height: 20),
-          const AppHeader(text: 'BOTTOM'),
-          const StyledWidget(
-            child: SizedBox.square(
-              dimension: 40,
-              child: Center(child: Text('default')),
-            ),
+          StyledWidget(
+            child: persistedCounterBlock(BlocProvider.of<DataCubit>(context)),
           ),
           const SizedBox(height: 8),
-          const StyledWidget(
+          StyledWidget(
             borderRadius: 0,
             borderWidth: 12,
             // depth: 8,
             lowerColor: Colors.red,
             upperColor: Colors.yellow,
-            child: Center(child: Text('custom 1')),
+            child: testBlocConsumer(),
           ),
           const SizedBox(height: 8),
-          const StyledWidget(
+          StyledWidget(
             borderRadius: 10,
-            borderWidth: 20,
+            borderWidth: 30,
             depth: 20,
             lowerColor: Colors.blueGrey,
             upperColor: Colors.blue,
-            child: Center(child: Text('custom 2')),
+            child: testBlocBuilder(),
           ),
+          const SizedBox(height: 8),
+          fakeApiCall(),
+          const SizedBox(height: 8),
+          const AppHeader(text: 'BOTTOM'),
+          const SizedBox(height: 8),
         ],
       ),
     );
diff --git a/lib/ui/widgets/styles_widget.dart b/lib/ui/widgets/styles_widget.dart
index 72f3670..3cdc23b 100644
--- a/lib/ui/widgets/styles_widget.dart
+++ b/lib/ui/widgets/styles_widget.dart
@@ -4,9 +4,9 @@ class StyledWidget extends StatelessWidget {
   const StyledWidget({
     super.key,
     required this.child,
-    this.borderWidth = 10,
-    this.borderRadius = 4,
-    this.depth = 5,
+    this.borderWidth = 20,
+    this.borderRadius = 6,
+    this.depth = 7,
     this.lowerColor,
     this.upperColor,
   });
@@ -59,8 +59,8 @@ class StyledWidget extends StatelessWidget {
     return nestedContainers(
       child: child,
       containerDepth: depth,
-      lowerColor: lowerColor ?? Theme.of(context).colorScheme.onPrimary,
-      upperColor: upperColor ?? Theme.of(context).colorScheme.onSecondary,
+      lowerColor: lowerColor ?? Theme.of(context).colorScheme.surface,
+      upperColor: upperColor ?? Theme.of(context).colorScheme.onSurface,
     );
   }
 }
diff --git a/pubspec.yaml b/pubspec.yaml
index 7e90b14..6f0aa01 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@ description: A random application, for testing purpose only.
 
 publish_to: "none"
 
-version: 1.0.54+55
+version: 1.0.55+56
 
 environment:
   sdk: "^3.0.0"
-- 
GitLab