From 1368ef6d1c470e6caefc389a7ef5e9b40333030a Mon Sep 17 00:00:00 2001 From: azhon <958460248@qq.com> Date: Fri, 15 Sep 2023 22:22:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/util/preference_util.dart | 4 ++++ lib/todo_app.dart | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/src/util/preference_util.dart b/lib/src/util/preference_util.dart index 11ff229..0488abf 100644 --- a/lib/src/util/preference_util.dart +++ b/lib/src/util/preference_util.dart @@ -38,4 +38,8 @@ class PreferencesUtil { static double getDouble(String key, {double defaultValue = 0.0}) { return _preferences?.getDouble(key) ?? defaultValue; } + + static Future remove(String key) { + return _preferences?.remove(key) ?? Future.value(false); + } } diff --git a/lib/todo_app.dart b/lib/todo_app.dart index 886f11d..305c84e 100644 --- a/lib/todo_app.dart +++ b/lib/todo_app.dart @@ -12,6 +12,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class TodoApp extends StatelessWidget { final String title; final ThemeData? theme; + final ThemeData? darkTheme; final Widget home; final Size designSize; final TodoLibData? libData; @@ -24,6 +25,7 @@ class TodoApp extends StatelessWidget { required this.home, this.title = '', this.theme, + this.darkTheme, this.libData, this.localizationsDelegates, this.debugShowCheckedModeBanner = true, @@ -44,6 +46,7 @@ class TodoApp extends StatelessWidget { home: home, title: title, theme: theme, + darkTheme: darkTheme, supportedLocales: supportedLocales, navigatorKey: TodoLib.navigatorKey, navigatorObservers: navigatorObservers + [RouterHistoryObserver()],