-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
118 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// 外观 | ||
enum Appearance { | ||
/// 浅色模式 | ||
light, | ||
|
||
/// 暗黑模式 | ||
dark, | ||
|
||
/// 跟随系统 | ||
auto | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
/// 数据存储类 | ||
class SharedPreferencesUtil { | ||
static SharedPreferences prefs; | ||
|
||
static Future<SharedPreferences> getPrefs() async { | ||
if (prefs == null) { | ||
SharedPreferences sharedPreferences = | ||
await SharedPreferences.getInstance(); | ||
prefs = sharedPreferences; | ||
} | ||
return prefs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:weifangbus/util/appearance.dart'; | ||
|
||
/// 外观 | ||
class AppearanceProvider with ChangeNotifier { | ||
Appearance _appearance; | ||
|
||
Appearance get appearance => _appearance; | ||
|
||
changeModel(Appearance appearance) { | ||
_appearance = appearance; | ||
notifyListeners(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.