Skip to content

Commit

Permalink
ui: update
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Oct 11, 2024
1 parent 98fae05 commit f80ee71
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import 'package:ui/welcome_page.dart';
import 'package:ui/widgets/utils.dart';

void main() {
initializeDateFormatting().then((_) => runApp(MyApp()));
initializeDateFormatting()
.then((_) => runApp(const ProviderScope(child: MyApp())));
}

class MyApp extends ConsumerStatefulWidget {
Expand Down Expand Up @@ -45,15 +46,17 @@ CustomTransitionPage buildPageWithDefaultTransition<T>({

class _MyAppState extends ConsumerState<MyApp> {
// This widget is the root of your application.

@override
Widget build(BuildContext context) {
var padding = isSmallScreen(context) ? 5.0 : 20.0;
// GoRouter configuration
final shellRoute = ShellRoute(
builder: (BuildContext context, GoRouterState state, Widget child) {
return SelectionArea(
child: MainSkeleton(
body: Padding(
padding: EdgeInsets.all(isSmallScreen(context) ? 5 : 20),
padding: EdgeInsets.only(left: padding, right: padding, top: 5, bottom: 5),
child: child),
),
);
Expand Down Expand Up @@ -125,28 +128,26 @@ class _MyAppState extends ConsumerState<MyApp> {
],
);

return ProviderScope(
child: MaterialApp.router(
title: 'Polaris 影视追踪下载',
theme: ThemeData(
fontFamily: "NotoSansSC",
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.blueAccent,
brightness: Brightness.dark,
surface: Colors.black87),
useMaterial3: true,
//scaffoldBackgroundColor: Color.fromARGB(255, 26, 24, 24)
tooltipTheme: TooltipThemeData(
textStyle: const TextStyle(
color: Colors.grey,
),
decoration: BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.circular(20),
),
)),
routerConfig: router,
),
return MaterialApp.router(
title: 'Polaris 影视追踪下载',
theme: ThemeData(
fontFamily: "NotoSansSC",
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.blueAccent,
brightness: Brightness.dark,
surface: Colors.black87),
useMaterial3: true,
//scaffoldBackgroundColor: Color.fromARGB(255, 26, 24, 24)
tooltipTheme: TooltipThemeData(
textStyle: const TextStyle(
color: Colors.grey,
),
decoration: BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.circular(20),
),
)),
routerConfig: router,
);
}
}
Expand Down Expand Up @@ -190,7 +191,7 @@ class _MainSkeletonState extends State<MainSkeleton> {
// the App.build method, and use it to set our appbar title.
title: TextButton(
onPressed: () => context.go(WelcomePage.routeTv),
child: Text(
child: const Text(
"Polaris",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 28),
Expand Down

0 comments on commit f80ee71

Please sign in to comment.