diff --git a/lib/infrastructure/service/auth_service.dart b/lib/infrastructure/service/auth_service.dart index 9a4a12f..6ad04fa 100644 --- a/lib/infrastructure/service/auth_service.dart +++ b/lib/infrastructure/service/auth_service.dart @@ -25,7 +25,7 @@ class AuthService extends GetxService { everAll([accessRes, refAccessRes], (_) { if (accessRes.value && refAccessRes.value) { var targetPage = getTargetPage(tokenService.appModule.value); - Get.offAndToNamed(targetPage); + Get.offAllNamed(targetPage); } }); } diff --git a/lib/presentation/routes/app_pages.dart b/lib/presentation/routes/app_pages.dart index 8e5f373..2800452 100644 --- a/lib/presentation/routes/app_pages.dart +++ b/lib/presentation/routes/app_pages.dart @@ -4,6 +4,8 @@ import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart import 'package:rasadyar_auth/auth.dart'; import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart'; import 'package:rasadyar_auth/presentation/routes/pages.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/presentation/routes/pages.dart'; import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_inspection/inspection.dart'; import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; @@ -27,6 +29,7 @@ sealed class AppPages { ...InspectionPages.pages, ...AuthPages.pages, ...LiveStockPages.pages, + ...ChickenPages.pages, ]; } @@ -37,7 +40,9 @@ String getTargetPage(Module? value) { return InspectionRoutes.inspection; case Module.liveStocks: return LiveStockRoutes.init; + case Module.chicken: + return ChickenRoutes.init; default: - return InspectionRoutes.inspection; + return ChickenRoutes.init; } -} \ No newline at end of file +} diff --git a/lib/res/assets_res.dart b/lib/res/assets_res.dart new file mode 100644 index 0000000..3ed9350 --- /dev/null +++ b/lib/res/assets_res.dart @@ -0,0 +1,11 @@ +// Generated file. Do not edit. +// This file is generated by the iFlutter + +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars +class AssetsRes { + AssetsRes._(); + + static const String PROJECT_NAME = 'rasadyar_app'; + static const String PROJECT_VERSION = '1.2.0+2'; +} diff --git a/lib/res/font_res.dart b/lib/res/font_res.dart new file mode 100644 index 0000000..38a512e --- /dev/null +++ b/lib/res/font_res.dart @@ -0,0 +1,12 @@ +// Generated file. Do not edit. +// This file is generated by the iFlutter + +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars +class FontRes { + FontRes._(); + + static const String PROJECT_NAME = 'rasadyar_app'; + static const String PROJECT_VERSION = '1.2.0+2'; + static const String IRANYEKANREGULARFANUM = 'iranyekanregularfanum'; +} diff --git a/packages/chicken/.gitignore b/packages/chicken/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/packages/chicken/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/chicken/CHANGELOG.md b/packages/chicken/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/packages/chicken/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/packages/chicken/README.md b/packages/chicken/README.md new file mode 100644 index 0000000..8831761 --- /dev/null +++ b/packages/chicken/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/chicken/analysis_options.yaml b/packages/chicken/analysis_options.yaml new file mode 100644 index 0000000..dee8927 --- /dev/null +++ b/packages/chicken/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/packages/chicken/lib/chicken.dart b/packages/chicken/lib/chicken.dart new file mode 100644 index 0000000..7f7bfe9 --- /dev/null +++ b/packages/chicken/lib/chicken.dart @@ -0,0 +1,9 @@ +/// Support for doing something awesome. +/// +/// More dartdocs go here. +library; + +export 'presentation/routes/pages.dart'; +export 'presentation/routes/routes.dart'; +export 'presentation/pages/root/view.dart'; +export 'presentation/pages/root/logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/root/logic.dart b/packages/chicken/lib/presentation/pages/root/logic.dart new file mode 100644 index 0000000..638a409 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/root/logic.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + + +enum ErrorLocationType { serviceDisabled, permissionDenied, none } + +class RootLogic extends GetxController { + RxInt currentIndex = 0.obs; + List pages = [ + Container(color: Colors.deepOrange,), + Container(color: Colors.amberAccent,), + Container(color: Colors.black,), + ]; + RxList errorLocationType = RxList(); + + + + @override + void onReady() { + super.onReady(); + + } + + void changePage(int index) { + currentIndex.value = index; + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/packages/chicken/lib/presentation/pages/root/view.dart b/packages/chicken/lib/presentation/pages/root/view.dart new file mode 100644 index 0000000..071cdfa --- /dev/null +++ b/packages/chicken/lib/presentation/pages/root/view.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class RootPage extends GetView { + const RootPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + ObxValue( + (currentIndex) => IndexedStack( + index: currentIndex.value, + children: controller.pages, + ), + controller.currentIndex, + ), + + ], + ), + bottomNavigationBar: WaveBottomNavigation( + items: [ + WaveBottomNavigationItem(title: 'خانه', icon: Assets.vec.mapSvg.svg( + width: 32, + height: 32, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + )), + WaveBottomNavigationItem( + title: 'عملیات', + icon: Assets.vec.userSvg.svg( + width: 32, + height: 32, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + ), + WaveBottomNavigationItem( + title: 'افزودن', + icon: Assets.vec.addSvg.svg( + width: 32, + height: 32, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + ), + WaveBottomNavigationItem( + title: 'آمار', + icon: Assets.vec.diagramSvg.svg(width: 32,height: 32,colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),), + ), + WaveBottomNavigationItem( + title: 'تماس', + icon: Assets.vec.callSvg.svg( + width: 32, + height: 32, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + ), + WaveBottomNavigationItem( + title: 'مکان ', + icon: Assets.vec.gpsSvg.svg( + width: 32, + height: 32, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + ), + WaveBottomNavigationItem( + title: 'تاریخ', + icon: Assets.vec.calendarSvg.svg( + width: 32, + height: 32, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + ), + ], + onPageChanged: (index) { + controller.changePage(index); + }, + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/routes/pages.dart b/packages/chicken/lib/presentation/routes/pages.dart new file mode 100644 index 0000000..b9676b9 --- /dev/null +++ b/packages/chicken/lib/presentation/routes/pages.dart @@ -0,0 +1,23 @@ + +import 'package:chicken/presentation/pages/root/view.dart'; +import 'package:chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_auth/auth.dart'; +import 'package:rasadyar_core/core.dart'; + + +sealed class ChickenPages { + ChickenPages._(); + + static final pages = [ + GetPage( + name: ChickenRoutes.init, + page: () => RootPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + + }), + ), + + + ]; +} diff --git a/packages/chicken/lib/presentation/routes/routes.dart b/packages/chicken/lib/presentation/routes/routes.dart new file mode 100644 index 0000000..9fe67b5 --- /dev/null +++ b/packages/chicken/lib/presentation/routes/routes.dart @@ -0,0 +1,6 @@ +sealed class ChickenRoutes { + ChickenRoutes._(); + + static const init = '/chicken/init'; + +} diff --git a/packages/chicken/lib/presentation/widget/cluster_marker.dart b/packages/chicken/lib/presentation/widget/cluster_marker.dart new file mode 100644 index 0000000..4c8d82a --- /dev/null +++ b/packages/chicken/lib/presentation/widget/cluster_marker.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; + +class AnimatedClusterMarker extends StatefulWidget { + final int count; + + const AnimatedClusterMarker({super.key, required this.count}); + + @override + State createState() => _AnimatedClusterMarkerState(); +} + +class _AnimatedClusterMarkerState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; + + @override + void initState() { + super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 300), + )..forward(); // start animation + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ScaleTransition( + scale: CurvedAnimation(parent: _controller, curve: Curves.easeOutBack), + child: Opacity( + opacity: _controller.value, + child: Container( + width: 40, + height: 40, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.blueAccent, + shape: BoxShape.circle, + border: Border.all(color: Colors.white, width: 2), + ), + child: Text( + widget.count.toString(), + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ); + } +} diff --git a/packages/chicken/pubspec.yaml b/packages/chicken/pubspec.yaml new file mode 100644 index 0000000..17cc275 --- /dev/null +++ b/packages/chicken/pubspec.yaml @@ -0,0 +1,34 @@ +name: rasadyar_chicken +description: A starting point for Dart libraries or applications. +version: 1.0.0 +# repository: https://github.com/my_org/my_repo + +environment: + sdk: ^3.8.1 + + +dependencies: + flutter: + sdk: flutter + rasadyar_core: + path: ../core + rasadyar_auth: + path: ../auth + ##code generation + freezed_annotation: ^3.0.0 + json_annotation: ^4.9.0 +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + lints: ^5.0.0 + test: ^1.24.0 + ##code generation + build_runner: ^2.4.15 + hive_ce_generator: ^1.9.1 + freezed: ^3.0.6 + json_serializable: ^6.9.4 + + ##test + mocktail: ^1.0.4 + get_test: ^4.0.1 diff --git a/packages/chicken/test/chicken_test.dart b/packages/chicken/test/chicken_test.dart new file mode 100644 index 0000000..a8c331b --- /dev/null +++ b/packages/chicken/test/chicken_test.dart @@ -0,0 +1,16 @@ +import 'package:chicken/chicken.dart'; +import 'package:test/test.dart'; + +void main() { + group('A group of tests', () { + final awesome = Awesome(); + + setUp(() { + // Additional setup goes here. + }); + + test('First Test', () { + expect(awesome.isAwesome, isTrue); + }); + }); +} diff --git a/pubspec.lock b/pubspec.lock index 1b4461c..cddd973 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -980,6 +980,13 @@ packages: relative: true source: path version: "0.0.1" + rasadyar_chicken: + dependency: "direct main" + description: + path: "packages/chicken" + relative: true + source: path + version: "1.0.0" rasadyar_core: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 189dc00..69a73b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,6 +27,10 @@ dependencies: rasadyar_livestock: path: ./packages/livestock + rasadyar_chicken: + path: ./packages/chicken + + ##code generation