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

Commit

Permalink
feat: secret
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Oct 3, 2021
1 parent a323e12 commit bb11320
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/home/home_logic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_settings_screens/flutter_settings_screens.dart';
import 'package:get/get.dart';

import '../utils/gu.dart';
import '../secret/secret_view.dart';
import '../utils/logger.dart';

class HomeLogic extends GetxController {
Expand Down Expand Up @@ -46,7 +46,7 @@ class HomeLogic extends GetxController {
if (isAnimating.isFalse) idx.value = idx_;
}

void ecnuLongPress() => gu(); // todo
void ecnuLongPress() => Get.to(SecretPage());
}

// NavigationRail: Timetable, Toolbox, Settings
Expand Down
7 changes: 7 additions & 0 deletions lib/secret/secret_logic.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:get/get.dart';

import 'trivia_view.dart';

class SecretLogic extends GetxController {
void triviaOnTap() => Get.to(const TriviaPage());
}
25 changes: 25 additions & 0 deletions lib/secret/secret_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'secret_logic.dart';

class SecretPage extends StatelessWidget {
SecretPage({Key? key}) : super(key: key);

final logic = Get.put(SecretLogic());

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: ListView(
children: [
ListTile(
title: const Text('Trivia'),
onTap: logic.triviaOnTap,
)
],
),
);
}
}
15 changes: 15 additions & 0 deletions lib/secret/trivia_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

import '../settings/trivia.dart';

class TriviaPage extends StatelessWidget {
const TriviaPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: ListView.builder(itemBuilder: (_, idx) => getTrivia(idx)),
);
}
}

0 comments on commit bb11320

Please sign in to comment.