11import 'dart:async' ;
22
3- import 'package:fl_lib/fl_lib.dart' as fl;
4- import 'package:fl_lib/fl_lib.dart' show ChineseThemeData;
53import 'package:flutter/material.dart' ;
64import 'package:provider/provider.dart' ;
75import 'package:window_manager/window_manager.dart' ;
6+
87import 'constants/app_branding.dart' ;
98import 'generated/l10n/l10n.dart' ;
9+ import 'kit/kit.dart' as kit;
10+ import 'kit/kit.dart' show ChineseThemeData;
1011import 'models/aria2_instance.dart' ;
1112import 'models/settings.dart' ;
1213import 'pages/download_page/download_page.dart' ;
@@ -53,14 +54,30 @@ class _ThemeProviderState extends State<_ThemeProvider> {
5354
5455 @override
5556 Widget build (BuildContext context) {
56- final display = context.select< Settings , ({Locale ? locale, bool hideTitleBar, Color primaryColor, ThemeMode themeMode})> ((s) => (locale: s.locale, hideTitleBar: s.hideTitleBar, primaryColor: s.primaryColor, themeMode: s.themeMode));
57+ final display = context
58+ .select<
59+ Settings ,
60+ ({
61+ Locale ? locale,
62+ bool hideTitleBar,
63+ Color primaryColor,
64+ ThemeMode themeMode,
65+ })
66+ > (
67+ (s) => (
68+ locale: s.locale,
69+ hideTitleBar: s.hideTitleBar,
70+ primaryColor: s.primaryColor,
71+ themeMode: s.themeMode,
72+ ),
73+ );
5774
5875 return MaterialApp (
5976 title: kAppName,
6077 locale: display.locale,
6178 localizationsDelegates: AppLocalizations .localizationsDelegates,
6279 supportedLocales: AppLocalizations .supportedLocales,
63- builder: (context, child) => fl .VirtualWindowFrame (
80+ builder: (context, child) => kit .VirtualWindowFrame (
6481 title: kAppName,
6582 showCaption: display.hideTitleBar,
6683 child: ClipRect (child: child ?? const SizedBox .shrink ()),
@@ -203,7 +220,7 @@ class _HomeWrapperState extends State<_HomeWrapper> with Loggable {
203220 @override
204221 Widget build (BuildContext context) {
205222 if (! _isInitialized) {
206- return Scaffold (body: Center (child: fl .SizedLoading .medium));
223+ return Scaffold (body: Center (child: kit .SizedLoading .medium));
207224 }
208225 return const MainWindow ();
209226 }
@@ -552,8 +569,7 @@ class _MainWindowState extends State<MainWindow> with WindowListener, Loggable {
552569 connectedCount == 0
553570 ? l10n.notConnected
554571 : '${l10n .connected }: $connectedCount ' ,
555- if (settings.showTraySpeed)
556- l10n.totalSpeed (formatSpeed (summary.speed)),
572+ if (settings.showTraySpeed) l10n.totalSpeed (formatSpeed (summary.speed)),
557573 l10n.activeTasks (summary.active.toString ()),
558574 l10n.waitingTasks (summary.waiting.toString ()),
559575 ];
@@ -902,7 +918,7 @@ class _MainWindowState extends State<MainWindow> with WindowListener, Loggable {
902918}
903919
904920({int active, int waiting, int resumable, int pausable, int speed})
905- _computeTaskSummary (List <DownloadTask > tasks) {
921+ _computeTaskSummary (List <DownloadTask > tasks) {
906922 var active = 0 ;
907923 var waiting = 0 ;
908924 var resumable = 0 ;
@@ -940,9 +956,13 @@ class _StatusBar extends StatelessWidget {
940956 Widget build (BuildContext context) {
941957 final l10n = AppLocalizations .of (context)! ;
942958 final colorScheme = Theme .of (context).colorScheme;
943- final summary = context.select< DownloadDataService , ({int active, int waiting, int resumable, int pausable, int speed})> ((service) {
944- return _computeTaskSummary (service.tasks);
945- });
959+ final summary = context
960+ .select<
961+ DownloadDataService ,
962+ ({int active, int waiting, int resumable, int pausable, int speed})
963+ > ((service) {
964+ return _computeTaskSummary (service.tasks);
965+ });
946966
947967 return Container (
948968 padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 12 ),
@@ -967,28 +987,19 @@ class _StatusBar extends StatelessWidget {
967987 label: Text (l10n.totalSpeed (formatSpeed (summary.speed))),
968988 avatar: const Icon (Icons .speed, size: 16 ),
969989 backgroundColor: colorScheme.surfaceContainerHighest,
970- padding: const EdgeInsets .symmetric (
971- horizontal: 8 ,
972- vertical: 6 ,
973- ),
990+ padding: const EdgeInsets .symmetric (horizontal: 8 , vertical: 6 ),
974991 ),
975992 Chip (
976993 label: Text (l10n.activeTasks (summary.active.toString ())),
977994 avatar: const Icon (Icons .task_alt, size: 16 ),
978995 backgroundColor: colorScheme.surfaceContainerHighest,
979- padding: const EdgeInsets .symmetric (
980- horizontal: 8 ,
981- vertical: 6 ,
982- ),
996+ padding: const EdgeInsets .symmetric (horizontal: 8 , vertical: 6 ),
983997 ),
984998 Chip (
985999 label: Text (l10n.waitingTasks (summary.waiting.toString ())),
9861000 avatar: const Icon (Icons .pending, size: 16 ),
9871001 backgroundColor: colorScheme.surfaceContainerHighest,
988- padding: const EdgeInsets .symmetric (
989- horizontal: 8 ,
990- vertical: 6 ,
991- ),
1002+ padding: const EdgeInsets .symmetric (horizontal: 8 , vertical: 6 ),
9921003 ),
9931004 ],
9941005 ),
0 commit comments