@@ -18,21 +18,18 @@ class ForeFSRSSettingPage extends StatelessWidget {
1818 @override
1919 Widget build (BuildContext context) {
2020 context.read <Global >().uiLogger.info ("构建 ForeFSRSSettingPage" );
21- MediaQueryData mediaQuery = MediaQuery .of (context);
2221 final FSRS fsrs = context.read <Global >().globalFSRS;
2322 if (fsrs.config.enabled && ! forceChoosing) {
2423 return MainFSRSPage (fsrs: fsrs);
2524 }
2625 return Scaffold (
2726 appBar: AppBar (
28- title: const Text ("FSRS-抗遗忘学习 预设置 " ),
27+ title: const Text ("单词规律复习设置 " ),
2928 ),
3029 body: StatefulBuilder (
3130 builder: (context, setState) {
3231 return ListView (
3332 children: [
34- TextContainer (text: "本软件通过FSRS(Forgetting Spaced Repetition System)遗忘曲线的间隔重复学习算法,帮助用户更有效地记忆单词。\n 你可以通过调整以下参数来个性化学习方案:" ),
35- SizedBox (height: mediaQuery.size.height * 0.02 ),
3633 TextContainer (text: "参数配置" , textAlign: TextAlign .center),
3734 Container (
3835 decoration: BoxDecoration (
@@ -168,6 +165,39 @@ class ForeFSRSSettingPage extends StatelessWidget {
168165 ],
169166 ),
170167 ),
168+ Container (
169+ decoration: BoxDecoration (
170+ borderRadius: StaticsVar .br,
171+ color: Theme .of (context).colorScheme.onSecondary
172+ ),
173+ margin: EdgeInsets .all (8.0 ),
174+ padding: EdgeInsets .all (8.0 ),
175+ child: Column (
176+ crossAxisAlignment: CrossAxisAlignment .start,
177+ children: [
178+ Row (
179+ children: [
180+ Expanded (child: Text ("每日单词推送" , style: Theme .of (context).textTheme.bodyLarge)),
181+ Slider (
182+ max: 20.0 ,
183+ min: 0.0 ,
184+ divisions: 20 ,
185+ value: fsrs.config.pushAmount.toDouble (),
186+ onChanged: (double value){
187+ setState (() {
188+ fsrs.config = fsrs.config.copyWith (pushAmount: value.round ());
189+ });
190+ },
191+ label: fsrs.config.pushAmount == 0 ? "禁用" : fsrs.config.pushAmount.toString (),
192+ )
193+ ],
194+ ),
195+ Text ("单词推送 开启后每天会推送新单词 但数量不一定是你所指定的(大概率会少几个) 你可以在学习页面入口进入推送单词学习" ),
196+ Text ("学习的推送单词会加入复习中" ),
197+ Text ("当天是否学习新单词对连胜计数没有影响 学不学可以看你心情" )
198+ ],
199+ ),
200+ ),
171201 if (! fsrs.config.selfEvaluate) Container (
172202 decoration: BoxDecoration (
173203 borderRadius: StaticsVar .br,
@@ -226,13 +256,9 @@ class MainFSRSPage extends StatelessWidget {
226256 @override
227257 Widget build (BuildContext context) {
228258 context.read <Global >().uiLogger.info ("构建 MainFSRSPage" );
229- bool isAnyDue = fsrs.getWillDueCount () != 0 ;
230259 MediaQueryData mediaQuery = MediaQuery .of (context);
231260 final PageController controller = PageController ();
232261 Random sharedRnd = Random ();
233- if (! isAnyDue) {
234- return FSRSOverViewPage (fsrs: fsrs);
235- }
236262 return Scaffold (
237263 appBar: AppBar (
238264 title: const Text ("规律学习" ),
@@ -325,11 +351,6 @@ class _FSRSReviewCardPage extends State<FSRSReviewCardPage> {
325351 allowAnitmation: ! widget.fsrs.config.selfEvaluate,
326352 allowMutipleSelect: false ,
327353 hint: "单词ID: ${widget .wordID }${choosed ? " 用时: ${end .difference (start ).inMilliseconds }毫秒" : "" }" ,
328- onDisAllowMutipleSelect: (value) {
329- ScaffoldMessenger .of (context).showSnackBar (
330- SnackBar (content: Text ("人要向前看 题要向下翻 :)" ), duration: Duration (seconds: 1 ),),
331- );
332- },
333354 onSelected: (value) {
334355 setState (() {
335356 choosed = true ;
@@ -395,69 +416,6 @@ class _FSRSReviewCardPage extends State<FSRSReviewCardPage> {
395416 }
396417}
397418
398- // 没有东西复习的时候
399- class FSRSOverViewPage extends StatefulWidget {
400- final FSRS fsrs;
401- const FSRSOverViewPage ({super .key, required this .fsrs});
402-
403- @override
404- State <FSRSOverViewPage > createState () => _FSRSOverViewPageState ();
405- }
406-
407- class _FSRSOverViewPageState extends State <FSRSOverViewPage > {
408- @override
409- Widget build (BuildContext context) {
410- MediaQueryData mediaQuery = MediaQuery .of (context);
411- return Scaffold (
412- appBar: AppBar (
413- title: const Text ("进度概览" ),
414- actions: [
415- IconButton (
416- icon: Icon (Icons .keyboard_option_key),
417- onPressed: () {
418- showModalBottomSheet (
419- context: context,
420- isScrollControlled: true ,
421- builder: (context) => ForeFSRSSettingPage (forceChoosing: true )
422- );
423- },
424- ),
425- ],
426- ),
427- body: ListView (
428- children: [
429- TextContainer (text: "目前没有需要复习的单词!" ),
430- SizedBox (height: mediaQuery.size.height * 0.01 ),
431- ElevatedButton .icon (
432- style: ElevatedButton .styleFrom (
433- fixedSize: Size .fromHeight (mediaQuery.size.height * 0.1 )
434- ),
435- icon: const Icon (Icons .label_important, size: 24.0 ),
436- label: const Text ("去学习新单词" ),
437- onPressed: () async {
438- late ClassSelection selectedClasses;
439- late List <WordItem > words;
440- selectedClasses = await popSelectClasses (context, withCache: false , withReviewChoose: false );
441- if (! context.mounted || selectedClasses.selectedClass.isEmpty) return ;
442- words = getSelectedWords (context, forceSelectClasses: selectedClasses.selectedClass, doShuffle: true , doDouble: false );
443- // 去除已经学习的项目
444- words.removeWhere ((WordItem item) => widget.fsrs.isContained (item.id));
445- context.read <Global >().uiLogger.info ("跳转: FSRSOverViewPage => FSRSLearningPage" );
446- Navigator .push (
447- context,
448- MaterialPageRoute (
449- builder: (context) => FSRSLearningPage (words: words, fsrs: widget.fsrs,),
450- )
451- );
452- },
453- ),
454- // TextContainer(text: "统计数据")
455- ],
456- )
457- );
458- }
459- }
460-
461419// 学习新东西的页面: 展示释义 -> 选择题
462420class FSRSLearningPage extends StatefulWidget {
463421 final List <WordItem > words;
@@ -491,7 +449,7 @@ class _FSRSLearningPageState extends State<FSRSLearningPage> {
491449 if (widget.words.isEmpty) {
492450 return Scaffold (
493451 appBar: AppBar (),
494- body: Center (child: TextContainer (text: "你选择的课程中所有的单词都已经学习过了 \n 等复习吧" )),
452+ body: Center (child: TextContainer (text: "你选择的所有的单词都已经学习过了 \n 等复习吧" )),
495453 );
496454 }
497455 return Scaffold (
0 commit comments