feat: new pages and with binding ...
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
class ActionLogic extends GetxController {
|
||||||
|
|
||||||
|
}
|
||||||
12
packages/livestock/lib/presentation/page/action/view.dart
Normal file
12
packages/livestock/lib/presentation/page/action/view.dart
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class ActionPage extends GetView<ActionLogic> {
|
||||||
|
ActionPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
5
packages/livestock/lib/presentation/page/map/logic.dart
Normal file
5
packages/livestock/lib/presentation/page/map/logic.dart
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
class MapLogic extends GetxController {
|
||||||
|
|
||||||
|
}
|
||||||
14
packages/livestock/lib/presentation/page/map/view.dart
Normal file
14
packages/livestock/lib/presentation/page/map/view.dart
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class MapPage extends GetView<MapLogic> {
|
||||||
|
MapPage({super.key});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
class ProfileLogic extends GetxController {
|
||||||
|
|
||||||
|
}
|
||||||
13
packages/livestock/lib/presentation/page/profile/view.dart
Normal file
13
packages/livestock/lib/presentation/page/profile/view.dart
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class ProfilePage extends GetView<ProfileLogic> {
|
||||||
|
ProfilePage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/action/view.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/map/view.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/profile/view.dart';
|
||||||
|
|
||||||
class RootLogic extends GetxController {
|
class RootLogic extends GetxController {
|
||||||
|
List<Widget> pages = [ActionPage(), MapPage(), ProfilePage()];
|
||||||
|
RxInt indexedPage = 1.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
@@ -7,6 +7,14 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container();
|
return Scaffold(
|
||||||
|
body: ObxValue((data) {
|
||||||
|
return IndexedStack(
|
||||||
|
children: controller.pages,
|
||||||
|
index: data.value,
|
||||||
|
sizing: StackFit.expand,
|
||||||
|
);
|
||||||
|
}, controller.indexedPage),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
import 'package:rasadyar_auth/auth.dart';
|
import 'package:rasadyar_auth/auth.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/action/logic.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/map/logic.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/profile/logic.dart';
|
||||||
|
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/page/root/view.dart';
|
import 'package:rasadyar_livestock/presentation/page/root/view.dart';
|
||||||
|
part 'app_routes.dart';
|
||||||
|
|
||||||
part'app_routes.dart';
|
|
||||||
|
|
||||||
sealed class LiveStockPages {
|
sealed class LiveStockPages {
|
||||||
LiveStockPages._();
|
LiveStockPages._();
|
||||||
@@ -15,11 +16,12 @@ sealed class LiveStockPages {
|
|||||||
page: () => RootPage(),
|
page: () => RootPage(),
|
||||||
middlewares: [AuthMiddleware()],
|
middlewares: [AuthMiddleware()],
|
||||||
binding: BindingsBuilder(() {
|
binding: BindingsBuilder(() {
|
||||||
|
Get.put(RootLogic());
|
||||||
|
BindingsBuilder.put(() => RootLogic());
|
||||||
|
Get.lazyPut(() => ActionLogic());
|
||||||
|
Get.lazyPut(() => MapLogic());
|
||||||
|
Get.lazyPut(() => ProfileLogic());
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
|
||||||
part of 'app_pages.dart';
|
part of 'app_pages.dart';
|
||||||
|
|
||||||
sealed class LiveStockRoutes {
|
sealed class LiveStockRoutes {
|
||||||
LiveStockRoutes._();
|
LiveStockRoutes._();
|
||||||
|
|
||||||
static const init = '/liveStockRoutesInit';
|
static const init = '/liveStock';
|
||||||
|
static const action = '$init/liveStock';
|
||||||
|
static const map = '$init/liveStock';
|
||||||
|
static const profile = '$init/profile';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user