mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
BBreaking change
This commit is contained in:
28
lib/app.dart
28
lib/app.dart
@@ -1,4 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
import 'package:toolbox/view/page/home.dart';
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -7,13 +9,23 @@ class MyApp extends StatelessWidget {
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'ToolBox',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
darkTheme: ThemeData.dark(),
|
||||
home: const MyHomePage(title: 'ToolBox'),
|
||||
);
|
||||
return ValueListenableBuilder<int>(
|
||||
valueListenable: locator<SettingStore>().primaryColor.listenable(),
|
||||
builder: (_, value, __) {
|
||||
final primaryColor = Color(value);
|
||||
return MaterialApp(
|
||||
title: 'ToolBox',
|
||||
theme: ThemeData(
|
||||
primaryColor: primaryColor,
|
||||
appBarTheme: AppBarTheme(backgroundColor: primaryColor),
|
||||
floatingActionButtonTheme:
|
||||
FloatingActionButtonThemeData(backgroundColor: primaryColor),
|
||||
iconTheme: IconThemeData(color: primaryColor),
|
||||
primaryIconTheme: IconThemeData(color: primaryColor),
|
||||
),
|
||||
darkTheme: ThemeData.dark().copyWith(primaryColor: primaryColor),
|
||||
home: MyHomePage(primaryColor: primaryColor),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user