Skip to content

Commit 5cca278

Browse files
committed
.
2 parents 840c1ae + ce83cb9 commit 5cca278

23 files changed

+630
-181
lines changed

lib/app/res/theme/app_theme.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class AppTheme {
3030
return ThemeData(
3131
fontFamily: state.fontFamily,
3232
primarySwatch: state.themeColor,
33+
useMaterial3: true,
3334
appBarTheme: AppBarTheme(
3435
systemOverlayStyle: overlayStyle
3536
),

lib/app/views/navigation/flutter_unit.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class FlutterUnit extends StatelessWidget {
3131
child: MaterialApp(
3232
showPerformanceOverlay: state.showPerformanceOverlay,
3333
title: StrUnit.appName,
34+
3435
debugShowCheckedModeBanner: false,
3536
onGenerateRoute: UnitRouter.generateRoute,
3637
localizationsDelegates: GlobalMaterialLocalizations.delegates,

lib/app/views/splash/standard_unit_splash.dart

Lines changed: 70 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'package:flutter_unit/app/blocs/global/global_state.dart';
1313

1414
import 'flutter_unit_text.dart';
1515
import 'dart:ui' as ui;
16+
1617
/// create by 张风捷特烈 on 2020-03-07
1718
/// contact me by email [email protected]
1819
/// 说明: app 闪屏页
@@ -24,75 +25,92 @@ class StandardUnitSplash extends StatefulWidget {
2425
_StandardUnitSplashState createState() => _StandardUnitSplashState();
2526
}
2627

27-
class _StandardUnitSplashState extends State<StandardUnitSplash> with TickerProviderStateMixin {
28-
static const int _minCost = 1500;
28+
class _StandardUnitSplashState extends State<StandardUnitSplash>
29+
with TickerProviderStateMixin {
30+
static const int _minCost = 1500;
2931

30-
int _recoder = 0;
32+
int _recorder = 0;
3133

32-
final Paint paint = Paint()..style=PaintingStyle.stroke..shader= ui.Gradient.linear(
33-
const Offset(0, 0), const Offset(22, 0), [Colors.red,Colors.yellow,Colors.blue,Colors.green], [1/4,2/4,3/4,1],TileMode.mirror,Matrix4.rotationZ(pi/4).storage);
34+
final Paint paint = Paint()
35+
..style = PaintingStyle.stroke
36+
..shader = ui.Gradient.linear(
37+
const Offset(0, 0),
38+
const Offset(22, 0),
39+
[Colors.red, Colors.yellow, Colors.blue, Colors.green],
40+
[1 / 4, 2 / 4, 3 / 4, 1],
41+
TileMode.mirror,
42+
Matrix4.rotationZ(pi / 4).storage,
43+
);
3444

3545
@override
3646
void initState() {
3747
super.initState();
38-
_recoder = DateTime.now().millisecondsSinceEpoch;
39-
SystemChrome.setSystemUIOverlayStyle(
40-
const SystemUiOverlayStyle(
41-
statusBarColor: Colors.transparent,
42-
),
43-
);
48+
_recorder = DateTime.now().millisecondsSinceEpoch;
4449
}
4550

4651
@override
4752
Widget build(BuildContext context) {
4853
final Size winSize = MediaQuery.of(context).size;
49-
return Material(
50-
child: BlocListener<AppBloc, AppState>(
51-
listener: _listenStart,
52-
child: Column(
53-
children: [
54-
const Spacer(),
55-
Expanded(child: Wrap(
56-
direction: Axis.vertical,
57-
alignment: WrapAlignment.center,
58-
crossAxisAlignment: WrapCrossAlignment.center,
59-
children: [
60-
Stack(
61-
children: [
62-
Text("U",style: TextStyle(
63-
fontSize: 26,
64-
height: 1,
65-
fontWeight: FontWeight.bold,
66-
foreground: paint
67-
),),
68-
const FlutterLogo(size: 60),
69-
],
70-
),
71-
const SizedBox(height: 20,),
72-
_buildFlutterUnitText(winSize.height, winSize.width),
73-
],
74-
)),
75-
Expanded(child: Stack(
76-
alignment: Alignment.bottomCenter,
54+
return AnnotatedRegion<SystemUiOverlayStyle>(
55+
value: const SystemUiOverlayStyle(
56+
statusBarColor: Colors.transparent,
57+
statusBarIconBrightness: Brightness.dark),
58+
child: Material(
59+
child: BlocListener<AppBloc, AppState>(
60+
listener: _listenStart,
61+
child: Column(
7762
children: [
78-
Positioned(bottom: 15, child: Wrap(
63+
const Spacer(),
64+
Expanded(
65+
child: Wrap(
7966
direction: Axis.vertical,
8067
alignment: WrapAlignment.center,
8168
crossAxisAlignment: WrapCrossAlignment.center,
82-
children: const [
83-
Text("Power By 张风捷特烈", style: UnitTextStyle.splashShadows),
84-
Text("· 2021 · @编程之王 ", style: UnitTextStyle.splashShadows),
69+
children: [
70+
Stack(
71+
children: [
72+
Text(
73+
"U",
74+
style: TextStyle(
75+
fontSize: 26,
76+
height: 1,
77+
fontWeight: FontWeight.bold,
78+
foreground: paint),
79+
),
80+
const FlutterLogo(size: 60),
81+
],
82+
),
83+
const SizedBox(
84+
height: 20,
85+
),
86+
_buildFlutterUnitText(winSize.height, winSize.width),
8587
],
8688
)),
89+
Expanded(
90+
child: Stack(
91+
alignment: Alignment.bottomCenter,
92+
children: [
93+
Positioned(
94+
bottom: 15,
95+
child: Wrap(
96+
direction: Axis.vertical,
97+
alignment: WrapAlignment.center,
98+
crossAxisAlignment: WrapCrossAlignment.center,
99+
children: const [
100+
Text("Power By 张风捷特烈",
101+
style: UnitTextStyle.splashShadows),
102+
Text("· 2021 · @编程之王 ",
103+
style: UnitTextStyle.splashShadows),
104+
],
105+
)),
106+
],
107+
))
87108
],
88-
))
89-
],
90-
)
109+
)),
91110
),
92111
);
93112
}
94113

95-
96114
Widget _buildFlutterUnitText(double winH, double winW) {
97115
return FlutterUnitText(
98116
text: StrUnit.appName,
@@ -102,17 +120,15 @@ class _StandardUnitSplashState extends State<StandardUnitSplash> with TickerProv
102120

103121
// 监听资源加载完毕,启动,触发事件
104122
void _listenStart(BuildContext context, AppState state) {
105-
int cost = DateTime.now().millisecondsSinceEpoch - _recoder;
106-
BlocProvider.of<WidgetsBloc>(context).add(const EventTabTap(WidgetFamily.statelessWidget));
123+
int cost = DateTime.now().millisecondsSinceEpoch - _recorder;
124+
BlocProvider.of<WidgetsBloc>(context)
125+
.add(const EventTabTap(WidgetFamily.statelessWidget));
107126
BlocProvider.of<LikeWidgetBloc>(context).add(const EventLoadLikeData());
108127
BlocProvider.of<CategoryBloc>(context).add(const EventLoadCategory());
109-
if(cost<_minCost){
110-
Future.delayed(Duration(milliseconds: _minCost-cost)).then((value){
128+
if (cost < _minCost) {
129+
Future.delayed(Duration(milliseconds: _minCost - cost)).then((value) {
111130
Navigator.of(context).pushReplacementNamed(UnitRouter.nav);
112131
});
113132
}
114-
115133
}
116-
117134
}
118-

0 commit comments

Comments
 (0)