Skip to content

Commit 6538152

Browse files
SaadArdatiBirjuVachhani
authored andcommitted
🔧 Update Pack V1 #9
1 parent 6b7cfa5 commit 6538152

File tree

7 files changed

+775
-241
lines changed

7 files changed

+775
-241
lines changed
107 KB
Loading

example/lib/main.dart

Lines changed: 101 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import 'package:flutter/scheduler.dart';
66
import 'package:flutter/services.dart';
77
import 'package:flutter_box_transform/flutter_box_transform.dart';
88
import 'package:hyper_effects_demo/stories/chained_animation.dart';
9-
import 'package:hyper_effects_demo/stories/counter_app.dart';
10-
import 'package:hyper_effects_demo/stories/spring_animation.dart';
119
import 'package:hyper_effects_demo/stories/color_filter_scroll_transition.dart';
10+
import 'package:hyper_effects_demo/stories/counter_app.dart';
1211
import 'package:hyper_effects_demo/stories/scroll_phase_transition.dart';
1312
import 'package:hyper_effects_demo/stories/scroll_wheel_blur.dart';
1413
import 'package:hyper_effects_demo/stories/scroll_wheel_transition.dart';
14+
import 'package:hyper_effects_demo/stories/spring_animation.dart';
1515
import 'package:hyper_effects_demo/stories/text_animation.dart';
1616
import 'package:hyper_effects_demo/stories/windows_settings_transition.dart';
1717

@@ -29,8 +29,12 @@ class MyApp extends StatelessWidget {
2929
return AdaptiveTheme(
3030
light: ThemeData(
3131
useMaterial3: true,
32-
brightness: Brightness.light,
33-
colorSchemeSeed: Colors.blue,
32+
// brightness: Brightness.light,
33+
colorScheme: ColorScheme.fromSeed(
34+
brightness: Brightness.light,
35+
seedColor: Colors.blue,
36+
background: const Color(0xFF0F0F0F),
37+
),
3438
inputDecorationTheme: InputDecorationTheme(
3539
isDense: true,
3640
contentPadding:
@@ -42,8 +46,13 @@ class MyApp extends StatelessWidget {
4246
),
4347
dark: ThemeData(
4448
useMaterial3: true,
45-
brightness: Brightness.dark,
46-
colorSchemeSeed: Colors.blue,
49+
// brightness: Brightness.dark,
50+
// colorSchemeSeed: Colors.blue,
51+
colorScheme: ColorScheme.fromSeed(
52+
brightness: Brightness.dark,
53+
seedColor: Colors.blue,
54+
background: const Color(0xFF0F0F0F),
55+
),
4756
inputDecorationTheme: InputDecorationTheme(
4857
isDense: true,
4958
contentPadding:
@@ -130,6 +139,7 @@ class _StoryboardState extends State<Storyboard> {
130139
SizedBox(
131140
width: 300,
132141
child: Column(
142+
crossAxisAlignment: CrossAxisAlignment.start,
133143
children: [
134144
Padding(
135145
padding: const EdgeInsets.all(16),
@@ -139,92 +149,98 @@ class _StoryboardState extends State<Storyboard> {
139149
),
140150
),
141151
const Divider(height: 0),
142-
CustomExpansionTile(
143-
title: const Text('Animations'),
144-
isExpanded: selectedCategory == 0,
145-
onExpansionChanged: () {
146-
setState(() {
147-
if (selectedCategory == 0) {
148-
selectedCategory = null;
149-
} else {
150-
selectedCategory = 0;
151-
}
152-
});
153-
},
154-
children: [
155-
for (final Story story in animationStories)
156-
ColoredBox(
157-
color: (animationStories.indexOf(story) ==
158-
selectedAnimation)
159-
? Theme.of(context)
160-
.colorScheme
161-
.primary
162-
.withOpacity(0.1)
163-
: Colors.transparent,
164-
child: ListTile(
165-
title: Padding(
166-
padding: const EdgeInsets.only(left: 16),
167-
child: Text(story.title),
168-
),
169-
onTap: () {
170-
setState(() {
171-
selectedAnimation =
172-
animationStories.indexOf(story);
173-
selectedTransition = null;
174-
});
175-
},
176-
selected: animationStories.indexOf(story) ==
177-
selectedAnimation,
178-
),
179-
),
180-
],
152+
Padding(
153+
padding: const EdgeInsets.all(16),
154+
child: Text('Animations',
155+
style: Theme.of(context).textTheme.titleLarge),
181156
),
182-
const Divider(height: 0),
183-
CustomExpansionTile(
184-
title: const Text('Transitions'),
185-
isExpanded: selectedCategory == 1,
186-
onExpansionChanged: () {
187-
setState(() {
188-
if (selectedCategory == 1) {
189-
selectedCategory = null;
190-
} else {
191-
selectedCategory = 1;
192-
}
193-
});
194-
},
195-
children: [
196-
for (final Story story in transitionStories)
197-
ColoredBox(
198-
color: (transitionStories.indexOf(story) ==
199-
selectedTransition)
200-
? Theme.of(context)
201-
.colorScheme
202-
.primary
203-
.withOpacity(0.1)
204-
: Colors.transparent,
205-
child: ListTile(
206-
title: Padding(
207-
padding: const EdgeInsets.only(left: 16),
208-
child: Text(story.title),
209-
),
210-
onTap: () {
211-
setState(() {
212-
selectedTransition =
213-
transitionStories.indexOf(story);
214-
selectedAnimation = null;
215-
});
216-
},
217-
selected: transitionStories.indexOf(story) ==
218-
selectedTransition,
219-
),
157+
// CustomExpansionTile(
158+
// title: const Text('Animations'),
159+
// isExpanded: selectedCategory == 0,
160+
// onExpansionChanged: () {
161+
// setState(() {
162+
// if (selectedCategory == 0) {
163+
// selectedCategory = null;
164+
// } else {
165+
// selectedCategory = 0;
166+
// }
167+
// });
168+
// },
169+
// children: [
170+
for (final Story story in animationStories)
171+
Material(
172+
type: MaterialType.transparency,
173+
borderRadius: const BorderRadius.only(
174+
topRight: Radius.circular(32),
175+
bottomRight: Radius.circular(32),
176+
),
177+
clipBehavior: Clip.antiAlias,
178+
child: ListTile(
179+
title: Padding(
180+
padding: const EdgeInsets.only(left: 16),
181+
child: Text(story.title),
220182
),
221-
],
183+
onTap: () {
184+
setState(() {
185+
selectedAnimation = animationStories.indexOf(story);
186+
selectedTransition = null;
187+
});
188+
},
189+
selected:
190+
animationStories.indexOf(story) == selectedAnimation,
191+
),
192+
),
193+
// ],
194+
// ),
195+
const Divider(height: 0, indent: 16, endIndent: 16),
196+
Padding(
197+
padding: const EdgeInsets.all(16),
198+
child: Text('Transitions',
199+
style: Theme.of(context).textTheme.titleLarge),
222200
),
201+
// CustomExpansionTile(
202+
// title: const Text('Transitions'),
203+
// isExpanded: selectedCategory == 1,
204+
// onExpansionChanged: () {
205+
// setState(() {
206+
// if (selectedCategory == 1) {
207+
// selectedCategory = null;
208+
// } else {
209+
// selectedCategory = 1;
210+
// }
211+
// });
212+
// },
213+
// children: [
214+
for (final Story story in transitionStories)
215+
Material(
216+
type: MaterialType.transparency,
217+
borderRadius: const BorderRadius.only(
218+
topRight: Radius.circular(32),
219+
bottomRight: Radius.circular(32),
220+
),
221+
clipBehavior: Clip.antiAlias,
222+
child: ListTile(
223+
title: Padding(
224+
padding: const EdgeInsets.only(left: 16),
225+
child: Text(story.title),
226+
),
227+
onTap: () {
228+
setState(() {
229+
selectedTransition = transitionStories.indexOf(story);
230+
selectedAnimation = null;
231+
});
232+
},
233+
selected: transitionStories.indexOf(story) ==
234+
selectedTransition,
235+
),
236+
),
237+
// ],
238+
// ),
223239
const Divider(height: 0),
224240
],
225241
),
226242
),
227-
const VerticalDivider(width: 2),
243+
// const VerticalDivider(width: 2),
228244
Expanded(
229245
flex: 3,
230246
child: ContentView(

0 commit comments

Comments
 (0)