Skip to content
Snippets Groups Projects
Commit 117f6dfa authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '70-fix-improve-styled-container-widget' into 'master'

Resolve "Fix / improve styled container widget"

Closes #70

See merge request !68
parents 74f9ef9b 08990aaa
No related branches found
No related tags found
1 merge request!68Resolve "Fix / improve styled container widget"
Pipeline #6027 passed
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=1.0.54 app.versionName=1.0.55
app.versionCode=55 app.versionCode=56
...@@ -22,38 +22,32 @@ class DemoPage extends StatelessWidget { ...@@ -22,38 +22,32 @@ class DemoPage extends StatelessWidget {
const SizedBox(height: 8), const SizedBox(height: 8),
const AppHeader(text: 'TOP'), const AppHeader(text: 'TOP'),
const SizedBox(height: 20), const SizedBox(height: 20),
persistedCounterBlock(BlocProvider.of<DataCubit>(context)), StyledWidget(
const SizedBox(height: 20), child: persistedCounterBlock(BlocProvider.of<DataCubit>(context)),
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')),
),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
const StyledWidget( StyledWidget(
borderRadius: 0, borderRadius: 0,
borderWidth: 12, borderWidth: 12,
// depth: 8, // depth: 8,
lowerColor: Colors.red, lowerColor: Colors.red,
upperColor: Colors.yellow, upperColor: Colors.yellow,
child: Center(child: Text('custom 1')), child: testBlocConsumer(),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
const StyledWidget( StyledWidget(
borderRadius: 10, borderRadius: 10,
borderWidth: 20, borderWidth: 30,
depth: 20, depth: 20,
lowerColor: Colors.blueGrey, lowerColor: Colors.blueGrey,
upperColor: Colors.blue, 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),
], ],
), ),
); );
......
...@@ -4,9 +4,9 @@ class StyledWidget extends StatelessWidget { ...@@ -4,9 +4,9 @@ class StyledWidget extends StatelessWidget {
const StyledWidget({ const StyledWidget({
super.key, super.key,
required this.child, required this.child,
this.borderWidth = 10, this.borderWidth = 20,
this.borderRadius = 4, this.borderRadius = 6,
this.depth = 5, this.depth = 7,
this.lowerColor, this.lowerColor,
this.upperColor, this.upperColor,
}); });
...@@ -59,8 +59,8 @@ class StyledWidget extends StatelessWidget { ...@@ -59,8 +59,8 @@ class StyledWidget extends StatelessWidget {
return nestedContainers( return nestedContainers(
child: child, child: child,
containerDepth: depth, containerDepth: depth,
lowerColor: lowerColor ?? Theme.of(context).colorScheme.onPrimary, lowerColor: lowerColor ?? Theme.of(context).colorScheme.surface,
upperColor: upperColor ?? Theme.of(context).colorScheme.onSecondary, upperColor: upperColor ?? Theme.of(context).colorScheme.onSurface,
); );
} }
} }
...@@ -3,7 +3,7 @@ description: A random application, for testing purpose only. ...@@ -3,7 +3,7 @@ description: A random application, for testing purpose only.
publish_to: "none" publish_to: "none"
version: 1.0.54+55 version: 1.0.55+56
environment: environment:
sdk: "^3.0.0" sdk: "^3.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment