-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:feat: Added the function of recording the last usage configuration
- Loading branch information
Showing
19 changed files
with
291 additions
and
80 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
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
File renamed without changes.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,66 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:once_power/model/types.dart'; | ||
import 'package:once_power/model/values.dart'; | ||
import 'package:once_power/utils/package_info.dart'; | ||
import 'package:once_power/utils/storage.dart'; | ||
import 'package:window_manager/window_manager.dart'; | ||
|
||
class Global { | ||
static late bool save; | ||
static ModeType? modeType; | ||
static bool? caseSensitive; | ||
static bool? dateRename; | ||
static bool? exchangeSeat; | ||
static bool? appendMode; | ||
static bool? addFolder; | ||
// static bool? lowercase; | ||
// static bool? capital; | ||
// static bool? digit; | ||
// static bool? nonLetter; | ||
// static bool? punctuation; | ||
static bool? deleteLength; | ||
static String? dateLength; | ||
static String? prefixNum; | ||
static String? suffixNum; | ||
static String? startNum; | ||
|
||
static Future init() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
await windowManager.ensureInitialized(); | ||
await StorageUtil.init(); | ||
await PackageDesc.init(); | ||
|
||
WindowOptions options = const WindowOptions( | ||
size: Size(1000, 600), | ||
minimumSize: Size(1000, 600), | ||
center: true, | ||
title: 'OncePower', | ||
); | ||
|
||
windowManager.waitUntilReadyToShow(options, () async { | ||
await windowManager.show(); | ||
await windowManager.focus(); | ||
}); | ||
|
||
save = StorageUtil().getBool(AppValue.save) ?? false; | ||
if (save) { | ||
int? index = StorageUtil().getInt(AppValue.modeType); | ||
if (index != null) modeType = ModeType.values[index]; | ||
caseSensitive = StorageUtil().getBool(AppValue.caseSensitive); | ||
dateRename = StorageUtil().getBool(AppValue.dateRename); | ||
exchangeSeat = StorageUtil().getBool(AppValue.exchangeSeat); | ||
appendMode = StorageUtil().getBool(AppValue.appendMode); | ||
addFolder = StorageUtil().getBool(AppValue.addFolder); | ||
// lowercase = StorageUtil().getBool(AppValue.lowercase); | ||
// capital = StorageUtil().getBool(AppValue.capital); | ||
// digit = StorageUtil().getBool(AppValue.digit); | ||
// nonLetter = StorageUtil().getBool(AppValue.nonLetter); | ||
// punctuation = StorageUtil().getBool(AppValue.punctuation); | ||
deleteLength = StorageUtil().getBool(AppValue.deleteLength); | ||
dateLength = StorageUtil().getString(AppValue.dateLength); | ||
prefixNum = StorageUtil().getString(AppValue.prefixNum); | ||
suffixNum = StorageUtil().getString(AppValue.suffixNum); | ||
startNum = StorageUtil().getString(AppValue.startNum); | ||
} | ||
} | ||
} |
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,20 @@ | ||
class AppValue { | ||
static String language = 'language'; | ||
static String save = 'save'; | ||
static String modeType = 'modeType'; | ||
static String caseSensitive = 'caseSensitive'; | ||
static String dateRename = 'dateRename'; | ||
static String exchangeSeat = 'exchangeSeat'; | ||
static String appendMode = 'appendMode'; | ||
static String addFolder = 'addFolder'; | ||
// static String lowercase = 'lowercase'; | ||
// static String capital = 'capital'; | ||
// static String digit = 'digit'; | ||
// static String nonLetter = 'nonLetter'; | ||
// static String punctuation = 'punctuation'; | ||
static String deleteLength = 'deleteLength'; | ||
static String dateLength = 'dateLength'; | ||
static String prefixNum = 'prefixNum'; | ||
static String suffixNum = 'suffixNum'; | ||
static String startNum = 'startNum'; | ||
} |
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
Oops, something went wrong.