import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_livestock/presentation/page/map/view.dart';
import 'package:rasadyar_livestock/presentation/page/profile/view.dart';
import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart';
import 'package:rasadyar_livestock/presentation/page/requests/view.dart';
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';

class RootLogic extends GetxController {
  List<Widget> pages = [
    Navigator(
      key: Get.nestedKey(0),
      initialRoute: LiveStockRoutes.requests,
      onGenerateRoute: (settings) {
        switch (settings.name) {
          case LiveStockRoutes.requests:
            return GetPageRoute(page: () => RequestsPage());
          case LiveStockRoutes.requestTagging:
            return GetPageRoute(page: () => RequestTaggingPage());
          default:
            return GetPageRoute(page: () => RequestsPage());
        }
      },
    ),
    MapPage(),
    ProfilePage(),
  ];
  RxInt currentIndex = 1.obs;

  @override
  void onReady() {
    // TODO: implement onReady
    super.onReady();
  }

  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
  }

  void changePage(int i) => currentIndex.value = i;
}
