feat(splash): 调整了 web 端启动屏样式
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:bistro/common/global.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
//import 'common/access_control_filter.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
// import 'package:flutter_native_splash/flutter_native_splash_web.dart';
|
||||
|
||||
// import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'app.dart';
|
||||
@@ -14,6 +13,10 @@ import 'router/router.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.edgeToEdge,
|
||||
overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top],
|
||||
);
|
||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||
runApp(const Bistro());
|
||||
}
|
||||
@@ -28,18 +31,16 @@ class Bistro extends StatelessWidget {
|
||||
title: '小酒馆',
|
||||
theme: ThemeData(
|
||||
fontFamily: "SongTiHeavy",
|
||||
primaryColor: const Color(0xFFff857a),
|
||||
// primaryColor: const Color(0xFF5f2500),
|
||||
primaryColorDark: Colors.white60,
|
||||
appBarTheme: const AppBarTheme(color: Colors.white),
|
||||
bottomAppBarTheme: const BottomAppBarTheme(color: Color(0xFFFFF7F8)),
|
||||
colorScheme: ColorScheme.fromSwatch(
|
||||
primarySwatch: Colors.amber,
|
||||
)
|
||||
.copyWith(
|
||||
secondary: Colors.deepOrangeAccent,
|
||||
)
|
||||
.copyWith(background: const Color(0xFFFFF7F8)),
|
||||
primaryColor: const Color(0xFFD56937),
|
||||
primaryColorDark: const Color(0xFFD56937),
|
||||
scaffoldBackgroundColor: const Color(0xFF939D99),
|
||||
appBarTheme: const AppBarTheme(color: Color(0xff384444)),
|
||||
bottomAppBarTheme: const BottomAppBarTheme(
|
||||
color: Color(0xff2a2a22), surfaceTintColor: Color(0xffd56937)),
|
||||
colorScheme: const ColorScheme.dark(
|
||||
primary: Color(0xFFD56937),
|
||||
secondary: Color(0xFFC8C2B4),
|
||||
background: Color(0xff384444)),
|
||||
),
|
||||
home: const BistroFrame(
|
||||
title: '小酒馆',
|
||||
@@ -127,18 +128,19 @@ class BistroFrameState extends State<BistroFrame> {
|
||||
// print('ready in 3...');
|
||||
// }
|
||||
// await Future.delayed(const Duration(seconds: 1));
|
||||
if (kDebugMode) {
|
||||
print('ready in 2...');
|
||||
}
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
if (kDebugMode) {
|
||||
print('ready in 1...');
|
||||
}
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
if (kDebugMode) {
|
||||
print('go!');
|
||||
}
|
||||
FlutterNativeSplash.remove();
|
||||
// if (kDebugMode) {
|
||||
// print('ready in 2...');
|
||||
// }
|
||||
// await Future.delayed(const Duration(seconds: 1));
|
||||
// if (kDebugMode) {
|
||||
// print('ready in 1...');
|
||||
// }
|
||||
// await Future.delayed(const Duration(seconds: 1));
|
||||
// if (kDebugMode) {
|
||||
// print('go!');
|
||||
// }
|
||||
await Future.delayed(const Duration(seconds: 10));
|
||||
// FlutterNativeSplash.remove();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -179,13 +181,14 @@ class BistroFrameState extends State<BistroFrame> {
|
||||
|
||||
//设置默认未选中的状态
|
||||
double size = 14;
|
||||
Color color = Colors.black87;
|
||||
bool isShow = item["display"];
|
||||
|
||||
Color color = Theme.of(context).colorScheme.secondary;
|
||||
TextStyle style = TextStyle(
|
||||
fontSize: size,
|
||||
color: color,
|
||||
);
|
||||
|
||||
bool isShow = item["display"];
|
||||
|
||||
Widget child;
|
||||
if (!isShow) {
|
||||
child = Container();
|
||||
|
||||
Reference in New Issue
Block a user