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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
### Improvement

- 优化了FSRS学习机制
- 听写界面不熄屏
- 优化解压逻辑,避免主线程卡死

### Fix

- 修复了可能的复习列表重复问题
- 补全控制器销毁逻辑,避免内存泄露

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

Expand Down
6 changes: 3 additions & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ android {

compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}

defaultConfig {
Expand Down
32 changes: 23 additions & 9 deletions lib/funcs/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -445,16 +445,24 @@ class _ChooseButtonBoxState extends State<ChooseButtonBox> {
setState(() {
bool? ans = widget.chose(widget.index);
if(ans != null) {
color = Colors.amber;
Future.delayed(widget.isAnimated ? Durations.medium4 : Duration(), (){
setState(() {
if(ans) {
color = Colors.greenAccent;
} else {
color = Colors.redAccent;
}
if(widget.isAnimated) {
color = Colors.amber;
Future.delayed(Durations.medium4, (){
setState(() {
if(ans) {
color = Colors.greenAccent;
} else {
color = Colors.redAccent;
}
});
});
});
} else {
if(ans) {
color = Colors.greenAccent;
} else {
color = Colors.redAccent;
}
}
} else {
color = Theme.of(context).colorScheme.onPrimary.withAlpha(150);
}
Expand Down Expand Up @@ -932,6 +940,12 @@ class _SpellQuestion extends State<SpellQuestion> {
});
}

@override
void dispose() {
controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
context.read<Global>().uiLogger.info("构建拼写题页面,主单词: ${widget.word.arabic}");
Expand Down
7 changes: 5 additions & 2 deletions lib/funcs/utili.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ int calculateButtonBoxLayout(List<String> possible, double width){
}
}

Future<void> extractTarBz2(String inputPath, String outputDir) async {
@pragma('vm:entry-point')
void extractTarBz2((String inputPath, String outputPath) args) async {
final inputPath = args.$1;
final outputDir = args.$2;
final bytes = await io.File(inputPath).readAsBytes();

// 解压 bz2
Expand All @@ -136,7 +139,7 @@ Future<void> extractTarBz2(String inputPath, String outputDir) async {

// 解出文件
for (final file in tarArchive.files) {
final filePath = '$outputDir/${io.Platform.pathSeparator}${file.name}';
final filePath = '$outputDir${io.Platform.pathSeparator}${file.name}';
if (file.isFile) {
final outFile = io.File(filePath);
await outFile.create(recursive: true);
Expand Down
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ class _MyHomePageState extends State<MyHomePage> {
);
}

@override
void dispose(){
_pageController.dispose();
controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
context.read<Global>().uiLogger.fine("构建 MyHomePage");
Expand Down
183 changes: 179 additions & 4 deletions lib/oss_licenses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ const allDependencies = <Package>[
_node_preamble,
_objective_c,
_package_config,
_package_info_plus,
_package_info_plus_platform_interface,
_pana,
_path,
_path_provider,
Expand Down Expand Up @@ -163,6 +165,8 @@ const allDependencies = <Package>[
_uuid,
_vector_math,
_vm_service,
_wakelock_plus,
_wakelock_plus_platform_interface,
_watcher,
_web,
_web_socket,
Expand Down Expand Up @@ -210,7 +214,8 @@ const dependencies = <Package>[
_qr_flutter,
_mobile_scanner,
_cupertino_icons,
_bk_tree
_bk_tree,
_wakelock_plus
];

/// Direct `dev_dependencies`.
Expand Down Expand Up @@ -2232,13 +2237,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
);

/// flutter 3.41.4
/// flutter 3.41.6
const _flutter = Package(
name: 'flutter',
description: 'A framework for writing Flutter applications',
homepage: 'https://flutter.dev',
authors: [],
version: '3.41.4',
version: '3.41.6',
spdxIdentifiers: ['BSD-3-Clause'],
isMarkdown: false,
isSdk: true,
Expand Down Expand Up @@ -4921,6 +4926,90 @@ met:
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
);

/// package_info_plus 9.0.1
const _package_info_plus = Package(
name: 'package_info_plus',
description: 'Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.',
homepage: 'https://github.com/fluttercommunity/plus_plugins',
repository: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus',
authors: [],
version: '9.0.1',
spdxIdentifiers: ['BSD-3-Clause'],
isMarkdown: false,
isSdk: false,
dependencies: [PackageRef('ffi'), PackageRef('flutter'), PackageRef('flutter_web_plugins'), PackageRef('http'), PackageRef('meta'), PackageRef('path'), PackageRef('package_info_plus_platform_interface'), PackageRef('web'), PackageRef('win32'), PackageRef('clock')],
devDependencies: [PackageRef('flutter_lints'), PackageRef('flutter_test'), PackageRef('test')],
license: '''Copyright 2017 The Chromium Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
);

/// package_info_plus_platform_interface 3.2.1
const _package_info_plus_platform_interface = Package(
name: 'package_info_plus_platform_interface',
description: 'A common platform interface for the package_info_plus plugin.',
homepage: 'https://github.com/fluttercommunity/plus_plugins',
repository: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/',
authors: [],
version: '3.2.1',
spdxIdentifiers: ['BSD-3-Clause'],
isMarkdown: false,
isSdk: false,
dependencies: [PackageRef('flutter'), PackageRef('meta'), PackageRef('plugin_platform_interface')],
devDependencies: [PackageRef('flutter_test'), PackageRef('flutter_lints')],
license: '''Copyright 2017 The Chromium Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand Down Expand Up @@ -39942,6 +40031,92 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
);

/// wakelock_plus 1.5.1
const _wakelock_plus = Package(
name: 'wakelock_plus',
description: 'Plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping on Android, iOS, macOS, Windows, Linux, and web.',
repository: 'https://github.com/fluttercommunity/wakelock_plus/tree/main/wakelock_plus',
authors: [],
version: '1.5.1',
spdxIdentifiers: ['BSD-3-Clause'],
isMarkdown: false,
isSdk: false,
dependencies: [PackageRef('flutter'), PackageRef('flutter_web_plugins'), PackageRef('meta'), PackageRef('wakelock_plus_platform_interface'), PackageRef('win32'), PackageRef('dbus'), PackageRef('package_info_plus'), PackageRef('web')],
devDependencies: [PackageRef('flutter_test'), PackageRef('flutter_lints')],
license: '''BSD 3-Clause License

Copyright (c) 2020-2023, creativecreatorormaybenot
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
);

/// wakelock_plus_platform_interface 1.4.0
const _wakelock_plus_platform_interface = Package(
name: 'wakelock_plus_platform_interface',
description: 'A common platform interface for the wakelock_plus plugin used by the different platform implementations.',
repository: 'https://github.com/fluttercommunity/wakelock_plus/tree/main/wakelock_plus_platform_interface',
authors: [],
version: '1.4.0',
spdxIdentifiers: ['BSD-3-Clause'],
isMarkdown: false,
isSdk: false,
dependencies: [PackageRef('flutter'), PackageRef('plugin_platform_interface'), PackageRef('meta')],
devDependencies: [PackageRef('flutter_test'), PackageRef('flutter_lints')],
license: '''BSD 3-Clause License

Copyright (c) 2020-2023, creativecreatorormaybenot
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
);

/// watcher 1.2.1
const _watcher = Package(
name: 'watcher',
Expand Down Expand Up @@ -40572,7 +40747,7 @@ const _arabic_learning = Package(
spdxIdentifiers: ['AGPL-3.0'],
isMarkdown: false,
isSdk: false,
dependencies: [PackageRef('flutter'), PackageRef('window_manager'), PackageRef('path_provider'), PackageRef('provider'), PackageRef('file_picker'), PackageRef('flutter_tts'), PackageRef('just_audio'), PackageRef('just_audio_windows'), PackageRef('flutter_launcher_icons'), PackageRef('shared_preferences'), PackageRef('url_launcher'), PackageRef('sherpa_onnx'), PackageRef('archive'), PackageRef('dio'), PackageRef('fsrs'), PackageRef('idb_shim'), PackageRef('flutter_markdown_plus'), PackageRef('webdav_client'), PackageRef('logging'), PackageRef('flutter_local_notifications'), PackageRef('workmanager'), PackageRef('flutter_webrtc'), PackageRef('network_info_plus'), PackageRef('crypto'), PackageRef('qr_flutter'), PackageRef('mobile_scanner'), PackageRef('cupertino_icons'), PackageRef('bk_tree')],
dependencies: [PackageRef('flutter'), PackageRef('window_manager'), PackageRef('path_provider'), PackageRef('provider'), PackageRef('file_picker'), PackageRef('flutter_tts'), PackageRef('just_audio'), PackageRef('just_audio_windows'), PackageRef('flutter_launcher_icons'), PackageRef('shared_preferences'), PackageRef('url_launcher'), PackageRef('sherpa_onnx'), PackageRef('archive'), PackageRef('dio'), PackageRef('fsrs'), PackageRef('idb_shim'), PackageRef('flutter_markdown_plus'), PackageRef('webdav_client'), PackageRef('logging'), PackageRef('flutter_local_notifications'), PackageRef('workmanager'), PackageRef('flutter_webrtc'), PackageRef('network_info_plus'), PackageRef('crypto'), PackageRef('qr_flutter'), PackageRef('mobile_scanner'), PackageRef('cupertino_icons'), PackageRef('bk_tree'), PackageRef('wakelock_plus')],
devDependencies: [PackageRef('flutter_test'), PackageRef('flutter_lints'), PackageRef('change_app_package_name'), PackageRef('dart_pubspec_licenses')],
license: '''GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class _SettingPage extends State<SettingPage> {
),
onPressed: () async {
context.read<Global>().uiLogger.info("选择手动导入单词");
FilePickerResult? result = await FilePicker.platform.pickFiles(
FilePickerResult? result = await FilePicker.pickFiles(
allowMultiple: false,
type: FileType.custom,
allowedExtensions: ['json'],
Expand Down
8 changes: 8 additions & 0 deletions lib/sub_pages_builder/learning_pages/fsrs_pages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,14 @@ class _FSRSLearningPageState extends State<FSRSLearningPage> {
super.initState();
}

@override
void dispose() {
controllerHor.dispose();
controllerLearning.dispose();
controllerQuestions.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
Expand Down
Loading
Loading