develop #1
|
@ -3,6 +3,15 @@ import 'package:get/get.dart';
|
|||
class NavigationController extends GetxController {
|
||||
RxInt selectedIndex = 0.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
final args = Get.arguments;
|
||||
if (args != null && args is int) {
|
||||
selectedIndex.value = args;
|
||||
}
|
||||
}
|
||||
|
||||
void changePage(int page) {
|
||||
selectedIndex.value = page;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class QuizPreviewController extends GetxController {
|
|||
|
||||
if (success) {
|
||||
Get.snackbar('Sukses', 'Kuis berhasil disimpan!');
|
||||
Get.offAllNamed(AppRoutes.mainPage);
|
||||
Get.offAllNamed(AppRoutes.mainPage, arguments: 2);
|
||||
}
|
||||
} catch (e) {
|
||||
logC.e(e);
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:quiz_app/app/app.dart';
|
||||
import 'package:quiz_app/core/utils/logger.dart';
|
||||
|
||||
void main() {
|
||||
runZonedGuarded(() {
|
||||
runZonedGuarded(() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
runApp(MyApp());
|
||||
}, (e, stackTrace) {
|
||||
logC.e("issue message $e || $stackTrace");
|
||||
|
|
Loading…
Reference in New Issue