Summary
Migrate the example app's standard pages from old scaffold + manual state management patterns to the new convenience widgets and DataState pattern.
Changes
| File |
Before |
After |
app.dart |
MaterialApp + manual theme/locale/edge-to-edge |
ApApp |
login_page.dart |
LoginScaffold + 210 lines manual preference handling |
ApLoginPage (24 lines) |
course_page.dart |
CourseScaffold + manual CourseState |
ApCoursePage (28 lines) |
score_page.dart |
ScoreScaffold + manual ScoreState |
ApScorePage (29 lines) |
home_page.dart |
HomePageScaffold + HomeState enum |
.fromDataState() + DataState<List<Announcement>> |
setting_page.dart |
ShareDataWidget.of(context) |
ApApp.of(context) |
share_data_widget.dart |
Deleted |
— |
Motivation
The example app serves as the primary reference for downstream apps (NKUST, NSYSU, WTUC). Having the standard example use old patterns while simple_example/ uses new patterns creates confusion. After this migration, both examples demonstrate the recommended approach.
Checklist
Summary
Migrate the example app's standard pages from old scaffold + manual state management patterns to the new convenience widgets and
DataStatepattern.Changes
app.dartMaterialApp+ manual theme/locale/edge-to-edgeApApplogin_page.dartLoginScaffold+ 210 lines manual preference handlingApLoginPage(24 lines)course_page.dartCourseScaffold+ manualCourseStateApCoursePage(28 lines)score_page.dartScoreScaffold+ manualScoreStateApScorePage(29 lines)home_page.dartHomePageScaffold+HomeStateenum.fromDataState()+DataState<List<Announcement>>setting_page.dartShareDataWidget.of(context)ApApp.of(context)share_data_widget.dartMotivation
The example app serves as the primary reference for downstream apps (NKUST, NSYSU, WTUC). Having the standard example use old patterns while
simple_example/uses new patterns creates confusion. After this migration, both examples demonstrate the recommended approach.Checklist
melos run analyze— 0 issuesmelos run test— 32 tests passed