Skip to content

Commit b2c8741

Browse files
committed
💄 improve example app
1 parent aa4d9b0 commit b2c8741

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

.run/Example.run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Example" type="FlutterRunConfigurationType" factoryName="Flutter">
3+
<option name="filePath" value="$PROJECT_DIR$/packages/flutter_box_transform/example/lib/main.dart" />
4+
<method v="2" />
5+
</configuration>
6+
</component>
957 KB
Loading

packages/flutter_box_transform/example/lib/main.dart

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ class MyApp extends StatelessWidget {
1212
Widget build(BuildContext context) {
1313
return MaterialApp(
1414
title: 'Box Transform Demo',
15+
debugShowCheckedModeBanner: false,
1516
theme: ThemeData(
16-
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
17+
colorScheme: ColorScheme.fromSeed(
18+
seedColor: Colors.deepPurple,
19+
brightness: Brightness.dark,
20+
),
1721
useMaterial3: true,
1822
),
1923
home: const MyHomePage(),
@@ -31,8 +35,8 @@ class MyHomePage extends StatefulWidget {
3135
class _MyHomePageState extends State<MyHomePage> {
3236
late Rect rect = Rect.fromCenter(
3337
center: MediaQuery.of(context).size.center(Offset.zero),
34-
width: 200,
35-
height: 200,
38+
width: 400,
39+
height: 300,
3640
);
3741

3842
late Rect clampingRect = (Offset.zero & MediaQuery.of(context).size);
@@ -52,13 +56,16 @@ class _MyHomePageState extends State<MyHomePage> {
5256
});
5357
},
5458
contentBuilder: (context, rect, flip) {
55-
return const DecoratedBox(
59+
return DecoratedBox(
5660
decoration: BoxDecoration(
57-
gradient: LinearGradient(
58-
colors: [Colors.red, Colors.blue],
61+
border: Border.all(
62+
color: Theme.of(context).colorScheme.primary,
63+
),
64+
image: const DecorationImage(
65+
image: AssetImage('assets/image1.png'),
66+
fit: BoxFit.fill,
5967
),
6068
),
61-
child: Placeholder(),
6269
);
6370
},
6471
),

packages/flutter_box_transform/example/pubspec.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ dev_dependencies:
2828
flutter:
2929
uses-material-design: true
3030

31+
assets:
32+
- assets/
33+

0 commit comments

Comments
 (0)