From 7f72f2c70d3479aa88ca68ea47d62ba475020937 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Mon, 19 May 2025 16:17:01 +0330 Subject: [PATCH] feat : live stock module --- .../lib/presentation/action/logic.dart | 16 ++++++------ .../lib/presentation/routes/app_pages.dart | 25 +++++++++++++++++++ .../lib/presentation/routes/app_routes.dart | 9 +++++++ packages/livestock/pubspec.yaml | 10 ++++---- packages/livestock/test/livestock_test.dart | 3 +-- pubspec.yaml | 16 ++++++++++++ 6 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 packages/livestock/lib/presentation/routes/app_pages.dart create mode 100644 packages/livestock/lib/presentation/routes/app_routes.dart diff --git a/packages/inspection/lib/presentation/action/logic.dart b/packages/inspection/lib/presentation/action/logic.dart index 14cf098..6692de2 100644 --- a/packages/inspection/lib/presentation/action/logic.dart +++ b/packages/inspection/lib/presentation/action/logic.dart @@ -1,6 +1,6 @@ +import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; - class ActionLogic extends GetxController with GetTickerProviderStateMixin { late Rx slidController; bool showSlideHint = true; @@ -15,11 +15,11 @@ class ActionLogic extends GetxController with GetTickerProviderStateMixin { 'خروج از سامانه', ]; - List headersIcons = [ - Assets.vecProfileUserSvg, - Assets.vecCalendarSearchSvg, - Assets.vecDiagramSvg, - Assets.vecLogoutSvg, + List headersIcons = [ + Assets.vec.profileUserSvg.svg(), + Assets.vec.calendarSearchSvg.svg(), + Assets.vec.diagramSvg.svg(), + Assets.vec.logoutSvg.svg(), ]; RxList supervisionHistoryList = [false, false, false, false].obs; @@ -46,7 +46,6 @@ class ActionLogic extends GetxController with GetTickerProviderStateMixin { void onInit() { super.onInit(); slidController = SlidableController(this).obs; - } @override @@ -69,9 +68,8 @@ class ActionLogic extends GetxController with GetTickerProviderStateMixin { showSlideHint = !showSlideHint; } - void updateSelectedIndex(int index) { - if(index == selectedIndex.value) { + if (index == selectedIndex.value) { return; } previousIndex.value = selectedIndex.value; diff --git a/packages/livestock/lib/presentation/routes/app_pages.dart b/packages/livestock/lib/presentation/routes/app_pages.dart new file mode 100644 index 0000000..c699577 --- /dev/null +++ b/packages/livestock/lib/presentation/routes/app_pages.dart @@ -0,0 +1,25 @@ + +import 'package:rasadyar_auth/auth.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_livestock/presentation/page/root/view.dart'; + + +part'app_routes.dart'; + +sealed class LiveStockPages { + LiveStockPages._(); + + static final pages = [ + GetPage( + name: LiveStockRoutes.init, + page: () => RootPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + + }), + ), + + + ]; +} + diff --git a/packages/livestock/lib/presentation/routes/app_routes.dart b/packages/livestock/lib/presentation/routes/app_routes.dart new file mode 100644 index 0000000..b563e83 --- /dev/null +++ b/packages/livestock/lib/presentation/routes/app_routes.dart @@ -0,0 +1,9 @@ + +part of 'app_pages.dart'; + +sealed class LiveStockRoutes { + LiveStockRoutes._(); + + static const init = '/liveStockRoutesInit'; + +} diff --git a/packages/livestock/pubspec.yaml b/packages/livestock/pubspec.yaml index 09d7557..9f8ba58 100644 --- a/packages/livestock/pubspec.yaml +++ b/packages/livestock/pubspec.yaml @@ -1,4 +1,4 @@ -name: livestock +name: rasadyar_livestock description: A starting point for Dart libraries or applications. version: 1.0.0 publish_to: 'none' @@ -9,9 +9,12 @@ environment: dependencies: - + flutter: + sdk: flutter rasadyar_core: path: ../core + rasadyar_auth: + path: ../auth ##code generation freezed_annotation: ^3.0.0 json_annotation: ^4.9.0 @@ -31,7 +34,4 @@ dev_dependencies: mocktail: ^1.0.4 get_test: ^4.0.1 -flutter: - uses-material-design: true - diff --git a/packages/livestock/test/livestock_test.dart b/packages/livestock/test/livestock_test.dart index dbd1d90..534cb37 100644 --- a/packages/livestock/test/livestock_test.dart +++ b/packages/livestock/test/livestock_test.dart @@ -1,5 +1,4 @@ -import 'package:livestock/livestock.dart'; -import 'package:test/test.dart'; + void main() { diff --git a/pubspec.yaml b/pubspec.yaml index 95fc0f1..b8726e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,6 +24,9 @@ dependencies: rasadyar_auth: path: ./packages/auth + rasadyar_livestock: + path: ./packages/livestock + ##code generation @@ -38,6 +41,7 @@ dev_dependencies: hive_ce_generator: ^1.9.1 freezed: ^3.0.6 json_serializable: ^6.9.4 + flutter_gen_runner: ^5.10.0 ##test mocktail: ^1.0.4 @@ -56,7 +60,19 @@ flutter: - assets/logos/ - assets/vec/ + fonts: - family: yekan fonts: - asset: fonts/iranyekanregularfanum.ttf + + +flutter_gen: + output: packages/core/lib/presentation/common + line_length: 120 + # Optional + integrations: + image: true + flutter_svg: true + rive: false + lottie: false