Commit a094715 1 parent 69bb875 commit a094715 Copy full SHA for a094715
File tree 1 file changed +15
-0
lines changed
ui/flutter/lib/app/modules/app/views
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import 'package:flutter/material.dart';
2
2
import 'package:flutter_foreground_task/flutter_foreground_task.dart' ;
3
3
import 'package:flutter_localizations/flutter_localizations.dart' ;
4
4
import 'package:get/get.dart' ;
5
+ import 'package:window_manager/window_manager.dart' ; // Import the required packages
5
6
6
7
import '../../../../i18n/message.dart' ;
7
8
import '../../../../theme/theme.dart' ;
8
9
import '../../../../util/locale_manager.dart' ;
10
+ import '../../../../util/util.dart' ; // Import the required packages
9
11
import '../../../routes/app_pages.dart' ;
10
12
import '../controllers/app_controller.dart' ;
11
13
@@ -32,6 +34,19 @@ class AppView extends GetView<AppController> {
32
34
],
33
35
supportedLocales: messages.keys.keys.map ((e) => toLocale (e)).toList (),
34
36
getPages: AppPages .routes,
37
+
38
+ // Add listening to theme changes, set the title bar color according to the current system theme.
39
+ builder: (context, child) {
40
+ // if platform is desktop
41
+ if (Util .isDesktop ()){
42
+ // actual brightness of the UI
43
+ Brightness brightness = Theme .of (context).brightness;
44
+ // Set the title bar to use the actual brightness of the UI
45
+ windowManager.setBrightness (brightness);
46
+ }
47
+ return child! ;
48
+ },
49
+
35
50
),
36
51
);
37
52
}
You can’t perform that action at this time.
0 commit comments