37 lines
1.3 KiB
Dart
37 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../core/app_keys.dart';
|
|
import '../core/theme/app_theme.dart';
|
|
import '../core/theme/app_typography.dart';
|
|
import 'router.dart';
|
|
|
|
class SmartGridApp extends ConsumerWidget {
|
|
const SmartGridApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final router = ref.watch(routerProvider);
|
|
|
|
return MaterialApp.router(
|
|
title: '鑫潼智电运营管理',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.build(),
|
|
routerConfig: router,
|
|
scaffoldMessengerKey: AppKeys.scaffoldMessenger,
|
|
locale: const Locale('zh', 'CN'),
|
|
supportedLocales: const [Locale('zh', 'CN'), Locale('en', 'US')],
|
|
localizationsDelegates: const [
|
|
GlobalMaterialLocalizations.delegate,
|
|
GlobalWidgetsLocalizations.delegate,
|
|
GlobalCupertinoLocalizations.delegate,
|
|
],
|
|
// 对应 App.vue 中挂在 `page` 上的全局字体设置:15px / 行高 1.6 / on-surface。
|
|
builder: (context, child) => DefaultTextStyle(
|
|
style: appDefaultTextStyle,
|
|
child: child ?? const SizedBox.shrink(),
|
|
),
|
|
);
|
|
}
|
|
} |