Skip to content

Commit c964733

Browse files
committed
Added some Flare🔥
1 parent 88ecd4e commit c964733

File tree

5 files changed

+50
-65
lines changed

5 files changed

+50
-65
lines changed

‎assets/flare/card.flr‎

1.12 KB
Binary file not shown.

‎lib/pages/liquid_page.dart‎

Lines changed: 26 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:dashboard_reborn/utils/colors.dart';
22
import 'package:dashboard_reborn/utils/text_styles.dart';
3-
import 'package:dashboard_reborn/utils/ui_helpers.dart';
3+
import 'package:flare_flutter/flare_actor.dart';
44
import 'package:flutter/material.dart';
55
import 'package:liquid_swipe/Constants/Helpers.dart';
66
import 'package:liquid_swipe/liquid_swipe.dart';
@@ -15,7 +15,7 @@ class _MyLiquidPageState extends State<MyLiquidPage> {
1515
Widget build(BuildContext context) {
1616
final pages = [
1717
Container(
18-
color: MaterialColors.pink,
18+
color: MyColors.white,
1919
child: Row(
2020
mainAxisAlignment: MainAxisAlignment.center,
2121
crossAxisAlignment: CrossAxisAlignment.center,
@@ -25,33 +25,24 @@ class _MyLiquidPageState extends State<MyLiquidPage> {
2525
crossAxisAlignment: CrossAxisAlignment.center,
2626
children: <Widget>[
2727
Container(
28-
width: 300,
29-
height: 300,
30-
child: Container(
31-
width: 200.0,
32-
height: 200.0,
33-
child: Image.asset(
34-
'assets/icon/icon-legacy.png',
35-
fit: BoxFit.cover,
36-
),
28+
width: 350,
29+
height: 350,
30+
child: FlareActor(
31+
'assets/flare/card.flr',
32+
animation: 'animation',
3733
),
3834
),
39-
SizedBox(
40-
height: 20.0,
41-
),
4235
Text(
43-
'<< Swipe in any direction >>',
44-
style: isThemeCurrentlyDark(context)
45-
? SubHeadingStylesMaterial.light
46-
: SubHeadingStylesMaterial.dark,
36+
'<< Swipe >>',
37+
style: SubHeadingStylesMaterial.dark,
4738
),
4839
],
4940
)
5041
],
5142
),
5243
),
5344
Container(
54-
color: MaterialColors.yellow,
45+
color: MyColors.accent,
5546
child: Row(
5647
mainAxisAlignment: MainAxisAlignment.center,
5748
crossAxisAlignment: CrossAxisAlignment.center,
@@ -61,33 +52,24 @@ class _MyLiquidPageState extends State<MyLiquidPage> {
6152
crossAxisAlignment: CrossAxisAlignment.center,
6253
children: <Widget>[
6354
Container(
64-
width: 300,
65-
height: 300,
66-
child: Container(
67-
width: 200.0,
68-
height: 200.0,
69-
child: Image.asset(
70-
'assets/icon/icon-legacy.png',
71-
fit: BoxFit.cover,
72-
),
55+
width: 350,
56+
height: 350,
57+
child: FlareActor(
58+
'assets/flare/card.flr',
59+
animation: 'animation',
7360
),
7461
),
75-
SizedBox(
76-
height: 20.0,
77-
),
7862
Text(
79-
'<< Swipe in any direction >>',
80-
style: isThemeCurrentlyDark(context)
81-
? SubHeadingStylesMaterial.light
82-
: SubHeadingStylesMaterial.dark,
63+
'<< Swipe >>',
64+
style: SubHeadingStylesMaterial.dark,
8365
),
8466
],
8567
)
8668
],
8769
),
8870
),
8971
Container(
90-
color: MaterialColors.green,
72+
color: MyColors.black,
9173
child: Row(
9274
mainAxisAlignment: MainAxisAlignment.center,
9375
crossAxisAlignment: CrossAxisAlignment.center,
@@ -97,25 +79,16 @@ class _MyLiquidPageState extends State<MyLiquidPage> {
9779
crossAxisAlignment: CrossAxisAlignment.center,
9880
children: <Widget>[
9981
Container(
100-
width: 300,
101-
height: 300,
102-
child: Container(
103-
width: 200.0,
104-
height: 200.0,
105-
child: Image.asset(
106-
'assets/icon/icon-legacy.png',
107-
fit: BoxFit.cover,
108-
),
82+
width: 350,
83+
height: 350,
84+
child: FlareActor(
85+
'assets/flare/card.flr',
86+
animation: 'animation',
10987
),
11088
),
111-
SizedBox(
112-
height: 20.0,
113-
),
11489
Text(
115-
'<< Swipe in any direction >>',
116-
style: isThemeCurrentlyDark(context)
117-
? SubHeadingStylesMaterial.light
118-
: SubHeadingStylesMaterial.dark,
90+
'<< Swipe >>',
91+
style: SubHeadingStylesMaterial.light,
11992
),
12093
],
12194
)
@@ -126,7 +99,7 @@ class _MyLiquidPageState extends State<MyLiquidPage> {
12699

127100
return LiquidSwipe(
128101
pages: pages,
129-
initialPage: 1,
102+
initialPage: 0,
130103
fullTransitionValue: 350.0,
131104
enableLoop: true,
132105
waveType: WaveType.liquidReveal,

‎lib/pages/material_page.dart‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:dashboard_reborn/utils/text_styles.dart';
66
import 'package:dashboard_reborn/utils/ui_helpers.dart';
77
import 'package:dashboard_reborn/widgets/sexy_bottom_sheet.dart';
88
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
9+
import 'package:flare_flutter/flare_actor.dart';
910
import 'package:flutter/cupertino.dart';
1011
import 'package:flutter/material.dart';
1112
import 'package:flutter/rendering.dart';
@@ -134,15 +135,11 @@ class _MyMaterialPageState extends State<MyMaterialPage> {
134135
child: Hero(
135136
tag: 'elt1',
136137
child: Container(
137-
width: 300,
138-
height: 300,
139-
child: Container(
140-
width: 200.0,
141-
height: 200.0,
142-
child: Image.asset(
143-
'assets/icon/icon-legacy.png',
144-
fit: BoxFit.cover,
145-
),
138+
width: 350,
139+
height: 350,
140+
child: FlareActor(
141+
'assets/flare/card.flr',
142+
animation: 'animation',
146143
),
147144
),
148145
),
@@ -152,8 +149,7 @@ class _MyMaterialPageState extends State<MyMaterialPage> {
152149
right: 15.0,
153150
child: FloatingActionButton(
154151
heroTag: 'elt2',
155-
foregroundColor:
156-
invertInvertColorsMild(context),
152+
foregroundColor: MyColors.light,
157153
backgroundColor: MyColors.accent,
158154
elevation: 5.0,
159155
child: Icon(EvaIcons.close),
@@ -205,7 +201,7 @@ class _MyMaterialPageState extends State<MyMaterialPage> {
205201
width: 40.0,
206202
child: FloatingActionButton(
207203
heroTag: 'elt2',
208-
foregroundColor: invertInvertColorsMild(context),
204+
foregroundColor: MyColors.light,
209205
backgroundColor: MyColors.accent,
210206
elevation: 3.0,
211207
child: Icon(EvaIcons.infoOutline),

‎pubspec.lock‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ packages:
7878
url: "https://pub.dartlang.org"
7979
source: hosted
8080
version: "2.0.0"
81+
flare_dart:
82+
dependency: transitive
83+
description:
84+
name: flare_dart
85+
url: "https://pub.dartlang.org"
86+
source: hosted
87+
version: "2.3.0"
88+
flare_flutter:
89+
dependency: "direct main"
90+
description:
91+
name: flare_flutter
92+
url: "https://pub.dartlang.org"
93+
source: hosted
94+
version: "1.8.1"
8195
flutter:
8296
dependency: "direct main"
8397
description: flutter

‎pubspec.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies:
1212
cupertino_icons: ^0.1.2
1313
dynamic_theme: ^1.0.1
1414
eva_icons_flutter: ^2.0.0
15+
flare_flutter: ^1.8.1
1516
gradient_widgets: ^0.5.0
1617
liquid_swipe: '1.2.0'
1718
url_launcher: ^5.2.4
@@ -35,6 +36,7 @@ flutter:
3536

3637
assets:
3738
- assets/credits/
39+
- assets/flare/
3840
- assets/icon/
3941
- assets/music/
4042

0 commit comments

Comments
 (0)