diff --git a/.gitignore b/.gitignore index 5b1f2a1..6956094 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ lib/common/job/common/base_page_data_report.g.dart /.fvm/flutter_sdk .fvm/fvm_config.json pubspec.lock +pubspec.lock diff --git a/assets/images/1.png b/assets/images/1.png new file mode 100644 index 0000000..7c3d1ff Binary files /dev/null and b/assets/images/1.png differ diff --git a/assets/images/2.0x/2 (2).png b/assets/images/2.0x/2 (2).png new file mode 100644 index 0000000..2881c42 Binary files /dev/null and b/assets/images/2.0x/2 (2).png differ diff --git a/assets/images/2.0x/abnormal_img.png b/assets/images/2.0x/abnormal_img.png new file mode 100644 index 0000000..b79c142 Binary files /dev/null and b/assets/images/2.0x/abnormal_img.png differ diff --git a/assets/images/2.0x/default_user_dead.png b/assets/images/2.0x/default_user_dead.png new file mode 100644 index 0000000..06d463c Binary files /dev/null and b/assets/images/2.0x/default_user_dead.png differ diff --git a/assets/images/2.0x/detailed_report_entry_bgm.png b/assets/images/2.0x/detailed_report_entry_bgm.png new file mode 100644 index 0000000..8df8cf7 Binary files /dev/null and b/assets/images/2.0x/detailed_report_entry_bgm.png differ diff --git a/assets/images/2.0x/do_exit_marking.png b/assets/images/2.0x/do_exit_marking.png new file mode 100644 index 0000000..d8787ee Binary files /dev/null and b/assets/images/2.0x/do_exit_marking.png differ diff --git a/assets/images/2.0x/do_marking_answer.png b/assets/images/2.0x/do_marking_answer.png new file mode 100644 index 0000000..1a8797d Binary files /dev/null and b/assets/images/2.0x/do_marking_answer.png differ diff --git a/assets/images/2.0x/do_marking_test_paper.png b/assets/images/2.0x/do_marking_test_paper.png new file mode 100644 index 0000000..7d2898a Binary files /dev/null and b/assets/images/2.0x/do_marking_test_paper.png differ diff --git a/assets/images/2.0x/equal.png b/assets/images/2.0x/equal.png new file mode 100644 index 0000000..ab3517e Binary files /dev/null and b/assets/images/2.0x/equal.png differ diff --git a/assets/images/2.0x/exam_selection.png b/assets/images/2.0x/exam_selection.png new file mode 100644 index 0000000..c53a0fa Binary files /dev/null and b/assets/images/2.0x/exam_selection.png differ diff --git a/assets/images/2.0x/fall.png b/assets/images/2.0x/fall.png new file mode 100644 index 0000000..5039cda Binary files /dev/null and b/assets/images/2.0x/fall.png differ diff --git a/assets/images/2.0x/guide_page_gesture.png b/assets/images/2.0x/guide_page_gesture.png new file mode 100644 index 0000000..2c36734 Binary files /dev/null and b/assets/images/2.0x/guide_page_gesture.png differ diff --git a/assets/images/2.0x/hide_question_id.png b/assets/images/2.0x/hide_question_id.png new file mode 100644 index 0000000..95efc3b Binary files /dev/null and b/assets/images/2.0x/hide_question_id.png differ diff --git a/assets/images/2.0x/home_image.png b/assets/images/2.0x/home_image.png new file mode 100644 index 0000000..abc67d1 Binary files /dev/null and b/assets/images/2.0x/home_image.png differ diff --git a/assets/images/2.0x/ic_home_normal.png b/assets/images/2.0x/ic_home_normal.png new file mode 100644 index 0000000..64354dc Binary files /dev/null and b/assets/images/2.0x/ic_home_normal.png differ diff --git a/assets/images/2.0x/ic_home_press.png b/assets/images/2.0x/ic_home_press.png new file mode 100644 index 0000000..4d1cefb Binary files /dev/null and b/assets/images/2.0x/ic_home_press.png differ diff --git a/assets/images/2.0x/ic_marking_normal.png b/assets/images/2.0x/ic_marking_normal.png new file mode 100644 index 0000000..b9c0e6a Binary files /dev/null and b/assets/images/2.0x/ic_marking_normal.png differ diff --git a/assets/images/2.0x/ic_marking_press.png b/assets/images/2.0x/ic_marking_press.png new file mode 100644 index 0000000..d289d31 Binary files /dev/null and b/assets/images/2.0x/ic_marking_press.png differ diff --git a/assets/images/2.0x/ic_mine_normal.png b/assets/images/2.0x/ic_mine_normal.png new file mode 100644 index 0000000..719e115 Binary files /dev/null and b/assets/images/2.0x/ic_mine_normal.png differ diff --git a/assets/images/2.0x/ic_mine_press.png b/assets/images/2.0x/ic_mine_press.png new file mode 100644 index 0000000..5ada58e Binary files /dev/null and b/assets/images/2.0x/ic_mine_press.png differ diff --git a/assets/images/2.0x/ic_report_normal.png b/assets/images/2.0x/ic_report_normal.png new file mode 100644 index 0000000..2bbb924 Binary files /dev/null and b/assets/images/2.0x/ic_report_normal.png differ diff --git a/assets/images/2.0x/ic_report_press.png b/assets/images/2.0x/ic_report_press.png new file mode 100644 index 0000000..9bce2db Binary files /dev/null and b/assets/images/2.0x/ic_report_press.png differ diff --git a/assets/images/2.0x/ic_work_normal.png b/assets/images/2.0x/ic_work_normal.png new file mode 100644 index 0000000..cd54b72 Binary files /dev/null and b/assets/images/2.0x/ic_work_normal.png differ diff --git a/assets/images/2.0x/ic_work_press.png b/assets/images/2.0x/ic_work_press.png new file mode 100644 index 0000000..23d22f2 Binary files /dev/null and b/assets/images/2.0x/ic_work_press.png differ diff --git a/assets/images/2.0x/job_report_scale.png b/assets/images/2.0x/job_report_scale.png new file mode 100644 index 0000000..189f292 Binary files /dev/null and b/assets/images/2.0x/job_report_scale.png differ diff --git a/assets/images/2.0x/login_bgi.png b/assets/images/2.0x/login_bgi.png new file mode 100644 index 0000000..87f7580 Binary files /dev/null and b/assets/images/2.0x/login_bgi.png differ diff --git a/assets/images/2.0x/logo.png b/assets/images/2.0x/logo.png new file mode 100644 index 0000000..ad38e5a Binary files /dev/null and b/assets/images/2.0x/logo.png differ diff --git a/assets/images/2.0x/marking_settings.png b/assets/images/2.0x/marking_settings.png new file mode 100644 index 0000000..0150b30 Binary files /dev/null and b/assets/images/2.0x/marking_settings.png differ diff --git a/assets/images/2.0x/not_data_bgm.png b/assets/images/2.0x/not_data_bgm.png new file mode 100644 index 0000000..9e12212 Binary files /dev/null and b/assets/images/2.0x/not_data_bgm.png differ diff --git a/assets/images/2.0x/personal_bgi.png b/assets/images/2.0x/personal_bgi.png new file mode 100644 index 0000000..f633bd6 Binary files /dev/null and b/assets/images/2.0x/personal_bgi.png differ diff --git a/assets/images/2.0x/report_home_icon_burst.png b/assets/images/2.0x/report_home_icon_burst.png new file mode 100644 index 0000000..613e82c Binary files /dev/null and b/assets/images/2.0x/report_home_icon_burst.png differ diff --git a/assets/images/2.0x/report_home_icon_subject.png b/assets/images/2.0x/report_home_icon_subject.png new file mode 100644 index 0000000..19f142a Binary files /dev/null and b/assets/images/2.0x/report_home_icon_subject.png differ diff --git a/assets/images/2.0x/report_home_top_img.png b/assets/images/2.0x/report_home_top_img.png new file mode 100644 index 0000000..10ec946 Binary files /dev/null and b/assets/images/2.0x/report_home_top_img.png differ diff --git a/assets/images/2.0x/report_level_bgm.png b/assets/images/2.0x/report_level_bgm.png new file mode 100644 index 0000000..3a1caf6 Binary files /dev/null and b/assets/images/2.0x/report_level_bgm.png differ diff --git a/assets/images/2.0x/review_error.png b/assets/images/2.0x/review_error.png new file mode 100644 index 0000000..34f1c12 Binary files /dev/null and b/assets/images/2.0x/review_error.png differ diff --git a/assets/images/2.0x/review_loding.png b/assets/images/2.0x/review_loding.png new file mode 100644 index 0000000..2e5cd4e Binary files /dev/null and b/assets/images/2.0x/review_loding.png differ diff --git a/assets/images/2.0x/rise.png b/assets/images/2.0x/rise.png new file mode 100644 index 0000000..65e2696 Binary files /dev/null and b/assets/images/2.0x/rise.png differ diff --git a/assets/images/2.0x/role_selection.png b/assets/images/2.0x/role_selection.png new file mode 100644 index 0000000..806c04a Binary files /dev/null and b/assets/images/2.0x/role_selection.png differ diff --git a/assets/images/2.0x/test_paper_loading_failed.png b/assets/images/2.0x/test_paper_loading_failed.png new file mode 100644 index 0000000..d86cfb1 Binary files /dev/null and b/assets/images/2.0x/test_paper_loading_failed.png differ diff --git a/assets/images/2.0x/upgrade_dialog_bgc.png b/assets/images/2.0x/upgrade_dialog_bgc.png new file mode 100644 index 0000000..96ff3dd Binary files /dev/null and b/assets/images/2.0x/upgrade_dialog_bgc.png differ diff --git a/assets/images/2.0x/vertical_screen_btn.png b/assets/images/2.0x/vertical_screen_btn.png new file mode 100644 index 0000000..f4cc7e9 Binary files /dev/null and b/assets/images/2.0x/vertical_screen_btn.png differ diff --git a/assets/images/3.0x/30 (1).png b/assets/images/3.0x/30 (1).png new file mode 100644 index 0000000..df1fa35 Binary files /dev/null and b/assets/images/3.0x/30 (1).png differ diff --git a/assets/images/3.0x/abnormal_img.png b/assets/images/3.0x/abnormal_img.png new file mode 100644 index 0000000..2c599b5 Binary files /dev/null and b/assets/images/3.0x/abnormal_img.png differ diff --git a/assets/images/3.0x/default_user_dead.png b/assets/images/3.0x/default_user_dead.png new file mode 100644 index 0000000..92578fc Binary files /dev/null and b/assets/images/3.0x/default_user_dead.png differ diff --git a/assets/images/3.0x/detailed_report_entry_bgm.png b/assets/images/3.0x/detailed_report_entry_bgm.png new file mode 100644 index 0000000..a2293be Binary files /dev/null and b/assets/images/3.0x/detailed_report_entry_bgm.png differ diff --git a/assets/images/3.0x/do_exit_marking.png b/assets/images/3.0x/do_exit_marking.png new file mode 100644 index 0000000..02dd2ad Binary files /dev/null and b/assets/images/3.0x/do_exit_marking.png differ diff --git a/assets/images/3.0x/do_marking_answer.png b/assets/images/3.0x/do_marking_answer.png new file mode 100644 index 0000000..6bea8f8 Binary files /dev/null and b/assets/images/3.0x/do_marking_answer.png differ diff --git a/assets/images/3.0x/do_marking_test_paper.png b/assets/images/3.0x/do_marking_test_paper.png new file mode 100644 index 0000000..f5da23c Binary files /dev/null and b/assets/images/3.0x/do_marking_test_paper.png differ diff --git a/assets/images/3.0x/equal.png b/assets/images/3.0x/equal.png new file mode 100644 index 0000000..84f147b Binary files /dev/null and b/assets/images/3.0x/equal.png differ diff --git a/assets/images/3.0x/exam_selection.png b/assets/images/3.0x/exam_selection.png new file mode 100644 index 0000000..3dbcb28 Binary files /dev/null and b/assets/images/3.0x/exam_selection.png differ diff --git a/assets/images/3.0x/fall.png b/assets/images/3.0x/fall.png new file mode 100644 index 0000000..539bef5 Binary files /dev/null and b/assets/images/3.0x/fall.png differ diff --git a/assets/images/3.0x/guide_page_gesture.png b/assets/images/3.0x/guide_page_gesture.png new file mode 100644 index 0000000..01f2ad2 Binary files /dev/null and b/assets/images/3.0x/guide_page_gesture.png differ diff --git a/assets/images/3.0x/hide_question_id.png b/assets/images/3.0x/hide_question_id.png new file mode 100644 index 0000000..1c56b4d Binary files /dev/null and b/assets/images/3.0x/hide_question_id.png differ diff --git a/assets/images/3.0x/home_image.png b/assets/images/3.0x/home_image.png new file mode 100644 index 0000000..46b8647 Binary files /dev/null and b/assets/images/3.0x/home_image.png differ diff --git a/assets/images/3.0x/ic_home_normal.png b/assets/images/3.0x/ic_home_normal.png new file mode 100644 index 0000000..44b7e1c Binary files /dev/null and b/assets/images/3.0x/ic_home_normal.png differ diff --git a/assets/images/3.0x/ic_home_press.png b/assets/images/3.0x/ic_home_press.png new file mode 100644 index 0000000..19ab970 Binary files /dev/null and b/assets/images/3.0x/ic_home_press.png differ diff --git a/assets/images/3.0x/ic_marking_normal.png b/assets/images/3.0x/ic_marking_normal.png new file mode 100644 index 0000000..e5534c1 Binary files /dev/null and b/assets/images/3.0x/ic_marking_normal.png differ diff --git a/assets/images/3.0x/ic_marking_press.png b/assets/images/3.0x/ic_marking_press.png new file mode 100644 index 0000000..6bbc332 Binary files /dev/null and b/assets/images/3.0x/ic_marking_press.png differ diff --git a/assets/images/3.0x/ic_mine_normal.png b/assets/images/3.0x/ic_mine_normal.png new file mode 100644 index 0000000..e410817 Binary files /dev/null and b/assets/images/3.0x/ic_mine_normal.png differ diff --git a/assets/images/3.0x/ic_mine_press.png b/assets/images/3.0x/ic_mine_press.png new file mode 100644 index 0000000..512e001 Binary files /dev/null and b/assets/images/3.0x/ic_mine_press.png differ diff --git a/assets/images/3.0x/ic_report_normal.png b/assets/images/3.0x/ic_report_normal.png new file mode 100644 index 0000000..99ea9a7 Binary files /dev/null and b/assets/images/3.0x/ic_report_normal.png differ diff --git a/assets/images/3.0x/ic_report_press.png b/assets/images/3.0x/ic_report_press.png new file mode 100644 index 0000000..36d1056 Binary files /dev/null and b/assets/images/3.0x/ic_report_press.png differ diff --git a/assets/images/3.0x/ic_work_normal.png b/assets/images/3.0x/ic_work_normal.png new file mode 100644 index 0000000..deb6e0d Binary files /dev/null and b/assets/images/3.0x/ic_work_normal.png differ diff --git a/assets/images/3.0x/ic_work_press.png b/assets/images/3.0x/ic_work_press.png new file mode 100644 index 0000000..ca13777 Binary files /dev/null and b/assets/images/3.0x/ic_work_press.png differ diff --git a/assets/images/3.0x/job_report_scale.png b/assets/images/3.0x/job_report_scale.png new file mode 100644 index 0000000..74d4d1e Binary files /dev/null and b/assets/images/3.0x/job_report_scale.png differ diff --git a/assets/images/3.0x/login_bgi.png b/assets/images/3.0x/login_bgi.png new file mode 100644 index 0000000..d91ff82 Binary files /dev/null and b/assets/images/3.0x/login_bgi.png differ diff --git a/assets/images/3.0x/logo.png b/assets/images/3.0x/logo.png new file mode 100644 index 0000000..620ccc7 Binary files /dev/null and b/assets/images/3.0x/logo.png differ diff --git a/assets/images/3.0x/marking_settings.png b/assets/images/3.0x/marking_settings.png new file mode 100644 index 0000000..296e601 Binary files /dev/null and b/assets/images/3.0x/marking_settings.png differ diff --git a/assets/images/3.0x/not_data_bgm.png b/assets/images/3.0x/not_data_bgm.png new file mode 100644 index 0000000..4f5bd3e Binary files /dev/null and b/assets/images/3.0x/not_data_bgm.png differ diff --git a/assets/images/3.0x/personal_bgi.png b/assets/images/3.0x/personal_bgi.png new file mode 100644 index 0000000..83e7ee9 Binary files /dev/null and b/assets/images/3.0x/personal_bgi.png differ diff --git a/assets/images/3.0x/report_home_icon_burst.png b/assets/images/3.0x/report_home_icon_burst.png new file mode 100644 index 0000000..d3bb3fa Binary files /dev/null and b/assets/images/3.0x/report_home_icon_burst.png differ diff --git a/assets/images/3.0x/report_home_icon_subject.png b/assets/images/3.0x/report_home_icon_subject.png new file mode 100644 index 0000000..91337c3 Binary files /dev/null and b/assets/images/3.0x/report_home_icon_subject.png differ diff --git a/assets/images/3.0x/report_home_top_img.png b/assets/images/3.0x/report_home_top_img.png new file mode 100644 index 0000000..0034a35 Binary files /dev/null and b/assets/images/3.0x/report_home_top_img.png differ diff --git a/assets/images/3.0x/report_level_bgm.png b/assets/images/3.0x/report_level_bgm.png new file mode 100644 index 0000000..d588eec Binary files /dev/null and b/assets/images/3.0x/report_level_bgm.png differ diff --git a/assets/images/3.0x/review_error.png b/assets/images/3.0x/review_error.png new file mode 100644 index 0000000..c89ba12 Binary files /dev/null and b/assets/images/3.0x/review_error.png differ diff --git a/assets/images/3.0x/review_loding.png b/assets/images/3.0x/review_loding.png new file mode 100644 index 0000000..5c5232a Binary files /dev/null and b/assets/images/3.0x/review_loding.png differ diff --git a/assets/images/3.0x/rise.png b/assets/images/3.0x/rise.png new file mode 100644 index 0000000..6cb2839 Binary files /dev/null and b/assets/images/3.0x/rise.png differ diff --git a/assets/images/3.0x/role_selection.png b/assets/images/3.0x/role_selection.png new file mode 100644 index 0000000..0b885b3 Binary files /dev/null and b/assets/images/3.0x/role_selection.png differ diff --git a/assets/images/3.0x/test_paper_loading_failed.png b/assets/images/3.0x/test_paper_loading_failed.png new file mode 100644 index 0000000..7b15c69 Binary files /dev/null and b/assets/images/3.0x/test_paper_loading_failed.png differ diff --git a/assets/images/3.0x/upgrade_dialog_bgc.png b/assets/images/3.0x/upgrade_dialog_bgc.png new file mode 100644 index 0000000..832f72b Binary files /dev/null and b/assets/images/3.0x/upgrade_dialog_bgc.png differ diff --git a/assets/images/3.0x/vertical_screen_btn.png b/assets/images/3.0x/vertical_screen_btn.png new file mode 100644 index 0000000..ca4f1f9 Binary files /dev/null and b/assets/images/3.0x/vertical_screen_btn.png differ diff --git a/assets/images/4.0x/4 (2).png b/assets/images/4.0x/4 (2).png new file mode 100644 index 0000000..9af04b7 Binary files /dev/null and b/assets/images/4.0x/4 (2).png differ diff --git a/assets/images/4.0x/abnormal_img.png b/assets/images/4.0x/abnormal_img.png new file mode 100644 index 0000000..6c92c79 Binary files /dev/null and b/assets/images/4.0x/abnormal_img.png differ diff --git a/assets/images/4.0x/default_user_dead.png b/assets/images/4.0x/default_user_dead.png new file mode 100644 index 0000000..1f98182 Binary files /dev/null and b/assets/images/4.0x/default_user_dead.png differ diff --git a/assets/images/4.0x/detailed_report_entry_bgm.png b/assets/images/4.0x/detailed_report_entry_bgm.png new file mode 100644 index 0000000..5672008 Binary files /dev/null and b/assets/images/4.0x/detailed_report_entry_bgm.png differ diff --git a/assets/images/4.0x/do_exit_marking.png b/assets/images/4.0x/do_exit_marking.png new file mode 100644 index 0000000..0efe020 Binary files /dev/null and b/assets/images/4.0x/do_exit_marking.png differ diff --git a/assets/images/4.0x/do_marking_answer.png b/assets/images/4.0x/do_marking_answer.png new file mode 100644 index 0000000..08277cc Binary files /dev/null and b/assets/images/4.0x/do_marking_answer.png differ diff --git a/assets/images/4.0x/do_marking_test_paper.png b/assets/images/4.0x/do_marking_test_paper.png new file mode 100644 index 0000000..59d326b Binary files /dev/null and b/assets/images/4.0x/do_marking_test_paper.png differ diff --git a/assets/images/4.0x/equal.png b/assets/images/4.0x/equal.png new file mode 100644 index 0000000..157b9e1 Binary files /dev/null and b/assets/images/4.0x/equal.png differ diff --git a/assets/images/4.0x/exam_selection.png b/assets/images/4.0x/exam_selection.png new file mode 100644 index 0000000..e7706c8 Binary files /dev/null and b/assets/images/4.0x/exam_selection.png differ diff --git a/assets/images/4.0x/fall.png b/assets/images/4.0x/fall.png new file mode 100644 index 0000000..333372a Binary files /dev/null and b/assets/images/4.0x/fall.png differ diff --git a/assets/images/4.0x/guide_page_gesture.png b/assets/images/4.0x/guide_page_gesture.png new file mode 100644 index 0000000..7a2a2f7 Binary files /dev/null and b/assets/images/4.0x/guide_page_gesture.png differ diff --git a/assets/images/4.0x/hide_question_id.png b/assets/images/4.0x/hide_question_id.png new file mode 100644 index 0000000..d768eda Binary files /dev/null and b/assets/images/4.0x/hide_question_id.png differ diff --git a/assets/images/4.0x/home_image.png b/assets/images/4.0x/home_image.png new file mode 100644 index 0000000..f5bfd22 Binary files /dev/null and b/assets/images/4.0x/home_image.png differ diff --git a/assets/images/4.0x/ic_home_normal.png b/assets/images/4.0x/ic_home_normal.png new file mode 100644 index 0000000..d12ff70 Binary files /dev/null and b/assets/images/4.0x/ic_home_normal.png differ diff --git a/assets/images/4.0x/ic_home_press.png b/assets/images/4.0x/ic_home_press.png new file mode 100644 index 0000000..fd6267a Binary files /dev/null and b/assets/images/4.0x/ic_home_press.png differ diff --git a/assets/images/4.0x/ic_marking_normal.png b/assets/images/4.0x/ic_marking_normal.png new file mode 100644 index 0000000..92eed63 Binary files /dev/null and b/assets/images/4.0x/ic_marking_normal.png differ diff --git a/assets/images/4.0x/ic_marking_press.png b/assets/images/4.0x/ic_marking_press.png new file mode 100644 index 0000000..cc7b8e3 Binary files /dev/null and b/assets/images/4.0x/ic_marking_press.png differ diff --git a/assets/images/4.0x/ic_mine_normal.png b/assets/images/4.0x/ic_mine_normal.png new file mode 100644 index 0000000..eeed1a9 Binary files /dev/null and b/assets/images/4.0x/ic_mine_normal.png differ diff --git a/assets/images/4.0x/ic_mine_press.png b/assets/images/4.0x/ic_mine_press.png new file mode 100644 index 0000000..b994e8e Binary files /dev/null and b/assets/images/4.0x/ic_mine_press.png differ diff --git a/assets/images/4.0x/ic_report_normal.png b/assets/images/4.0x/ic_report_normal.png new file mode 100644 index 0000000..fad62fe Binary files /dev/null and b/assets/images/4.0x/ic_report_normal.png differ diff --git a/assets/images/4.0x/ic_report_press.png b/assets/images/4.0x/ic_report_press.png new file mode 100644 index 0000000..7ea1e8d Binary files /dev/null and b/assets/images/4.0x/ic_report_press.png differ diff --git a/assets/images/4.0x/ic_work_normal.png b/assets/images/4.0x/ic_work_normal.png new file mode 100644 index 0000000..29bd81d Binary files /dev/null and b/assets/images/4.0x/ic_work_normal.png differ diff --git a/assets/images/4.0x/ic_work_press.png b/assets/images/4.0x/ic_work_press.png new file mode 100644 index 0000000..431435f Binary files /dev/null and b/assets/images/4.0x/ic_work_press.png differ diff --git a/assets/images/4.0x/job_report_scale.png b/assets/images/4.0x/job_report_scale.png new file mode 100644 index 0000000..45ac3c9 Binary files /dev/null and b/assets/images/4.0x/job_report_scale.png differ diff --git a/assets/images/4.0x/login_bgi.png b/assets/images/4.0x/login_bgi.png new file mode 100644 index 0000000..64bf904 Binary files /dev/null and b/assets/images/4.0x/login_bgi.png differ diff --git a/assets/images/4.0x/logo.png b/assets/images/4.0x/logo.png new file mode 100644 index 0000000..a1a62e0 Binary files /dev/null and b/assets/images/4.0x/logo.png differ diff --git a/assets/images/4.0x/marking_settings.png b/assets/images/4.0x/marking_settings.png new file mode 100644 index 0000000..dfb9409 Binary files /dev/null and b/assets/images/4.0x/marking_settings.png differ diff --git a/assets/images/4.0x/not_data_bgm.png b/assets/images/4.0x/not_data_bgm.png new file mode 100644 index 0000000..400c065 Binary files /dev/null and b/assets/images/4.0x/not_data_bgm.png differ diff --git a/assets/images/4.0x/personal_bgi.png b/assets/images/4.0x/personal_bgi.png new file mode 100644 index 0000000..a15351f Binary files /dev/null and b/assets/images/4.0x/personal_bgi.png differ diff --git a/assets/images/4.0x/report_home_icon_burst.png b/assets/images/4.0x/report_home_icon_burst.png new file mode 100644 index 0000000..f1b8009 Binary files /dev/null and b/assets/images/4.0x/report_home_icon_burst.png differ diff --git a/assets/images/4.0x/report_home_icon_subject.png b/assets/images/4.0x/report_home_icon_subject.png new file mode 100644 index 0000000..f4c941a Binary files /dev/null and b/assets/images/4.0x/report_home_icon_subject.png differ diff --git a/assets/images/4.0x/report_home_top_img.png b/assets/images/4.0x/report_home_top_img.png new file mode 100644 index 0000000..786fa3d Binary files /dev/null and b/assets/images/4.0x/report_home_top_img.png differ diff --git a/assets/images/4.0x/report_level_bgm.png b/assets/images/4.0x/report_level_bgm.png new file mode 100644 index 0000000..e337828 Binary files /dev/null and b/assets/images/4.0x/report_level_bgm.png differ diff --git a/assets/images/4.0x/review_error.png b/assets/images/4.0x/review_error.png new file mode 100644 index 0000000..6fdaf54 Binary files /dev/null and b/assets/images/4.0x/review_error.png differ diff --git a/assets/images/4.0x/review_loding.png b/assets/images/4.0x/review_loding.png new file mode 100644 index 0000000..bb339fb Binary files /dev/null and b/assets/images/4.0x/review_loding.png differ diff --git a/assets/images/4.0x/rise.png b/assets/images/4.0x/rise.png new file mode 100644 index 0000000..afda948 Binary files /dev/null and b/assets/images/4.0x/rise.png differ diff --git a/assets/images/4.0x/role_selection.png b/assets/images/4.0x/role_selection.png new file mode 100644 index 0000000..d456fce Binary files /dev/null and b/assets/images/4.0x/role_selection.png differ diff --git a/assets/images/4.0x/test_paper_loading_failed.png b/assets/images/4.0x/test_paper_loading_failed.png new file mode 100644 index 0000000..02adf68 Binary files /dev/null and b/assets/images/4.0x/test_paper_loading_failed.png differ diff --git a/assets/images/4.0x/upgrade_dialog_bgc.png b/assets/images/4.0x/upgrade_dialog_bgc.png new file mode 100644 index 0000000..442b964 Binary files /dev/null and b/assets/images/4.0x/upgrade_dialog_bgc.png differ diff --git a/assets/images/4.0x/vertical_screen_btn.png b/assets/images/4.0x/vertical_screen_btn.png new file mode 100644 index 0000000..43b456f Binary files /dev/null and b/assets/images/4.0x/vertical_screen_btn.png differ diff --git a/assets/images/abnormal_img.png b/assets/images/abnormal_img.png new file mode 100644 index 0000000..f3b3f74 Binary files /dev/null and b/assets/images/abnormal_img.png differ diff --git a/assets/images/basic_info.png b/assets/images/basic_info.png new file mode 100644 index 0000000..f7fbc7a Binary files /dev/null and b/assets/images/basic_info.png differ diff --git a/assets/images/check_icon.png b/assets/images/check_icon.png new file mode 100644 index 0000000..6737f02 Binary files /dev/null and b/assets/images/check_icon.png differ diff --git a/assets/images/detailed_report_entry_bgm.png b/assets/images/detailed_report_entry_bgm.png new file mode 100644 index 0000000..05b372d Binary files /dev/null and b/assets/images/detailed_report_entry_bgm.png differ diff --git a/assets/images/do_exit_marking.png b/assets/images/do_exit_marking.png new file mode 100644 index 0000000..448102e Binary files /dev/null and b/assets/images/do_exit_marking.png differ diff --git a/assets/images/do_marking_answer.png b/assets/images/do_marking_answer.png new file mode 100644 index 0000000..1a219de Binary files /dev/null and b/assets/images/do_marking_answer.png differ diff --git a/assets/images/do_marking_test_paper.png b/assets/images/do_marking_test_paper.png new file mode 100644 index 0000000..4f7fdc3 Binary files /dev/null and b/assets/images/do_marking_test_paper.png differ diff --git a/assets/images/equal.png b/assets/images/equal.png new file mode 100644 index 0000000..3043017 Binary files /dev/null and b/assets/images/equal.png differ diff --git a/assets/images/exam_selection.png b/assets/images/exam_selection.png new file mode 100644 index 0000000..703ed52 Binary files /dev/null and b/assets/images/exam_selection.png differ diff --git a/assets/images/fall.png b/assets/images/fall.png new file mode 100644 index 0000000..06ee370 Binary files /dev/null and b/assets/images/fall.png differ diff --git a/assets/images/favorite_delete_icon.png b/assets/images/favorite_delete_icon.png new file mode 100644 index 0000000..5704f91 Binary files /dev/null and b/assets/images/favorite_delete_icon.png differ diff --git a/assets/images/favorite_dialog_close.png b/assets/images/favorite_dialog_close.png new file mode 100644 index 0000000..c25cd26 Binary files /dev/null and b/assets/images/favorite_dialog_close.png differ diff --git a/assets/images/green_right_icon.png b/assets/images/green_right_icon.png new file mode 100644 index 0000000..7edf2f8 Binary files /dev/null and b/assets/images/green_right_icon.png differ diff --git a/assets/images/guide_page_gesture.png b/assets/images/guide_page_gesture.png new file mode 100644 index 0000000..11ff5db Binary files /dev/null and b/assets/images/guide_page_gesture.png differ diff --git a/assets/images/hide_question_id.png b/assets/images/hide_question_id.png new file mode 100644 index 0000000..77d72e0 Binary files /dev/null and b/assets/images/hide_question_id.png differ diff --git a/assets/images/home_image.png b/assets/images/home_image.png new file mode 100644 index 0000000..a741eb7 Binary files /dev/null and b/assets/images/home_image.png differ diff --git a/assets/images/ic_marking_normal.png b/assets/images/ic_marking_normal.png new file mode 100644 index 0000000..19d22ca Binary files /dev/null and b/assets/images/ic_marking_normal.png differ diff --git a/assets/images/ic_marking_press.png b/assets/images/ic_marking_press.png new file mode 100644 index 0000000..383778c Binary files /dev/null and b/assets/images/ic_marking_press.png differ diff --git a/assets/images/ic_mine_normal.png b/assets/images/ic_mine_normal.png new file mode 100644 index 0000000..607d01d Binary files /dev/null and b/assets/images/ic_mine_normal.png differ diff --git a/assets/images/ic_mine_press.png b/assets/images/ic_mine_press.png new file mode 100644 index 0000000..9ffeb2d Binary files /dev/null and b/assets/images/ic_mine_press.png differ diff --git a/assets/images/ic_report_normal.png b/assets/images/ic_report_normal.png new file mode 100644 index 0000000..3e784da Binary files /dev/null and b/assets/images/ic_report_normal.png differ diff --git a/assets/images/ic_report_press.png b/assets/images/ic_report_press.png new file mode 100644 index 0000000..d00dd6f Binary files /dev/null and b/assets/images/ic_report_press.png differ diff --git a/assets/images/job_data_right_icon.png b/assets/images/job_data_right_icon.png new file mode 100644 index 0000000..7c7edf4 Binary files /dev/null and b/assets/images/job_data_right_icon.png differ diff --git a/assets/images/job_personal_correct_icon.png b/assets/images/job_personal_correct_icon.png new file mode 100644 index 0000000..8194c17 Binary files /dev/null and b/assets/images/job_personal_correct_icon.png differ diff --git a/assets/images/job_personal_error_icon.png b/assets/images/job_personal_error_icon.png new file mode 100644 index 0000000..8c82f97 Binary files /dev/null and b/assets/images/job_personal_error_icon.png differ diff --git a/assets/images/job_report_class_icon.png b/assets/images/job_report_class_icon.png new file mode 100644 index 0000000..525b1d5 Binary files /dev/null and b/assets/images/job_report_class_icon.png differ diff --git a/assets/images/job_report_scale.png b/assets/images/job_report_scale.png new file mode 100644 index 0000000..458b542 Binary files /dev/null and b/assets/images/job_report_scale.png differ diff --git a/assets/images/marking_settings.png b/assets/images/marking_settings.png new file mode 100644 index 0000000..093774a Binary files /dev/null and b/assets/images/marking_settings.png differ diff --git a/assets/images/no_check_icon.png b/assets/images/no_check_icon.png new file mode 100644 index 0000000..aa55131 Binary files /dev/null and b/assets/images/no_check_icon.png differ diff --git a/assets/images/overall_level.png b/assets/images/overall_level.png new file mode 100644 index 0000000..09f3aa6 Binary files /dev/null and b/assets/images/overall_level.png differ diff --git a/assets/images/report_group_bg.png b/assets/images/report_group_bg.png new file mode 100644 index 0000000..a68eeef Binary files /dev/null and b/assets/images/report_group_bg.png differ diff --git a/assets/images/report_home_icon_burst.png b/assets/images/report_home_icon_burst.png new file mode 100644 index 0000000..7715f37 Binary files /dev/null and b/assets/images/report_home_icon_burst.png differ diff --git a/assets/images/report_home_icon_subject.png b/assets/images/report_home_icon_subject.png new file mode 100644 index 0000000..e5eef92 Binary files /dev/null and b/assets/images/report_home_icon_subject.png differ diff --git a/assets/images/report_home_top_img.png b/assets/images/report_home_top_img.png new file mode 100644 index 0000000..ae19474 Binary files /dev/null and b/assets/images/report_home_top_img.png differ diff --git a/assets/images/report_level_bgm.png b/assets/images/report_level_bgm.png new file mode 100644 index 0000000..e9c7338 Binary files /dev/null and b/assets/images/report_level_bgm.png differ diff --git a/assets/images/reports_bg.png b/assets/images/reports_bg.png new file mode 100644 index 0000000..0a5af02 Binary files /dev/null and b/assets/images/reports_bg.png differ diff --git a/assets/images/reports_card.png b/assets/images/reports_card.png new file mode 100644 index 0000000..9afe10d Binary files /dev/null and b/assets/images/reports_card.png differ diff --git a/assets/images/reports_focus.png b/assets/images/reports_focus.png new file mode 100644 index 0000000..7d504d4 Binary files /dev/null and b/assets/images/reports_focus.png differ diff --git a/assets/images/reports_score.png b/assets/images/reports_score.png new file mode 100644 index 0000000..c37207b Binary files /dev/null and b/assets/images/reports_score.png differ diff --git a/assets/images/review_error.png b/assets/images/review_error.png new file mode 100644 index 0000000..160fc8d Binary files /dev/null and b/assets/images/review_error.png differ diff --git a/assets/images/review_loding.png b/assets/images/review_loding.png new file mode 100644 index 0000000..bdaf49e Binary files /dev/null and b/assets/images/review_loding.png differ diff --git a/assets/images/right_icon.png b/assets/images/right_icon.png new file mode 100644 index 0000000..4697c99 Binary files /dev/null and b/assets/images/right_icon.png differ diff --git a/assets/images/rise.png b/assets/images/rise.png new file mode 100644 index 0000000..6538890 Binary files /dev/null and b/assets/images/rise.png differ diff --git a/assets/images/role_selection.png b/assets/images/role_selection.png new file mode 100644 index 0000000..4fbdb17 Binary files /dev/null and b/assets/images/role_selection.png differ diff --git a/assets/images/school_icon.png b/assets/images/school_icon.png new file mode 100644 index 0000000..7b8febc Binary files /dev/null and b/assets/images/school_icon.png differ diff --git a/assets/images/search_icon.png b/assets/images/search_icon.png new file mode 100644 index 0000000..e1634ae Binary files /dev/null and b/assets/images/search_icon.png differ diff --git a/assets/images/sort_icon.png b/assets/images/sort_icon.png new file mode 100644 index 0000000..c9a2c92 Binary files /dev/null and b/assets/images/sort_icon.png differ diff --git a/assets/images/test_paper_loading_failed.png b/assets/images/test_paper_loading_failed.png new file mode 100644 index 0000000..65d323f Binary files /dev/null and b/assets/images/test_paper_loading_failed.png differ diff --git a/assets/images/upgrade_dialog_bgc.png b/assets/images/upgrade_dialog_bgc.png new file mode 100644 index 0000000..497d624 Binary files /dev/null and b/assets/images/upgrade_dialog_bgc.png differ diff --git a/assets/images/vertical_screen_btn.png b/assets/images/vertical_screen_btn.png new file mode 100644 index 0000000..bb3c388 Binary files /dev/null and b/assets/images/vertical_screen_btn.png differ diff --git a/lib/common/job/enum_subject.dart b/lib/common/job/enum_subject.dart index e53ee91..ff48445 100644 --- a/lib/common/job/enum_subject.dart +++ b/lib/common/job/enum_subject.dart @@ -2,22 +2,20 @@ import 'package:json_annotation/json_annotation.dart'; part 'enum_subject.g.dart'; - @JsonSerializable() class EnumSubject extends Object { - @JsonKey(name: 'id') int id; @JsonKey(name: 'name') String name; - EnumSubject(this.id,this.name,); + EnumSubject( + this.id, + this.name, + ); factory EnumSubject.fromJson(Map srcJson) => _$EnumSubjectFromJson(srcJson); Map toJson() => _$EnumSubjectToJson(this); - } - - diff --git a/lib/common/store/user_store.dart b/lib/common/store/user_store.dart index 7858aab..731e9c0 100644 --- a/lib/common/store/user_store.dart +++ b/lib/common/store/user_store.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:get/get.dart'; import 'package:school_asignment_app/common/job/enum_subject.dart'; import 'package:school_asignment_app/common/job/user_info.dart'; @@ -7,7 +9,7 @@ import 'package:school_asignment_app/common/utils/storage.dart'; import 'package:school_asignment_app/common/store/app_storage_key.dart'; import 'package:school_asignment_app/routes/app_pages.dart'; -class UserStore extends GetxController with RequestToolMixin{ +class UserStore extends GetxController with RequestToolMixin { static UserStore get to => Get.find(); /// 是否登录 @@ -26,9 +28,22 @@ class UserStore extends GetxController with RequestToolMixin{ token = StorageService.to.read(AppStorageKey.token.value); xToken = StorageService.to.read(AppStorageKey.xToken.value); try { - userInfo.value = StorageService.to.read(AppStorageKey.userInfo.value); - userDetailInfo.value = StorageService.to.read(AppStorageKey.userDetailInfo.value); + try { + var _userInfo = StorageService.to.read(AppStorageKey.userInfo.value); + if (_userInfo != null) { + print(_userInfo); + userInfo.value = UserInfo.fromJson(_userInfo); + } + } catch (e) { + print('这里报错了'); + } + var _userDetail = StorageService.to.read(AppStorageKey.userDetailInfo.value); + if (_userDetail != null) { + print(_userDetail); + userDetailInfo.value = UserInfoDetail.fromJson(_userDetail); + } } catch (err) { + print('LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL${err}'); StorageService.to.remove(AppStorageKey.userInfo.value); StorageService.to.remove(AppStorageKey.userDetailInfo.value); } @@ -75,4 +90,11 @@ class UserStore extends GetxController with RequestToolMixin{ var res = await getClient().getEnumSubjectList('EnumSubject'); subjectList.value = res['EnumSubject']!; } + + // 用户信息更新 + updateUserInfo() async { + UserInfo? userInfo = UserStore.to.userInfo.value; + UserInfoDetail? userDetail = await getClient().getUser(userInfo!.nameidentifier); + if (userDetail != null) setUserDetailInfo(userDetail); + } } diff --git a/lib/common/utils/storage.dart b/lib/common/utils/storage.dart index e2e06b3..e32924b 100644 --- a/lib/common/utils/storage.dart +++ b/lib/common/utils/storage.dart @@ -13,7 +13,7 @@ class StorageService extends GetxService { } T? read(String key) { - return _getStorage.read(key); + return _getStorage.read(key); } Future write(String key, dynamic value) async { diff --git a/lib/main.dart b/lib/main.dart index 1fe9f92..21d2e0e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -38,7 +38,7 @@ class MyApp extends StatelessWidget { theme: ThemeData( brightness: Brightness.light, primarySwatch: createMaterialColor(const Color.fromRGBO(46, 91, 255, 1)), - primaryColor: const Color.fromRGBO(46, 91, 255, 1), + primaryColor: const Color.fromRGBO(46, 91, 255, 1), // textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp,), primaryTextTheme: TextTheme( bodyLarge: TextStyle(fontSize: 14.sp, color: Colors.black87), @@ -72,91 +72,3 @@ class MyApp extends StatelessWidget { ); } } - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // TRY THIS: Try changing the color here to a specific color (to - // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar - // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - // - // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" - // action in the IDE, or press "p" in the console), to see the - // wireframe for each widget. - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'You have pushed the button this many times:', - ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. - ); - } -} diff --git a/lib/page/global_widget/global_scaffold.dart b/lib/page/global_widget/global_scaffold.dart index fe76e82..458838b 100644 --- a/lib/page/global_widget/global_scaffold.dart +++ b/lib/page/global_widget/global_scaffold.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -19,17 +18,18 @@ class GlobalScaffold extends StatelessWidget { appBar: appBar, backgroundColor: const Color.fromRGBO(245, 245, 245, 1), body: WillPopScope( - onWillPop: () { - // 点击返回键的操作 - if (lastPopTime == null || DateTime.now().difference(lastPopTime!) > const Duration(seconds: 2)) { - lastPopTime = DateTime.now(); - ToastUtils.showInfo('再按一次退出'); - return Future.value(false); - } else { - return Future.value(true); - } - }, - child: body), + onWillPop: () { + // 点击返回键的操作 + if (lastPopTime == null || DateTime.now().difference(lastPopTime!) > const Duration(seconds: 2)) { + lastPopTime = DateTime.now(); + ToastUtils.showInfo('再按一次退出'); + return Future.value(false); + } else { + return Future.value(true); + } + }, + child: body, + ), bottomNavigationBar: MyBottomNavigationBar(active: active), ); } diff --git a/lib/page/global_widget/start_page.dart b/lib/page/global_widget/start_page.dart index 6688a72..9793d12 100644 --- a/lib/page/global_widget/start_page.dart +++ b/lib/page/global_widget/start_page.dart @@ -1,11 +1,23 @@ -import 'package:flutter/cupertino.dart'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:school_asignment_app/common/job/user_info.dart'; +import 'package:school_asignment_app/common/job/user_info_detail.dart'; +import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'package:school_asignment_app/common/store/app_storage_key.dart'; -import 'package:school_asignment_app/common/utils/storage.dart'; +import 'package:school_asignment_app/common/store/user_store.dart'; +import 'package:school_asignment_app/common/utils/toast_utils.dart'; +import 'package:school_asignment_app/page/home_page/children/my_info.dart'; +import 'package:school_asignment_app/page/home_page/home_logic.dart'; +import 'package:school_asignment_app/page/home_page/home_view.dart'; +import 'package:school_asignment_app/page/work_page/work_logic.dart'; +import 'package:school_asignment_app/page/work_page/work_view.dart'; import 'package:school_asignment_app/routes/app_pages.dart'; +import '../../common/utils/storage.dart'; + class StartPage extends StatefulWidget { const StartPage({Key? key}) : super(key: key); @@ -14,40 +26,133 @@ class StartPage extends StatefulWidget { } class _StartPageState extends State { + DateTime? lastPopTime; + final _pageController = Get.find(); + late final List _bodyList; + @override void initState() { super.initState(); - String? token = StorageService.to.read(AppStorageKey.token.value); - UserInfo? userInfo; - try { - var userInfoJson = StorageService.to.read(AppStorageKey.userInfo.value); - if (userInfoJson != null) { - userInfo = UserInfo.fromJson(userInfoJson); - } - } catch (err) { - StorageService.to.remove(AppStorageKey.userInfo.value); - } + Get.put(HomeLogic()); + Get.put(WorkLogic()); + + _bodyList = [ + const HomePage(), + const WorkPage(), + MyInfo(), + ]; + + String? token = UserStore.to.token; + UserInfo? userInfo = UserStore.to.userInfo.value; + UserInfoDetail? userInfoDetail = UserStore.to.userDetailInfo.value; if ((token?.isNotEmpty ?? false) && userInfo != null) { - Future.delayed(const Duration(milliseconds: 200)).then((e) { - Get.toNamed(Routes.home); - }); + // Future.delayed(const Duration(milliseconds: 200)).then((e) { + // Get.toNamed(Routes.home); + // }); + // 更新用户信息 + if (userInfoDetail == null) UserStore.to.updateUserInfo(); } else { - Future.delayed(const Duration(milliseconds: 200)).then((e) { - Get.toNamed(Routes.login); - }); + Future.delayed(const Duration(milliseconds: 100)).then((e) => Get.offAllNamed(Routes.login)); } } + @override + void dispose() { + Get.delete(); + super.dispose(); + } + + /// 获取项目 icon + Widget getItemIcon(String icon) { + return Image.asset( + icon, + fit: BoxFit.contain, + width: 24.w, + height: 24.h, + ); + } + @override Widget build(BuildContext context) { - return Stack(children: [ - Positioned( - bottom: 40.r, - child: Text( - '启动中...', - style: TextStyle(fontSize: 16.r, color: const Color(0xFF6888FD)), - )) - ]); + return WillPopScope( + child: Scaffold( + body: PageView( + controller: _pageController._pageIndexState.pageController, + physics: const BouncingScrollPhysics(), + onPageChanged: (index) { + _pageController._pageIndexState.pageIndex.value = index; + }, + children: _bodyList, + ), + bottomNavigationBar: Obx(() { + return BottomNavigationBar( + items: [ + BottomNavigationBarItem( + label: '首页', + icon: getItemIcon('assets/images/ic_home_normal.png'), + activeIcon: getItemIcon('assets/images/ic_home_press.png'), + ), + BottomNavigationBarItem( + label: '考试', + icon: getItemIcon('assets/images/ic_work_normal.png'), + activeIcon: getItemIcon('assets/images/ic_work_press.png'), + ), + BottomNavigationBarItem( + label: '我的', + icon: getItemIcon('assets/images/ic_mine_normal.png'), + activeIcon: getItemIcon('assets/images/ic_mine_press.png'), + ), + ], + //设置显示的模式 + type: BottomNavigationBarType.fixed, + //设置当前的索引 + currentIndex: _pageController._pageIndexState.pageIndex.value, + //tabBottom的点击监听 + onTap: (index) { + print('appbar下标:${index}'); + _pageController._pageIndexState.pageController.jumpToPage(index); + }, + ); + }), + ), + onWillPop: () async { + if (lastPopTime == null || DateTime.now().difference(lastPopTime!) > const Duration(seconds: 1)) { + lastPopTime = DateTime.now(); + ToastUtils.getFluttertoast(context: context, msg: '连续两次返回就退出'); + return Future.value(false); + } else { + lastPopTime = DateTime.now(); + // 退出app + return Future.value(true); + } + }, + ); + } +} + +class PageIndexState { + PageIndexState({required this.pageController}); + + RxInt pageIndex = 0.obs; + + //文本输入框控制器 + final PageController pageController; +} + +class PageIndexController extends GetxController with RequestToolMixin { + late PageIndexState _pageIndexState; + + @override + void onInit() { + _pageIndexState = PageIndexState(pageController: PageController()); + super.onInit(); + } +} + +class StartPageIndexBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => PageIndexController()); } } diff --git a/lib/page/home_page/children/my_info.dart b/lib/page/home_page/children/my_info.dart index b90cc64..e8c474e 100644 --- a/lib/page/home_page/children/my_info.dart +++ b/lib/page/home_page/children/my_info.dart @@ -1,54 +1,62 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:school_asignment_app/common/job/user_info.dart'; +import 'package:school_asignment_app/common/job/user_info_detail.dart'; import 'package:school_asignment_app/common/store/app_storage_key.dart'; import 'package:school_asignment_app/common/store/user_store.dart'; import 'package:school_asignment_app/common/utils/storage.dart'; -import 'package:school_asignment_app/page/global_widget/global_scaffold.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/home_page/home_logic.dart'; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:school_asignment_app/routes/app_pages.dart'; -class MyInfo extends StatelessWidget { - MyInfo({Key? key}) : super(key: key); - late Rx userInfo = UserStore.to.userInfo; +class MyInfo extends StatefulWidget { + const MyInfo({super.key}); - // 确认对话框 - _showAlertDialog(context1) async { - await showDialog( - // 表示点击灰色背景的时候是否消失弹出框 - barrierDismissible: false, - context: context1, - builder: (context) { - return AlertDialog(title: quickText("提示信息"), content: quickText("您确定要退出登录吗?"), actions: [ - TextButton( - child: quickText("取消"), - onPressed: () { - Navigator.pop(context, 'Cancle'); - }, - ), - TextButton( - child: quickText("确定"), - onPressed: () { - /* ref.read(markingKeyboardProvider.notifier).clean(); + @override + State createState() => _MyInfoState(); +} + +class _MyInfoState extends State with AutomaticKeepAliveClientMixin { + late Rx userInfo = UserStore.to.userDetailInfo; + + // 确认对话框 + _showAlertDialog(context1) async { + await showDialog( + // 表示点击灰色背景的时候是否消失弹出框 + barrierDismissible: false, + context: context1, + builder: (context) { + return AlertDialog(title: quickText("提示信息"), content: quickText("您确定要退出登录吗?"), actions: [ + TextButton( + child: quickText("取消"), + onPressed: () { + Navigator.pop(context, 'Cancle'); + }, + ), + TextButton( + child: quickText("确定"), + onPressed: () { + /* ref.read(markingKeyboardProvider.notifier).clean(); ref.read(markingSubtopicSwitchingProvider.notifier).clean(); ref.read(userTokenProvider.notifier).clean(); ref.read(userProvider.notifier).clean();*/ - StorageService.to.remove(AppStorageKey.token.value); - StorageService.to.remove(AppStorageKey.userInfo.value); - Navigator.pop(context, "Ok"); + StorageService.to.remove(AppStorageKey.token.value); + StorageService.to.remove(AppStorageKey.userInfo.value); + Navigator.pop(context, "Ok"); Get.offAllNamed(Routes.login); - }) - ]); - }); - } + }) + ]); + }); + } + + @override + bool get wantKeepAlive => true; @override Widget build(BuildContext context) { + super.build(context); + final personalInfoTitleStly = TextStyle( color: const Color.fromRGBO(80, 87, 103, 1), fontSize: 16.sp, @@ -58,55 +66,53 @@ class MyInfo extends StatelessWidget { fontSize: 16.sp, ); - return GlobalScaffold( - active: 3, - body: AnnotatedRegion( - value: const SystemUiOverlayStyle( - statusBarColor: Colors.transparent, - systemNavigationBarIconBrightness: Brightness.light, - statusBarIconBrightness: Brightness.light, - statusBarBrightness: Brightness.dark, - ), - child: Stack( - children: [ - SizedBox( - height: double.infinity, - child: Column( - children: [ - Container( - height: 240.h, - width: double.infinity, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/personal_bgi.png'), - fit: BoxFit.cover, - ), + return AnnotatedRegion( + value: const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + systemNavigationBarIconBrightness: Brightness.light, + statusBarIconBrightness: Brightness.light, + statusBarBrightness: Brightness.dark, + ), + child: Stack( + children: [ + SizedBox( + height: double.infinity, + child: Column( + children: [ + Container( + height: 240.h, + width: double.infinity, + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/personal_bgi.png'), + fit: BoxFit.cover, ), ), - Expanded( - child: Container( - color: const Color.fromRGBO(248, 248, 248, 1), - )) - ], - ), + ), + Expanded( + child: Container( + color: const Color.fromRGBO(248, 248, 248, 1), + )) + ], ), - SafeArea( - child: Scaffold( - backgroundColor: Colors.transparent, - body: Column( - children: [ - Stack( - alignment: const FractionalOffset(0.04, 0.1), - children: [ - Container( - height: 200.h, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(80.w), - child: Container( + ), + SafeArea( + child: Scaffold( + backgroundColor: Colors.transparent, + body: Column( + children: [ + Stack( + alignment: const FractionalOffset(0.04, 0.1), + children: [ + Container( + height: 200.h, + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(80.w), + child: Container( width: 80.w, height: 80.w, padding: EdgeInsets.all(4.w), @@ -128,98 +134,88 @@ class MyInfo extends StatelessWidget { ], ), child: Image.asset('assets/images/default_user_dead.png') - - /* CachedNetworkImage( + + /* CachedNetworkImage( fit: BoxFit.cover, imageUrl:'', placeholder: (context, url) => Image.asset('assets/images/default_user_dead.png'), errorWidget: (context, url, error) => Image.asset('assets/images/default_user_dead.png'), ),*/ - ), - ), - InkWell( - onTap: () { - /*if (tokenState == '' || userState.id == '') { + ), + ), + InkWell( + onTap: () { + /*if (tokenState == '' || userState.id == '') { toLoginPage(context); }*/ - }, - child: Container( - margin: EdgeInsets.only(top: 16.h), - child: Text( - userInfo.value!.givenname != '' ? userInfo.value!.givenname : '请前往登录', - style: TextStyle(fontSize: 16.sp, color: Colors.white), - ), + }, + child: Container( + margin: EdgeInsets.only(top: 16.h), + child: Text( + userInfo.value?.name ?? '请前往登录', + style: TextStyle(fontSize: 16.sp, color: Colors.white), ), ), - ], - ), + ), + ], ), - /* InkWell( + ), + /* InkWell( onTap: () => Get.back(), child: Icon(Icons.arrow_back_ios_new_rounded, color: Colors.white, size: 24.sp), ),*/ + ], + ), + SizedBox(height: 14.h), + Container( + margin: EdgeInsets.symmetric(vertical: 22.h, horizontal: 16.w), + padding: EdgeInsets.symmetric(vertical: 22.h, horizontal: 16.w), + height: 240.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.w)), + color: Colors.white, + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(46, 91, 255, 0.1), + offset: Offset.zero, //阴影y轴偏移量 + blurRadius: 20, //阴影模糊程度 + spreadRadius: 10, //阴影扩散程度 + ) ], ), - SizedBox(height: 14.h), - Container( - margin: EdgeInsets.symmetric(vertical: 22.h, horizontal: 16.w), - padding: EdgeInsets.symmetric(vertical: 22.h, horizontal: 16.w), - height: 310.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.w)), - color: Colors.white, - boxShadow: const [ - BoxShadow( - color: Color.fromRGBO(46, 91, 255, 0.1), - offset: Offset.zero, //阴影y轴偏移量 - blurRadius: 20, //阴影模糊程度 - spreadRadius: 10, //阴影扩散程度 - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('账号', style: personalInfoTitleStly), - Text(userInfo.value!.givenname, style: personalInfoValStly) - ], - ), - Container( - height: 1.w, - color: const Color.fromRGBO(240, 243, 255, 1), - ), - /* Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('所在学校', style: personalInfoTitleStly), - Text(userState.schoolName, style: personalInfoValStly) - ], - ), - Container( - height: 1.w, - color: const Color.fromRGBO(240, 243, 255, 1), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('担任职位', style: personalInfoTitleStly), - SizedBox(width: 20.w), - Expanded( - child: Text( - userState.positionNames.map((e) => e).toList().join(','), - maxLines: 2, - textAlign: TextAlign.right, - overflow: TextOverflow.ellipsis, - style: personalInfoValStly, - ), - ) - ], - ), - Container(height: 1.w, color: const Color.fromRGBO(240, 243, 255, 1)), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text('账号', style: personalInfoTitleStly), Text(userInfo.value?.name ?? '请前往登录', style: personalInfoValStly)], + ), + Container( + height: 1.w, + color: const Color.fromRGBO(240, 243, 255, 1), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text('所在学校', style: personalInfoTitleStly), Text(userInfo.value?.schoolName ?? '', style: personalInfoValStly)], + ), + /* Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('担任职位', style: personalInfoTitleStly), + SizedBox(width: 20.w), + Expanded( + child: Text( + userInfo.value?.gender??'', + maxLines: 2, + textAlign: TextAlign.right, + overflow: TextOverflow.ellipsis, + style: personalInfoValStly, + ), + ) + ], + ), + Container(height: 1.w, color: const Color.fromRGBO(240, 243, 255, 1)), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -235,87 +231,86 @@ class MyInfo extends StatelessWidget { ) ], ),*/ - Container(height: 1.w, color: const Color.fromRGBO(240, 243, 255, 1)), - Padding( - padding: EdgeInsets.only(top: 10.h), - child: InkWell( - onTap: () { - Get.toNamed(Routes.otherPage); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('其他', style: personalInfoTitleStly), - Icon( - Icons.arrow_forward_ios, - color: const Color.fromRGBO(80, 87, 103, 1), - size: 16.sp, + Container(height: 1.w, color: const Color.fromRGBO(240, 243, 255, 1)), + Padding( + padding: EdgeInsets.only(top: 10.h), + child: InkWell( + onTap: () { + Get.toNamed(Routes.otherPage); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('其他', style: personalInfoTitleStly), + Icon( + Icons.arrow_forward_ios, + color: const Color.fromRGBO(80, 87, 103, 1), + size: 16.sp, + ) + ], + ), + ), + ) + ], + ), + ), + Expanded( + child: Column( + children: [ + const Expanded(child: SizedBox()), + Container( + margin: EdgeInsets.only(bottom: 40.h), + alignment: Alignment.bottomCenter, + child: InkWell( + child: Container( + padding: EdgeInsets.symmetric(vertical: 14.h), + margin: EdgeInsets.only(right: 16.w, left: 16.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.w), + ), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: const Color.fromRGBO(46, 91, 255, 0.2), + offset: Offset(2.w, 2.h), //阴影y轴偏移量 + blurRadius: 14, //阴影模糊程度 + spreadRadius: 0.5, //阴影扩散程度 ) ], ), - ), - ) - ], - ), - ), - Expanded( - child: Column( - children: [ - const Expanded(child: SizedBox()), - Container( - margin: EdgeInsets.only(bottom: 40.h), - alignment: Alignment.bottomCenter, - child: InkWell( - child: Container( - padding: EdgeInsets.symmetric(vertical: 14.h), - margin: EdgeInsets.only(right: 16.w, left: 16.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.exit_to_app_outlined, + size: 16.sp, + color: const Color.fromRGBO(148, 163, 182, 1), ), - color: Colors.white, - boxShadow: [ - BoxShadow( - color: const Color.fromRGBO(46, 91, 255, 0.2), - offset: Offset(2.w, 2.h), //阴影y轴偏移量 - blurRadius: 14, //阴影模糊程度 - spreadRadius: 0.5, //阴影扩散程度 - ) - ], - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - Icons.exit_to_app_outlined, - size: 16.sp, - color: const Color.fromRGBO(148, 163, 182, 1), - ), - Container( - width: 6.w, - ), - Text( - '退出登录', - style: TextStyle(color: const Color.fromRGBO(148, 163, 182, 1), fontSize: 16.sp), - ), - ], - ), + Container( + width: 6.w, + ), + Text( + '退出登录', + style: TextStyle(color: const Color.fromRGBO(148, 163, 182, 1), fontSize: 16.sp), + ), + ], ), - onTap: () { - _showAlertDialog(context); - }, ), + onTap: () { + _showAlertDialog(context); + }, ), - ], - ), + ), + ], ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ); } diff --git a/lib/page/home_page/home_logic.dart b/lib/page/home_page/home_logic.dart index c0200b6..f0b6967 100644 --- a/lib/page/home_page/home_logic.dart +++ b/lib/page/home_page/home_logic.dart @@ -12,7 +12,7 @@ import 'package:school_asignment_app/page/global_widget/my_text.dart'; import 'home_state.dart'; -class HomeLogic extends GetxController with RequestToolMixin,GetTickerProviderStateMixin{ +class HomeLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin { final HomeState state = HomeState(); late TabController tabController; /* 待阅卷 */ @@ -20,7 +20,7 @@ class HomeLogic extends GetxController with RequestToolMixin,GetTickerProviderSt late final EasyRefreshController refreshController2; @override - void onInit(){ + void onInit() { super.onInit(); state.userInfo = UserStore.to.userInfo; state.active = Get.arguments ?? 1; @@ -32,29 +32,32 @@ class HomeLogic extends GetxController with RequestToolMixin,GetTickerProviderSt ); getList(); } - void getList() async{ - WorkStudentParams params = WorkStudentParams(assessType: state.tabIndex.value,); + + void getList() async { + WorkStudentParams params = WorkStudentParams( + assessType: state.tabIndex.value, + ); WorkStudent data = await getClient().getWorkList(params); state.workList.value = data.items; refreshController1.finishRefresh(); refreshController2.finishRefresh(); -print('state.workList.length='); -print(state.workList.length); + print('state.workList.length='); + print(state.workList.length); } + /// 刷新方法 - Future onMyRefresh(EasyRefreshController controller, int tab) async { - /* params.page = RequestConfig.basePage.page; + Future onMyRefresh(EasyRefreshController controller, int tab) async { + /* params.page = RequestConfig.basePage.page; List lists = await getData(controller, params, isReFresh: true); try { tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists); } catch (e) {} toUpState(setState, () {}, mounted);*/ getList(); - } /// 加载方法 - Future onMyLoad(EasyRefreshController controller, int tab) async { + Future onMyLoad(EasyRefreshController controller, int tab) async { /*params.page++; List lists = await getData(controller, params); if (lists.isNotEmpty) { @@ -62,15 +65,15 @@ print(state.workList.length); toUpState(setState, () {}, mounted); }*/ } - String formatSubject(int id){ - if(UserStore.to.subjectList.isEmpty){ - return ''; + String formatSubject(int id) { + if (UserStore.to.subjectList.isEmpty) { + return ''; + } + EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id); + return item.name ?? ''; } - EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id); - return item.name??''; - } - /* Future showStudents( + /* Future showStudents( BuildContext context, [ bool? submitted = false, String? className, @@ -133,7 +136,7 @@ print(state.workList.length); }*/ @override - void dispose(){ + void dispose() { super.dispose(); tabController.dispose(); refreshController1.dispose(); diff --git a/lib/page/home_page/home_view.dart b/lib/page/home_page/home_view.dart index 5245b20..a361259 100644 --- a/lib/page/home_page/home_view.dart +++ b/lib/page/home_page/home_view.dart @@ -25,165 +25,135 @@ class HomePage extends StatefulWidget { State createState() => _HomePageState(); } -class _HomePageState extends State { +class _HomePageState extends State with AutomaticKeepAliveClientMixin { final logic = Get.find(); - final state = Get - .find() - .state; + final state = Get.find().state; + + @override + bool get wantKeepAlive => true; @override Widget build(BuildContext context) { - return GlobalScaffold( - active: state.active, - body: AnnotatedRegion( - value: const SystemUiOverlayStyle( - systemNavigationBarColor: Color(0xFF000000), - systemNavigationBarDividerColor: null, - statusBarColor: Colors.white, - systemNavigationBarIconBrightness: Brightness.light, - statusBarIconBrightness: Brightness.dark, - statusBarBrightness: Brightness.light, - ), - child: Scaffold( - backgroundColor: const Color.fromRGBO(244, 244, 244, 1), - body: OrientationBuilder( - builder: (BuildContext context, Orientation orientation) { - return Column( - children: [ - Container( - color: Colors.white, - margin: EdgeInsets.only(top: MediaQuery - .of(context) - .padding - .top), - padding: EdgeInsets.only(bottom: 9.h, top: 4.h), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Expanded(flex: 1, child: SizedBox()), - Expanded( - flex: 4, - child: Container( - padding: EdgeInsets.symmetric(vertical: 2.h), - alignment: Alignment.center, - decoration: BoxDecoration( - color: const Color.fromRGBO(243, 243, 243, 1), - borderRadius: BorderRadius.circular(8.r), + super.build(context); + + return AnnotatedRegion( + value: const SystemUiOverlayStyle( + systemNavigationBarColor: Color(0xFF000000), + systemNavigationBarDividerColor: null, + statusBarColor: Colors.white, + systemNavigationBarIconBrightness: Brightness.light, + statusBarIconBrightness: Brightness.dark, + statusBarBrightness: Brightness.light, + ), + child: Scaffold( + backgroundColor: const Color.fromRGBO(244, 244, 244, 1), + body: OrientationBuilder( + builder: (BuildContext context, Orientation orientation) { + return Column( + children: [ + Container( + color: Colors.white, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + padding: EdgeInsets.only(bottom: 9.h, top: 4.h), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Expanded(flex: 1, child: SizedBox()), + Expanded( + flex: 4, + child: Container( + padding: EdgeInsets.symmetric(vertical: 2.h), + alignment: Alignment.center, + decoration: BoxDecoration( + color: const Color.fromRGBO(243, 243, 243, 1), + borderRadius: BorderRadius.circular(8.r), + ), + child: TabBar( + padding: EdgeInsets.zero, + indicatorPadding: EdgeInsets.zero, + indicatorWeight: 0, + labelPadding: EdgeInsets.symmetric(horizontal: 2.w), + controller: logic.tabController, + unselectedLabelStyle: TextStyle( + fontSize: 14.sp, + color: const Color.fromRGBO(69, 83, 100, 1), ), - child: TabBar( - padding: EdgeInsets.zero, - indicatorPadding: EdgeInsets.zero, - indicatorWeight: 0, - labelPadding: EdgeInsets.symmetric( - horizontal: 2.w), - controller: logic.tabController, - unselectedLabelStyle: TextStyle( - fontSize: 14.sp, - color: const Color.fromRGBO(69, 83, 100, 1), - ), - labelStyle: TextStyle( - fontSize: 14.sp, - color: const Color.fromRGBO(104, 136, 253, 1), - ), - // labelColor: const Color.fromRGBO(45, 56, 76, 1), - indicator: const BoxDecoration(), - onTap: (index) { - state.tabIndex.value = index; - if (index == 1 && state.completedToRefresh) { - // 已阅卷 - // _refreshController2.callRefresh(); - state.completedToRefresh = false; - } - logic.getList(); - }, - tabs: [ - Tab( - iconMargin: EdgeInsets.zero, - height: 34.h, - child: Obx(() { - return Container( - width: 140.w, - alignment: Alignment.center, - decoration: BoxDecoration( - color: state.tabIndex.value == 0 - ? const Color.fromRGBO( - 255, 255, 255, 1) - : null, - borderRadius: BorderRadius.all( - Radius.circular(8.r)), - ), - child: quickText( - '待批阅', - size: 14.sp, - color: state.tabIndex.value == 0 - ? Theme - .of(context) - .primaryColor - : const Color.fromRGBO( - 80, 94, 110, 1), - fontWeight: state.tabIndex.value == 0 - ? FontWeight.bold - : null, - ), - ); - }), - ), - Tab( - iconMargin: EdgeInsets.zero, - height: 34.h, - child: Obx(() { - return Container( - width: 140.w, - alignment: Alignment.center, - decoration: BoxDecoration( - color: state.tabIndex.value == 1 - ? const Color.fromRGBO( - 255, 255, 255, 1) - : null, - borderRadius: BorderRadius.all( - Radius.circular(8.r)), - ), - child: quickText( - '已批阅', - size: 14.sp, - color: state.tabIndex.value == 1 - ? Theme - .of(context) - .primaryColor - : const Color.fromRGBO( - 80, 94, 110, 1), - fontWeight: state.tabIndex.value == 1 - ? FontWeight - .bold - : null, - ), - ); - }), - ), - ], + labelStyle: TextStyle( + fontSize: 14.sp, + color: const Color.fromRGBO(104, 136, 253, 1), ), + // labelColor: const Color.fromRGBO(45, 56, 76, 1), + indicator: const BoxDecoration(), + onTap: (index) { + state.tabIndex.value = index; + if (index == 1 && state.completedToRefresh) { + // 已阅卷 + // _refreshController2.callRefresh(); + state.completedToRefresh = false; + } + logic.getList(); + }, + tabs: [ + Tab( + iconMargin: EdgeInsets.zero, + height: 34.h, + child: Obx(() { + return Container( + width: 140.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: state.tabIndex.value == 0 ? const Color.fromRGBO(255, 255, 255, 1) : null, + borderRadius: BorderRadius.all(Radius.circular(8.r)), + ), + child: quickText( + '待批阅', + size: 14.sp, + color: state.tabIndex.value == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1), + fontWeight: state.tabIndex.value == 0 ? FontWeight.bold : null, + ), + ); + }), + ), + Tab( + iconMargin: EdgeInsets.zero, + height: 34.h, + child: Obx(() { + return Container( + width: 140.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: state.tabIndex.value == 1 ? const Color.fromRGBO(255, 255, 255, 1) : null, + borderRadius: BorderRadius.all(Radius.circular(8.r)), + ), + child: quickText( + '已批阅', + size: 14.sp, + color: state.tabIndex.value == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1), + fontWeight: state.tabIndex.value == 1 ? FontWeight.bold : null, + ), + ); + }), + ), + ], ), ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - /* RouterManager.router + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + /* RouterManager.router .navigateTo( context, RouterManager.jobStudentGroupPath, transition: getTransition());*/ - }, - child: Icon( - const IconData( - 0xe63e, fontFamily: "AlibabaIcon"), - color: const Color.fromRGBO(44, 48, 63, 1), - size: 24.sp), - ), + }, + child: Icon(const IconData(0xe63e, fontFamily: "AlibabaIcon"), color: const Color.fromRGBO(44, 48, 63, 1), size: 24.sp), ), - ], - ), + ), + ], ), - /* if (state.tabIndex.value == 1) + ), + /* if (state.tabIndex.value == 1) $CompletedJobConditionFilter( controller: _tabController2, jobType: params2.markingType ?? 1, @@ -210,36 +180,31 @@ class _HomePageState extends State { _refreshController2.callRefresh(); }, ),*/ - Expanded( - child: IndexedStack( - index: state.tabIndex.value, - children: [ - $easyRefresh( - controller: logic.refreshController1, - tab: 1, - type: state.active, - data: state.workList, - onLoad: logic.onMyLoad, - onRefresh: logic.onMyRefresh, - logic: logic - ), - $easyRefresh( - controller: logic.refreshController2, - tab: 2, - type: state.active, - data: state.workList, - onLoad: logic.onMyLoad, - onRefresh: logic.onMyRefresh, - logic: logic - ), - ], - ) - - ), - ], - ); - }, - ), + Expanded( + child: IndexedStack( + index: state.tabIndex.value, + children: [ + $easyRefresh( + controller: logic.refreshController1, + tab: 1, + type: state.active, + data: state.workList, + onLoad: logic.onMyLoad, + onRefresh: logic.onMyRefresh, + logic: logic), + $easyRefresh( + controller: logic.refreshController2, + tab: 2, + type: state.active, + data: state.workList, + onLoad: logic.onMyLoad, + onRefresh: logic.onMyRefresh, + logic: logic), + ], + )), + ], + ); + }, ), ), ); @@ -250,7 +215,6 @@ class _HomePageState extends State { Get.delete(); super.dispose(); } - } /// 已阅卷 @@ -259,10 +223,8 @@ class _HomePageState extends State { @swidget Widget $easyRefresh({ required EasyRefreshController controller, - required Future< - void> Function(EasyRefreshController controller, int tab) onRefresh, - required Future< - void> Function(EasyRefreshController controller, int tab) onLoad, + required Future Function(EasyRefreshController controller, int tab) onRefresh, + required Future Function(EasyRefreshController controller, int tab) onLoad, required List data, required int tab, required int type, @@ -282,33 +244,37 @@ Widget $easyRefresh({ footer: TaurusFooter(), child: completed && isPadFlag ? GridView( - padding: EdgeInsets.only( - top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, //横轴三个子widget - mainAxisSpacing: 10.h, - crossAxisSpacing: 6.w, - childAspectRatio: 1.81 //宽高比为1时,子widget - ), - children: List.generate(data.length, (index) { - Items item = data[index]; - String subjectName = logic.formatSubject(item.subject); - return $reviewedItem(jobTaskItem: item,type: type,subjectName:subjectName); - }), - ) + padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, //横轴三个子widget + mainAxisSpacing: 10.h, + crossAxisSpacing: 6.w, + childAspectRatio: 1.81 //宽高比为1时,子widget + ), + children: List.generate(data.length, (index) { + Items item = data[index]; + String subjectName = logic.formatSubject(item.subject); + return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName); + }), + ) : ListView.builder( - padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), - itemBuilder: (context, index) { - Items item = data[index]; - return TaskListItem(completed:completed,jobTaskItem:item,type:type,logic: logic,); - /*HomeworkTasksViewItem( + padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + itemBuilder: (context, index) { + Items item = data[index]; + return TaskListItem( + completed: completed, + jobTaskItem: item, + type: type, + logic: logic, + ); + /*HomeworkTasksViewItem( completed: completed, jobTaskItem: data[index], call: () => controller.callRefresh(), );*/ - }, - itemCount: data.length, - ), + }, + itemCount: data.length, + ), onRefresh: () => onRefresh(controller, tab), onLoad: () => onLoad(controller, tab), ); @@ -316,7 +282,7 @@ Widget $easyRefresh({ } @swidget -Widget $reviewedItem({ required Items jobTaskItem, required int type,required String subjectName}) { +Widget $reviewedItem({required Items jobTaskItem, required int type, required String subjectName}) { EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w); return InkWell( @@ -354,9 +320,7 @@ Widget $reviewedItem({ required Items jobTaskItem, required int type,required St alignment: Alignment.center, padding: EdgeInsets.only(left: 2.w), decoration: BoxDecoration( - color: type == 1 - ? const Color.fromRGBO(104, 136, 253, 1) - : const Color.fromRGBO(255, 175, 56, 1), + color: type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1), borderRadius: BorderRadius.only( topLeft: Radius.circular(14.r), topRight: Radius.circular(3.r), @@ -365,13 +329,10 @@ Widget $reviewedItem({ required Items jobTaskItem, required int type,required St ), ), margin: EdgeInsets.only(right: 4.w), - child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, - size: 10.sp), + child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp), ), Expanded( - child: quickText(jobTaskItem.name, size: 14.sp, - color: const Color.fromRGBO(70, 70, 70, 1), - maxLines: 2), + child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2), ) ], ), @@ -388,22 +349,18 @@ Widget $reviewedItem({ required Items jobTaskItem, required int type,required St size: 10.sp, fontWeight: FontWeight.w500, ), - quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), - size: 10.sp, - fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500), quickText( '参与班级:', color: const Color.fromRGBO(76, 199, 147, 1), size: 9.sp, ), - quickText( + quickText( '${jobTaskItem.classCount}', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, ), - quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), - size: 10.sp, - fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500), quickText( '科目:$subjectName', color: const Color.fromRGBO(116, 145, 253, 1), @@ -432,9 +389,7 @@ Widget $reviewedItem({ required Items jobTaskItem, required int type,required St child: Container( padding: EdgeInsets.symmetric(vertical: 6.h), decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(6.r), - bottomRight: Radius.circular(6.r)), + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), color: Colors.white, boxShadow: const [ BoxShadow( @@ -449,9 +404,7 @@ Widget $reviewedItem({ required Items jobTaskItem, required int type,required St Expanded( child: Container( alignment: Alignment.center, - child: quickText( - '查看报告', color: const Color.fromRGBO(118, 118, 118, 1), - size: 11.sp), + child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp), ), ), ]), @@ -461,4 +414,4 @@ Widget $reviewedItem({ required Items jobTaskItem, required int type,required St ), ), ); -} \ No newline at end of file +} diff --git a/lib/page/login_page/login_logic.dart b/lib/page/login_page/login_logic.dart index 303f322..56cd2d1 100644 --- a/lib/page/login_page/login_logic.dart +++ b/lib/page/login_page/login_logic.dart @@ -24,6 +24,7 @@ class LoginLogic extends GetxController with RequestToolMixin { super.onReady(); } + @override void onInit() { super.onInit(); state.userNameController = TextEditingController(text: 'wangyang')..addListener(userNameListener); @@ -80,7 +81,7 @@ class LoginLogic extends GetxController with RequestToolMixin { UserStore.to.setUserDetailInfo(data); UserStore.to.getSubjectList(); EasyLoading.dismiss(); - Get.offAllNamed(Routes.home); + Get.offAllNamed(Routes.startPage); // if (resultData.code != 200 || userData?.accessToken == null || userData?.accessToken == '') { // return toMsg(resultData.message ?? '登录失败,请重试'); // } @@ -114,8 +115,8 @@ class LoginLogic extends GetxController with RequestToolMixin { } catch (e) { print('进来异常'); EasyLoading.dismiss(); - StorageService.to.erase(); UserStore.to.erase(); + StorageService.to.erase(); if (e is Exception) { try { toMsg(e.toString().split(":")[1]); diff --git a/lib/page/work_page/work_view.dart b/lib/page/work_page/work_view.dart index ed1d0c0..a48e23b 100644 --- a/lib/page/work_page/work_view.dart +++ b/lib/page/work_page/work_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/page/global_widget/global_scaffold.dart'; +import 'package:school_asignment_app/page/global_widget/my_text.dart'; import 'work_logic.dart'; @@ -11,22 +11,20 @@ class WorkPage extends StatefulWidget { State createState() => _WorkPageState(); } -class _WorkPageState extends State { +class _WorkPageState extends State with AutomaticKeepAliveClientMixin { final logic = Get.find(); final state = Get.find().state; + @override + bool get wantKeepAlive => true; + @override Widget build(BuildContext context) { - return GlobalScaffold( - active: 2, - appBar: AppBar( - title: Text('作业'), - centerTitle: true, - ), - body: Column( - children: [ - Text('作业页面'), - ], + super.build(context); + return Scaffold( + body: Container( + alignment: Alignment.center, + child: quickText('考试页面'), ), ); } @@ -36,4 +34,4 @@ class _WorkPageState extends State { Get.delete(); super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/routes/app_pages.dart b/lib/routes/app_pages.dart index 89871ee..c28df46 100644 --- a/lib/routes/app_pages.dart +++ b/lib/routes/app_pages.dart @@ -10,14 +10,15 @@ import 'package:school_asignment_app/page/login_page/login_view.dart'; import 'package:school_asignment_app/page/work_page/work_binding.dart'; import 'package:school_asignment_app/page/work_page/work_view.dart'; part 'app_routes.dart'; + abstract class AppPages { -static final pages=[ - GetPage(name: Routes.login, page: () => const LoginPage(), binding: LoginBinding(), transition: Transition.noTransition), - GetPage(name: Routes.agreementPage, page: () => const AgreementPage(), binding: LoginBinding(), transition: Transition.noTransition), - GetPage(name: Routes.home, page: () => const HomePage(), binding: HomeBinding(), transition: Transition.noTransition), - GetPage(name: Routes.startPage, page: () => const StartPage(), transition: Transition.noTransition), - GetPage(name: Routes.myInfo, page: () => MyInfo(), transition: Transition.noTransition), - GetPage(name: Routes.work, page: () => const WorkPage(), binding: WorkBinding(), transition: Transition.noTransition), - GetPage(name: Routes.otherPage, page: () => const OhterPage(), transition: Transition.noTransition), -]; -} \ No newline at end of file + static final pages = [ + GetPage(name: Routes.login, page: () => const LoginPage(), binding: LoginBinding(), transition: Transition.noTransition), + GetPage(name: Routes.agreementPage, page: () => const AgreementPage(), binding: LoginBinding(), transition: Transition.noTransition), + GetPage(name: Routes.home, page: () => const HomePage(), binding: HomeBinding(), transition: Transition.noTransition), + GetPage(name: Routes.startPage, page: () => const StartPage(), binding: StartPageIndexBinding(), transition: Transition.noTransition), + GetPage(name: Routes.myInfo, page: () => MyInfo(), transition: Transition.noTransition), + GetPage(name: Routes.work, page: () => const WorkPage(), binding: WorkBinding(), transition: Transition.noTransition), + GetPage(name: Routes.otherPage, page: () => const OhterPage(), transition: Transition.noTransition), + ]; +} diff --git a/pubspec.yaml b/pubspec.yaml index 2d8a479..0e0e534 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: school_asignment_app description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.0.1 <4.0.0' + sdk: ">=3.0.1 <4.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -31,7 +31,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -71,7 +70,6 @@ dependencies: # 进度条 percent_indicator: ^4.2.3 - dev_dependencies: flutter_test: sdk: flutter @@ -91,7 +89,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. @@ -103,6 +100,9 @@ flutter: # - images/a_dot_ham.jpeg assets: - assets/images/ + - assets/images/2.0x/ + - assets/images/3.0x/ + - assets/images/4.0x/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware