Skip to content

Commit

Permalink
feat: 优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
azhon committed Sep 15, 2023
1 parent 6c99a23 commit 1368ef6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/util/preference_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ class PreferencesUtil {
static double getDouble(String key, {double defaultValue = 0.0}) {
return _preferences?.getDouble(key) ?? defaultValue;
}

static Future<bool> remove(String key) {
return _preferences?.remove(key) ?? Future.value(false);
}
}
3 changes: 3 additions & 0 deletions lib/todo_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,6 +25,7 @@ class TodoApp extends StatelessWidget {
required this.home,
this.title = '',
this.theme,
this.darkTheme,
this.libData,
this.localizationsDelegates,
this.debugShowCheckedModeBanner = true,
Expand All @@ -44,6 +46,7 @@ class TodoApp extends StatelessWidget {
home: home,
title: title,
theme: theme,
darkTheme: darkTheme,
supportedLocales: supportedLocales,
navigatorKey: TodoLib.navigatorKey,
navigatorObservers: navigatorObservers + [RouterHistoryObserver()],
Expand Down

0 comments on commit 1368ef6

Please sign in to comment.