37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:shadcn_ui/shadcn_ui.dart';
|
|
|
|
import '../common/router/app_router.dart';
|
|
import '../common/theme/jinzhi_theme.dart';
|
|
import '../common/theme/spacing.dart';
|
|
import '../common/theme/theme_controller.dart';
|
|
|
|
class JinzhiApp extends ConsumerWidget {
|
|
const JinzhiApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final router = ref.watch(routerProvider);
|
|
final mode = ref.watch(themeModeControllerProvider);
|
|
final textTheme = ShadTextTheme();
|
|
return ShadApp.router(
|
|
title: '金值',
|
|
themeMode: mode,
|
|
theme: ShadThemeData(
|
|
brightness: Brightness.light,
|
|
colorScheme: jinzhiLightScheme,
|
|
textTheme: textTheme,
|
|
radius: BorderRadius.circular(Spacing.radiusBase),
|
|
),
|
|
darkTheme: ShadThemeData(
|
|
brightness: Brightness.dark,
|
|
colorScheme: jinzhiDarkScheme,
|
|
textTheme: textTheme,
|
|
radius: BorderRadius.circular(Spacing.radiusBase),
|
|
),
|
|
routerConfig: router,
|
|
);
|
|
}
|
|
}
|