Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
refactor(home): simplify home logic
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Oct 24, 2021
1 parent 2d14979 commit 0c6ff0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions lib/home/home_logic.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../dev/dev_view.dart';
import '../timetable/timetable_menu/timetable_menu_view.dart';
import '../utils/database.dart';
import '../utils/log.dart';
Expand Down Expand Up @@ -53,8 +52,6 @@ class HomeLogic extends GetxController with L {

final railExtended = false.obs;

void ecnuLongPress() => Get.to(() => DevPage());

void ecnuOnPressed() => railExtended.toggle();
}

Expand Down
3 changes: 2 additions & 1 deletion lib/home/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';

import '../dev/dev_view.dart';
import '../settings/settings_view.dart';
import '../timetable/timetable_menu/timetable_menu_view.dart';
import '../timetable/timetable_view.dart';
Expand Down Expand Up @@ -126,7 +127,7 @@ class HomePage extends StatelessWidget {
color: color,
onPressed: onPressed ?? () {},
),
onLongPress: logic.ecnuLongPress,
onLongPress: () => Get.to(() => DevPage()),
);
}

Expand Down

0 comments on commit 0c6ff0f

Please sign in to comment.