Skip to content

Commit 19f0aac

Browse files
Merge pull request #22 from OctagonalStar/dev
v0.1.10 release tag
2 parents 05823f7 + f0e8a75 commit 19f0aac

File tree

13 files changed

+684
-823
lines changed

13 files changed

+684
-823
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## DEVELOPING VERSION - ????-??-?? - (000110)
3+
## v0.1.10 - 2025-11-28 - (000110)
44

55
### Added
66

@@ -9,6 +9,8 @@
99
- 添加了题目配置
1010
- 添加了单词卡片题型
1111
- 添加了拼写题型
12+
- 添加了单词总览
13+
- 添加了WebDav数据备份/恢复功能
1214

1315
### Improvement
1416

@@ -17,13 +19,16 @@
1719
- 优化了软件打开逻辑
1820
- 去除了HTTP依赖项
1921
- 重构了InLearning加载
22+
- 优化了主页面UI
23+
- 优化了听写界面UI
2024

2125
### FIX
2226

2327
- 修复了FSRS页面中可能测试单词混乱的问题
2428
- 修复了连胜天数显示
2529
- 修复了激活彩蛋后更换主题时屏幕闪烁的问题
2630
- 修复了每日单词重构后出现的卡死问题
31+
- 修复了题目数量异常的问题
2732

2833
## v0.1.9 - 2025-11-9 - (000109)
2934

lib/funcs/fsrs_func.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FSRS {
1212

1313
// index != cardId; cardId = wordId = the index of word in global.wordData[words]
1414

15-
Future<void> init() async {
15+
Future<bool> init() async {
1616
prefs = await SharedPreferences.getInstance();
1717
if(!prefs.containsKey("fsrsData")) {
1818
settingData = {
@@ -23,7 +23,7 @@ class FSRS {
2323
'rater': {'scheme': 0},
2424
};
2525
prefs.setString("fsrsData", jsonEncode(settingData));
26-
return;
26+
return false;
2727
}
2828
settingData = jsonDecode(prefs.getString("fsrsData")!) as Map<String, dynamic>;
2929
if(isEnabled()){
@@ -33,7 +33,9 @@ class FSRS {
3333
reviewLogs.add(ReviewLog.fromMap(settingData['reviewLog'][i]));
3434
}
3535
rater = Rater(settingData['rater']['scheme']);
36+
return true;
3637
}
38+
return false;
3739
}
3840

3941
void save() async {

lib/main.dart

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:arabic_learning/vars/license_storage.dart';
55
import 'package:arabic_learning/vars/statics_var.dart';
66
import 'package:flutter/foundation.dart';
77
import 'package:flutter/material.dart';
8-
import 'package:convex_bottom_bar/convex_bottom_bar.dart';
98
import 'package:flutter/services.dart';
109
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
1110
import 'package:window_manager/window_manager.dart';
@@ -86,9 +85,9 @@ class MyHomePage extends StatefulWidget {
8685

8786
class _MyHomePageState extends State<MyHomePage> {
8887
late List<Widget> _pageList;
89-
int currentIndex = 0;
88+
int currentIndex = 1;
9089
bool onSlip = false;
91-
final PageController _pageController = PageController();
90+
final PageController _pageController = PageController(initialPage: 1);
9291
static const Duration _duration = Duration(milliseconds: 500);
9392
bool disPlayedFirst = false;
9493

@@ -110,26 +109,21 @@ class _MyHomePageState extends State<MyHomePage> {
110109
labelType: NavigationRailLabelType.selected,
111110
backgroundColor: Theme.of(context).colorScheme.onPrimary.withAlpha(150),
112111
destinations: const [
113-
NavigationRailDestination(
114-
icon: Icon(Icons.home_outlined),
115-
selectedIcon: Icon(Icons.home),
116-
label: Text('主页'),
117-
),
118112
NavigationRailDestination(
119113
icon: Icon(Icons.book_outlined),
120114
selectedIcon: Icon(Icons.book),
121115
label: Text('学习'),
122116
),
117+
NavigationRailDestination(
118+
icon: Icon(Icons.home_outlined),
119+
selectedIcon: Icon(Icons.home),
120+
label: Text('主页'),
121+
),
123122
NavigationRailDestination(
124123
icon: Icon(Icons.edit_outlined),
125124
selectedIcon: Icon(Icons.edit),
126125
label: Text('测试'),
127126
),
128-
NavigationRailDestination(
129-
icon: Icon(Icons.settings_outlined),
130-
selectedIcon: Icon(Icons.settings),
131-
label: Text('设置'),
132-
),
133127
],
134128
),
135129
// 垂直分隔线
@@ -172,20 +166,33 @@ class _MyHomePageState extends State<MyHomePage> {
172166
),
173167
),
174168
// 底部导航栏
175-
ConvexAppBar(
176-
key: ValueKey<int>(currentIndex),
177-
curve: StaticsVar.curve,
178-
style: TabStyle.flip,
179-
backgroundColor: Theme.of(context).colorScheme.primary.withAlpha(150),
180-
items: const [
181-
TabItem(icon: Icons.home_outlined, title: '主页', activeIcon: Icons.home_filled),
182-
TabItem(icon: Icons.book_outlined, title: '学习', activeIcon: Icons.book),
183-
TabItem(icon: Icons.edit_outlined, title: '测试', activeIcon: Icons.edit),
184-
TabItem(icon: Icons.settings_outlined, title: '设置', activeIcon: Icons.settings),
185-
],
186-
initialActiveIndex: currentIndex,
187-
onTap: _onNavigationTapped,
188-
),
169+
NavigationBar(
170+
selectedIndex: currentIndex,
171+
onDestinationSelected: (int index) {
172+
_onNavigationTapped(index);
173+
},
174+
height: MediaQuery.of(context).size.height * 0.1,
175+
animationDuration: Duration(milliseconds: 500),
176+
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
177+
backgroundColor: Theme.of(context).colorScheme.onPrimary.withAlpha(150),
178+
destinations: const [
179+
NavigationDestination(
180+
icon: Icon(Icons.book_outlined),
181+
selectedIcon: Icon(Icons.book),
182+
label: '学习',
183+
),
184+
NavigationDestination(
185+
icon: Icon(Icons.home_outlined),
186+
selectedIcon: Icon(Icons.home),
187+
label: '主页',
188+
),
189+
NavigationDestination(
190+
icon: Icon(Icons.edit_outlined),
191+
selectedIcon: Icon(Icons.edit),
192+
label: '测试',
193+
),
194+
]
195+
)
189196
],
190197
);
191198
}
@@ -213,7 +220,6 @@ class _MyHomePageState extends State<MyHomePage> {
213220
if(gob.firstStart) {
214221
return Scaffold(
215222
body: PopScope(
216-
canPop: false,
217223
child: Column(
218224
children: [
219225
Expanded(
@@ -278,35 +284,31 @@ class _MyHomePageState extends State<MyHomePage> {
278284
);
279285
}
280286
_pageList = [
281-
HomePage(toPage: (index) {
282-
_pageController.animateToPage(
283-
index,
284-
duration: _duration,
285-
curve: StaticsVar.curve,
286-
);
287-
setState(() {
288-
currentIndex = index;
289-
});
290-
}),
291287
LearningPage(),
292-
TestPage(),
293-
SettingPage(),
288+
HomePage(),
289+
TestPage()
294290
];
295291
return Scaffold(
296292
backgroundColor: context.read<Global>().settingData["eggs"]["stella"] ? Colors.transparent : null,
297293
appBar: AppBar(
298294
centerTitle: true,
299295
backgroundColor: Theme.of(context).colorScheme.inversePrimary.withAlpha(150),
300296
title: Text(widget.title),
301-
actions: kIsWeb && !gob.settingData['regular']['hideAppDownloadButton'] ? [
302-
ElevatedButton.icon(
297+
actions: [
298+
if(kIsWeb && !gob.settingData['regular']['hideAppDownloadButton']) ElevatedButton.icon(
303299
icon: Icon(Icons.add_to_home_screen),
304300
label: Text('下载APP版本'),
305301
onPressed: () {
306302
launchUrl(Uri.parse("https://github.com/OctagonalStar/arabic_learning/releases/latest"));
307303
}
304+
),
305+
IconButton(
306+
onPressed: () {
307+
Navigator.of(context).push(MaterialPageRoute(builder: (context) => SettingPage()));
308+
},
309+
icon: Icon(Icons.settings)
308310
)
309-
] : [],
311+
],
310312
),
311313
body: LayoutBuilder(
312314
builder: (context, constraints) {

0 commit comments

Comments
 (0)