37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:yaml/yaml.dart';
|
|
import 'package:flutter/services.dart' show rootBundle;
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'app/enum/config_path_enum.dart';
|
|
import 'features/page/presentation/login.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
final configString = await rootBundle.loadString(
|
|
ConfigPathEnum.uiConfig.configPath,
|
|
);
|
|
final config = loadYaml(configString);
|
|
final primaryColor = Color(config['theme']['primaryColor']);
|
|
|
|
runApp(ProviderScope(child: MyApp(primaryColor)));
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
final Color primaryColor;
|
|
const MyApp(this.primaryColor, {super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'WMS移动终端',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: primaryColor),
|
|
useMaterial3: true,
|
|
// extensions: [TDThemeData.fromJson('main', AppConfig.tdThemeConfig)!],
|
|
),
|
|
home: const Login(),
|
|
);
|
|
}
|
|
}
|