Skip to content

Commit

Permalink
修复白屏
Browse files Browse the repository at this point in the history
  • Loading branch information
nano71 committed Jan 23, 2024
1 parent da138dd commit cdf43ab
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdk.dir=C:\\sdk\\android-sdk
flutter.sdk=C:\\sdk\\flutter
flutter.buildMode=debug
flutter.versionName=1.6.231029
flutter.versionCode=52
flutter.buildMode=release
flutter.versionName=1.6.240123
flutter.versionCode=60
8 changes: 4 additions & 4 deletions lib/common/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ initTodaySchedule() async {
print('当前日期:$year 年 $month 月 $day 日');
final String _week = AppData.persistentData["week"].toString();
Map _schedule = Map.from(AppData.schedule);
Map weekOfSemester = _schedule[_week];
Map dayOfWeek = weekOfSemester[DateTime.now().weekday.toString()];

List<List> toDay = [];
if (int.parse(_week) < 21)
if (int.parse(_week) < 21) {
Map weekOfSemester = _schedule[_week];
Map dayOfWeek = weekOfSemester[DateTime.now().weekday.toString()];
dayOfWeek.forEach((key, value) {
if (value is List) if (value[1] != "null") {
if (value.length < 5) {
Expand All @@ -44,6 +43,7 @@ initTodaySchedule() async {
toDay.add(value);
}
});
}

if (toDay.isNotEmpty) {
todayScheduleTitle = "今天的";
Expand Down
5 changes: 1 addition & 4 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
child: Align(alignment: Alignment.centerLeft, child: Text(tomorrowScheduleTitle, style: tomorrowAndTodayTextStyle())),
)),
TomorrowCourseList(),
NeedLogin(),
!isLogin() ? NeedLogin() : SliverToBoxAdapter(child: Center()),
],
),
);
Expand All @@ -457,9 +457,6 @@ class NeedLogin extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (isLogin()) {
return SliverToBoxAdapter(child: Center());
}
return SliverToBoxAdapter(
child: Center(
child: TextButton(
Expand Down
8 changes: 4 additions & 4 deletions lib/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ class LoginPageState extends State<LoginPage> {
AppData.persistentData["username"] = _studentId;
AppData.persistentData["password"] = _password;
await getName();
await getSchedule();
await writeConfig();
await initTodaySchedule();
await initTomorrowSchedule();
getSchedule();
writeConfig();
initTodaySchedule();
initTomorrowSchedule();
print("initSchedule End");
eventBus.fire(SetPageIndex());
Navigator.pushAndRemoveUntil(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class _SettingPageState extends State<SettingPage> with WidgetsBindingObserver {
Row(
children: [
Icon(
FlutterRemix.apps_2_line,
FlutterRemix.timer_2_line,
color: readColor(),
),
Container(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "https://pub.flutter-io.cn" # Remove this line if you wish to publis
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.6.231103+53
version: 1.6.240123+60

environment:
sdk: ">=2.14.0 <4.0.0"
Expand Down

0 comments on commit cdf43ab

Please sign in to comment.