Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- 补全控制器销毁逻辑,避免内存泄露
- 修复了网页端中无法通过文件导入数据的问题
- 修复了单词推送不截止的问题
- 修复了二次点击选项时真误颜色消失的问题

## v1.0.0 - 2026-3-18 - (100000)

Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java
.cxx/
build/
.kotlin/

# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
Expand Down
4 changes: 4 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
6 changes: 5 additions & 1 deletion lib/funcs/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ class ChooseButtonBox extends StatefulWidget {
}
class _ChooseButtonBoxState extends State<ChooseButtonBox> {
Color? color;
bool isChoosed = false;

@override
Widget build(BuildContext context) {
color ??= widget.cl ?? Theme.of(context).colorScheme.primaryContainer.withAlpha(150);
Expand All @@ -443,6 +445,8 @@ class _ChooseButtonBoxState extends State<ChooseButtonBox> {
child: ElevatedButton(
onPressed: () {
setState(() {
if(isChoosed) return;
isChoosed = true;
bool? ans = widget.chose(widget.index);
if(ans != null) {
if(widget.isAnimated) {
Expand All @@ -464,7 +468,7 @@ class _ChooseButtonBoxState extends State<ChooseButtonBox> {
}
}
} else {
color = Theme.of(context).colorScheme.onPrimary.withAlpha(150);
color = Theme.of(context).colorScheme.primaryContainer.withAlpha(150);
}
});
},
Expand Down
7 changes: 3 additions & 4 deletions lib/pages/setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,14 @@ class _SettingPage extends State<SettingPage> {
),
onPressed: () async {
context.read<Global>().uiLogger.info("选择手动导入单词");
FilePickerResult? result =
await FilePicker.pickFiles(
allowMultiple: false,
PlatformFile? result =
await FilePicker.pickFile(
type: FileType.custom,
allowedExtensions: ['json'],
);
if (result != null) {
String jsonString;
PlatformFile platformFile = result.files.first;
PlatformFile platformFile = result;
try {
jsonString = await platformFile.xFile
.readAsString();
Expand Down
9 changes: 4 additions & 5 deletions lib/sub_pages_builder/setting_pages/sync_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,15 @@ class _DataSyncPage extends State<DataSyncPage> {
ElevatedButton(
onPressed: () async {
context.read<Global>().uiLogger.info("导入软件数据");
FilePickerResult? result = await FilePicker.pickFiles(
allowMultiple: false,
PlatformFile? result = await FilePicker.pickFile(
type: FileType.custom,
allowedExtensions: ['json'],
);
if (result != null) {
String jsonString;
PlatformFile platformFile = result.files.first;
if (platformFile.bytes != null){
jsonString = utf8.decode(platformFile.bytes!);
PlatformFile platformFile = result;
if ((await platformFile.readAsBytes()).isNotEmpty){
jsonString = utf8.decode(await platformFile.readAsBytes());
} else if (platformFile.path != null && !kIsWeb) {
jsonString = await io.File(platformFile.path!).readAsString();
} else {
Expand Down
Loading