From 503dcd91b802fc41a788ec789badcfc92fb9acb6 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sat, 12 Apr 2025 18:07:36 +0330 Subject: [PATCH] feat: 1-fake location 2-bottom navigation 3-bottom sheet 4-lazy map loading --- .mason/bricks.json | 1 + assets/icons/filter.svg | 10 +- assets/icons/map.svg | 6 + assets/icons/profile_circle.svg | 4 + assets/icons/setting.svg | 3 + assets/icons/user.svg | 1 - assets/vec/filter.svg.vec | Bin 1063 -> 495 bytes assets/vec/map.svg.vec | Bin 0 -> 817 bytes assets/vec/map_marker.svg.vec | Bin 0 -> 509 bytes assets/vec/profile_circle.svg.vec | Bin 0 -> 1347 bytes assets/vec/setting.svg.vec | Bin 0 -> 704 bytes .../lib/presentation/filter/logic.dart | 96 ++ .../lib/presentation/filter/view.dart | 174 ++++ .../lib/presentation/root/logic.dart | 28 + .../lib/presentation/root/view.dart | 62 ++ .../lib/presentation/routes/app_pages.dart | 10 +- features/supervision/pubspec.lock | 612 ++++++++++++ flutter_ddd_module/CHANGELOG.md | 3 - flutter_ddd_module/HELLO.md | 1 - flutter_ddd_module/LICENSE | 1 - flutter_ddd_module/README.md | 27 - flutter_ddd_module/__brick__/HELLO.md | 1 - .../__brick__/lib/data/.gitkeep | 0 .../lib/presentation/routes/app_pages.dart | 0 .../lib/presentation/routes/app_paths.dart | 0 flutter_ddd_module/__brick__/pubspec.yaml | 20 - flutter_ddd_module/brick.yaml | 33 - flutter_ddd_module/pubspec.yaml | 20 - lib/presentation/common/assets.dart | 8 +- packages/core/lib/core.dart | 9 +- .../lib/presentation/common/app_color.dart | 368 ++++++++ .../lib/presentation/common/app_fonts.dart | 169 ++++ .../core/lib/presentation/common/assets.dart | 36 + .../core/lib/presentation/common/common.dart | 3 + .../lib/presentation/utils/color_utils.dart | 24 + .../core/lib/presentation/utils/utils.dart | 1 + .../bottom_navigation_1.dart | 81 ++ .../presentation/widget/buttons/elevated.dart | 56 ++ .../lib/presentation/widget/buttons/fab.dart | 232 +++++ .../widget/buttons/fab_outlined.dart | 605 ++++++++++++ .../widget/buttons/outline_elevated.dart | 101 ++ .../widget/buttons/text_button.dart | 77 ++ .../widget/captcha/captcha_widget.dart | 266 ++++++ .../presentation/widget/inputs/r_input.dart | 216 +++++ .../pagination/pagination_from_until.dart | 255 +++++ .../widget/pagination/show_more.dart | 78 ++ .../lib/presentation/widget/tabs/new_tab.dart | 784 +++++++++++++++ .../lib/presentation/widget/tabs/tab.dart | 115 +++ .../lib/presentation/widget/vec_widget.dart | 66 ++ .../core/lib/presentation/widget/widget.dart | 2 + packages/core/pubspec.lock | 890 ++++++++++++++++++ packages/core/pubspec.yaml | 1 - 52 files changed, 5435 insertions(+), 121 deletions(-) create mode 100644 .mason/bricks.json create mode 100644 assets/icons/map.svg create mode 100644 assets/icons/profile_circle.svg create mode 100644 assets/icons/setting.svg delete mode 100644 assets/icons/user.svg create mode 100644 assets/vec/map.svg.vec create mode 100644 assets/vec/map_marker.svg.vec create mode 100644 assets/vec/profile_circle.svg.vec create mode 100644 assets/vec/setting.svg.vec create mode 100644 features/supervision/lib/presentation/filter/logic.dart create mode 100644 features/supervision/lib/presentation/filter/view.dart create mode 100644 features/supervision/lib/presentation/root/logic.dart create mode 100644 features/supervision/lib/presentation/root/view.dart create mode 100644 features/supervision/pubspec.lock delete mode 100644 flutter_ddd_module/CHANGELOG.md delete mode 100644 flutter_ddd_module/HELLO.md delete mode 100644 flutter_ddd_module/LICENSE delete mode 100644 flutter_ddd_module/README.md delete mode 100644 flutter_ddd_module/__brick__/HELLO.md delete mode 100644 flutter_ddd_module/__brick__/lib/data/.gitkeep delete mode 100644 flutter_ddd_module/__brick__/lib/presentation/routes/app_pages.dart delete mode 100644 flutter_ddd_module/__brick__/lib/presentation/routes/app_paths.dart delete mode 100644 flutter_ddd_module/__brick__/pubspec.yaml delete mode 100644 flutter_ddd_module/brick.yaml delete mode 100644 flutter_ddd_module/pubspec.yaml create mode 100644 packages/core/lib/presentation/common/app_color.dart create mode 100644 packages/core/lib/presentation/common/app_fonts.dart create mode 100644 packages/core/lib/presentation/common/assets.dart create mode 100644 packages/core/lib/presentation/common/common.dart create mode 100644 packages/core/lib/presentation/utils/color_utils.dart create mode 100644 packages/core/lib/presentation/utils/utils.dart create mode 100644 packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart create mode 100644 packages/core/lib/presentation/widget/buttons/elevated.dart create mode 100644 packages/core/lib/presentation/widget/buttons/fab.dart create mode 100644 packages/core/lib/presentation/widget/buttons/fab_outlined.dart create mode 100644 packages/core/lib/presentation/widget/buttons/outline_elevated.dart create mode 100644 packages/core/lib/presentation/widget/buttons/text_button.dart create mode 100644 packages/core/lib/presentation/widget/captcha/captcha_widget.dart create mode 100644 packages/core/lib/presentation/widget/inputs/r_input.dart create mode 100644 packages/core/lib/presentation/widget/pagination/pagination_from_until.dart create mode 100644 packages/core/lib/presentation/widget/pagination/show_more.dart create mode 100644 packages/core/lib/presentation/widget/tabs/new_tab.dart create mode 100644 packages/core/lib/presentation/widget/tabs/tab.dart create mode 100644 packages/core/lib/presentation/widget/vec_widget.dart create mode 100644 packages/core/lib/presentation/widget/widget.dart create mode 100644 packages/core/pubspec.lock diff --git a/.mason/bricks.json b/.mason/bricks.json new file mode 100644 index 0000000..2645872 --- /dev/null +++ b/.mason/bricks.json @@ -0,0 +1 @@ +{"flutter_ddd_module":"D:/fl_project/rasadyar_app/flutter_ddd_module"} \ No newline at end of file diff --git a/assets/icons/filter.svg b/assets/icons/filter.svg index 52500e7..25636f2 100644 --- a/assets/icons/filter.svg +++ b/assets/icons/filter.svg @@ -1,8 +1,4 @@ - - - - - - - + + + diff --git a/assets/icons/map.svg b/assets/icons/map.svg new file mode 100644 index 0000000..1d3b6f5 --- /dev/null +++ b/assets/icons/map.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/profile_circle.svg b/assets/icons/profile_circle.svg new file mode 100644 index 0000000..0b32445 --- /dev/null +++ b/assets/icons/profile_circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/setting.svg b/assets/icons/setting.svg new file mode 100644 index 0000000..622cf10 --- /dev/null +++ b/assets/icons/setting.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/user.svg b/assets/icons/user.svg deleted file mode 100644 index fbe07ed..0000000 --- a/assets/icons/user.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/vec/filter.svg.vec b/assets/vec/filter.svg.vec index 6c190a39e80c61de99b27f3d6782a329436382ed..6d6d5baa995290253224fbfae417399f51174cad 100644 GIT binary patch literal 495 zcmY+=KS%;m90%~vQAd+E@-;d9>~Ki+%4m!8UlG667V0E`=>4lNge;{+4{ zAJ9_N|DTH*X>FMU^bap?X)Bu4xxirOB~q7g#BChF;BPZ}B;7 zbPiB0B7$b)VRROox5wzp&7&SF<2t0!<{YOhXDcTbQ4JfoxX=0M{4!-96G*6x!#7t%ze-^u}#Wyfj zePI!EnesK6=oym&d@)g{dy!qzVoS;}-P5A|H>GW@Af3tW<432;`sas(;x>*GR3yJy Cg_+U- literal 1063 zcmbW%OH30%7zgkvB&O7Z25Nj@T1jeg!6%E)*zEidw)KP{CZ-f425OAaz{Lj`F92QgL8uL|rX>`IgdIg6&y(o(IQosFBykV5bD-pG{Nf`@B zRrR1W;wnSB`3UYLiYY!p`2|Qbb)e3ij*{3#jCUFli1)&+PI6&?a75}>Yo+6s<-9S` zj;zOhS|Hve?PqJH_Pgs)phmR4r&N?b9?%-B>+$vNP0e;=3*M)VYJ)Xf5lk3)Q*smZ z5-Z=iXFbmPHt>wGCTX58G#j^~#o?j$RvJgG^p0ypI#+qaD}pUJYfe%ez*IHEHrFAV zuY)Y3`ncdp?56s7q+;G87IhH1$3i$(T}*jxXx0nh^|vECwi)I~7}sgsp|@Me~|KX==vpI6t%;7qKhl46}9!3xj(oV z@2aA_TbqZ5#t<(u>HJ(pBQG8M%x4~*;?~jE(gp0Pw8mF2U8Z;`?>ravo_W+Kov$pG z_3r7i!5Mt1v1@jGD88*Z7v>kePsoX$NRKTb!+f_sP&)k>%Z1>i?O|%lQP}!9BT59!X1<6*t z^w7{I;6>3kDMG=5HUR~jgT+KW^-z*i!5oC1{8uFFn~8CD;WzW%yzhO??u?%^nRJ@5 zUS#YP9=B*Hj9HdjVyu2|n(;ydyVL>$ne_gvtj05MV#FU^LF5Xay38aDtf?cyV z?B0GASa+&uHykjORdH{i1L{!~^J+KIK|BF@^(f7qC`UEe3u@SRryYitHL7Wab*Dxe z&jMYu?P!a{NV`tjv4E$tE4YQDg3(nORz|)Dc>gVoi2hAKzXzt_&+1F~VB8l>d6SR| zuF?82q`WV{Q(2~Y8u~x3z-{Xx#h${g%{YwrJ%OJy9;$f+lbdefI-CpYRl#EK8IgZp zKS_*(p6nF$XAQ5=8(Rts{bKzFX|2K7k|Fvx{kSEW+4#Znv!qAqtLW1d zq5~&F3eLssD3v61SKBZXdkb><3&^9gy=?C~&2lZ+6bu*>mtMQfp`>JJKq%lf0F4U{Lf@Sj?3^NV& z{R8?}jtH-E!A{;=$Y&dd&$p20!{l8-dImh@nfN3TMhS$?p{(pV(`hOr33L5Mg)EOC8 zd~0^zrJ3w3{xi)vM7YBlB)>PQ>^~4Qps3YgVlbC%bY9`M-6@RkmlH@b-2MN5bDhH!KGHe8BDV*YX*z=3rzy6lLnd$F@cc@ zVgdsLOl|?xtf(V#&MU;4oLQzdI*V&II7ehobQV%Bh11eNH?e^%X95CdDG&?J{ZUDaC^Tj2h;AbG9)q9=q9zfPf;J-}q6=47Ui5?Cx!z<(fXJ6+)4hhAW|A9>xVcL(uqyyrIbxY3_m^19Ol zI|083@6ZtMp+fv7;yj4I0iFkWuOWXK;;({NhWuB+E5o}CY<9*`Px&uFkMj32Cc|eL zefcQ+lc6q-^JOEP=S(odd27s4BD^dS+9?v6Sa4PYZe8g7Nw2mzj!#^PtmA`!o;gmVoC% zo)YSKS&BFlJ+HOl`R1bFnBA)<6DJ zOjXKI=e(T4H)?G?&M3q#Ifz+MIE@)p_!G11_a6iH%e@V~GF3kyGYJFz8_u)c(`jHP zZJ^(Of$v)n8`#rrU?%Z5c3-}Qx$T$f>?5ut#PILB!>psHJMmkWp|hr3Y1Z{}^=GH+ FzW}|zA$9-& literal 0 HcmV?d00001 diff --git a/assets/vec/setting.svg.vec b/assets/vec/setting.svg.vec new file mode 100644 index 0000000000000000000000000000000000000000..5b88635dc5de8d4ea03c48bd0308675a89d146b1 GIT binary patch literal 704 zcmY+C!A}!W5XN7(sZk-?)&wCK1C22;U>58C0dF4M;9w$q@<6h+lpeis^PmY~tzJA( zmSVz%OW{BoLYlPn28Rulo;aYEtI?45KrooLK4+$KU^koJ&YPKUzI|_+P*5n@OQ z@kl+;cm;*fdQf1Dk1&kD|C`>fM?uUQM(_)k6?8}iPTzuAKL=t${{&bixNPy8BW3^A(6~=43Wr#PvPdD(%2b^9Y%T z&vpd$mY8P!1F!o@m+SoGd+wX@(yTMGIL*4F$;UjWHgt#QE`AR|-{}CPOZQ+d7Ki=6 zBkZ%G`q}qXrzXk&w*`-R>xC^-6B+2zV^+&s%%hbGOm&u}74eZZCh1U2x>oEf&#@v+ zpt*C;TR=Wic1V%0ABQ&;`FuBfSCQ|W8&&ij+Z$ok&bzqYqnzOk>fAe?qU}oEqx7%*&T)+}AP?EwSEZ>=Wl# h?KgOyYd|#XMJD;TFwew#BK1?Abg%Ts9@5XL^*_HK8Z-a^ literal 0 HcmV?d00001 diff --git a/features/supervision/lib/presentation/filter/logic.dart b/features/supervision/lib/presentation/filter/logic.dart new file mode 100644 index 0000000..168fbaa --- /dev/null +++ b/features/supervision/lib/presentation/filter/logic.dart @@ -0,0 +1,96 @@ +import 'dart:async'; +import 'dart:developer'; + +import 'package:geolocator/geolocator.dart'; +import 'package:get/get.dart'; +import 'package:latlong2/latlong.dart'; +import 'package:supervision/data/utils/marker_generator.dart'; + +class SupervisionFilterLogic extends GetxController { + Rx currentLocation = LatLng(35.824891, 50.948025).obs; + RxList allMarkers = [].obs; + RxList markers = [].obs; + Timer? _debounceTimer; + + + + + + RxBool isSelected = false.obs; + + Future determineCurrentPosition() async { + bool serviceEnabled; + LocationPermission permission; + + serviceEnabled = await Geolocator.isLocationServiceEnabled(); + if (!serviceEnabled) { + return Future.error('Location services are disabled.'); + } + + permission = await Geolocator.checkPermission(); + if (permission == LocationPermission.denied) { + permission = await Geolocator.requestPermission(); + if (permission == LocationPermission.denied) { + return Future.error('Location permissions are denied.'); + } + } + + if (permission == LocationPermission.deniedForever) { + return Future.error('Location permissions are permanently denied.'); + } + + final position = await Geolocator.getCurrentPosition( + locationSettings: AndroidSettings(accuracy: LocationAccuracy.best), + ); + final latLng = LatLng(position.latitude, position.longitude); + currentLocation.value = latLng; + markers.add(latLng); + } + + void debouncedUpdateVisibleMarkers({required LatLng center}) { + _debounceTimer?.cancel(); + _debounceTimer = Timer(const Duration(milliseconds: 300), () { + final filtered = filterNearbyMarkers({ + 'markers': allMarkers, + 'centerLat': center.latitude, + 'centerLng': center.longitude, + 'radius': 2000.0, + }); + + markers.addAll(filtered); + }); + } + + List filterNearbyMarkers(Map args) { + final List rawMarkers = args['markers']; + final double centerLat = args['centerLat']; + final double centerLng = args['centerLng']; + final double radiusInMeters = args['radius']; + final center = LatLng(centerLat, centerLng); + final distance = Distance(); + + return rawMarkers + .where((marker) => distance(center, marker) <= radiusInMeters) + .toList(); + } + + Future generatedMarkers() async { + final generatedMarkers = await generateLocationsUsingCompute(100000); + allMarkers.value = generatedMarkers; + + } + + @override + void onReady() { + super.onReady(); + + determineCurrentPosition(); + generatedMarkers(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/features/supervision/lib/presentation/filter/view.dart b/features/supervision/lib/presentation/filter/view.dart new file mode 100644 index 0000000..1d0b6ac --- /dev/null +++ b/features/supervision/lib/presentation/filter/view.dart @@ -0,0 +1,174 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_map/flutter_map.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; + +import 'logic.dart'; + +class SupervisionFilterPage extends GetView { + SupervisionFilterPage({super.key}); + + final Map styleTypes = { + 'satellite': 's', + 'satelliteWithLabel': 'y', + 'street': 'p', + 'streetWithTraffic': 'p,traffic', + }; + + final String token = + "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJlMGQyZTUyYzU1ZDJmMDkxNzBmNTdmM2JmOGVkODgxOTg5YTQxN2E5M2JiNDRiZTk1YzEyMjI1NzRlYWM3ZGYwOTlkNzhkNDUyMDRlMDJiIn0.eyJhdWQiOiIyODYyMiIsImp0aSI6IjJlMGQyZTUyYzU1ZDJmMDkxNzBmNTdmM2JmOGVkODgxOTg5YTQxN2E5M2JiNDRiZTk1YzEyMjI1NzRlYWM3ZGYwOTlkNzhkNDUyMDRlMDJiIiwiaWF0IjoxNzI1MTc2MDI5LCJuYmYiOjE3MjUxNzYwMjksImV4cCI6MTcyNzc2ODAyOSwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.bYQSwq48FZ9IM-Y7aTQAblEmIAz1b4m3nOWuKg-VTalx-eZqcIlzIOJI7XarBeS35CGvPbu6W9tAFoliz_HPARSMJM_Ni0YwESjscVqvPNJqV2vZlmgMj_wRDa0W5FmBipZ-AzKGcsuoMEpD8WzUgnlrhUdqVob1UHXQmZt1BFJlFHLm_grzKFf1_Lw_cHA_mRhhe36d_hU5Qg0jY3NP2NXG_TmecQcqch4YEwCh5_R_dUyMIlt70FL2OJ37ESyPYl-XMg3qOOjgI5YD8h6rciSfFsQpnOgl84HhV3aQ4MvWrIPl9ekEnwLM71He8o5KY1hhSQdOHSvO4yL6MBg9Yw"; + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + ObxValue((currentLocation) { + return FlutterMap( + options: MapOptions( + initialCenter: currentLocation.value, + initialZoom: 18, + onPositionChanged: (camera, hasGesture) { + controller.debouncedUpdateVisibleMarkers(center: camera.center); + }, + ), + children: [ + TileLayer( + urlTemplate: + "https://map.ir/shiveh/xyz/1.0.0/Shiveh:Shiveh@EPSG:3857@png/{z}/{x}/{y}.png" + "?x-api-key=$token", + ), + + ObxValue((markers) { + return MarkerLayer( + markers: + markers + .map( + (marker) => Marker( + point: marker, + child: const Icon( + Icons.location_on, + color: Colors.red, + size: 30, + ), + ), + ) + .toList(), + ); + }, controller.markers), + ], + ); + }, controller.currentLocation), + + Positioned( + right: 10, + bottom: 100, + child: RFab.smallAdd( + onPressed: () { + controller.isSelected.value = !controller.isSelected.value; + }, + ), + ), + + Positioned( + bottom: 0, + left: 0, + right: 0, + child: ObxValue((isSelected) { + return DraggableBottomSheet(isVisible: isSelected.value); + }, controller.isSelected), + ), + ], + ); + } +} + +class DraggableBottomSheet extends StatefulWidget { + final bool isVisible; + final double initialHeight; + final double minHeight; + final double maxHeight; + + const DraggableBottomSheet({ + super.key, + required this.isVisible, + this.initialHeight = 200, + this.minHeight = 0, + this.maxHeight = 700, + }); + + @override + State createState() => _DraggableBottomSheetState(); +} + +class _DraggableBottomSheetState extends State { + late double _sheetHeight; + bool isWidgetVisible = false; + + @override + void initState() { + super.initState(); + _sheetHeight = widget.initialHeight; + isWidgetVisible = widget.isVisible; + } + + void _onVerticalDragUpdate(DragUpdateDetails details) { + setState(() { + _sheetHeight -= details.delta.dy; + _sheetHeight = _sheetHeight.clamp(widget.minHeight, widget.maxHeight); + }); + } + + @override + void didUpdateWidget(covariant DraggableBottomSheet oldWidget) { + if (_sheetHeight <= oldWidget.initialHeight) { + setState(() { + isWidgetVisible = !isWidgetVisible; + }); + } + + super.didUpdateWidget(oldWidget); + } + + @override + Widget build(BuildContext context) { + return AnimatedPositioned( + duration: const Duration(milliseconds: 300), + curve: Curves.easeOut, + bottom: widget.isVisible ? 0 : -widget.maxHeight, + left: 0, + right: 0, + child: GestureDetector( + onVerticalDragUpdate: _onVerticalDragUpdate, + child: Container( + height: _sheetHeight, + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.vertical(top: Radius.circular(50)), + ), + child: Column( + children: [ + const SizedBox(height: 10), + Container( + width: 40, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[400], + borderRadius: BorderRadius.circular(5), + ), + ), + const SizedBox(height: 10), + Expanded( + child: ListView.builder( + itemCount: 15, + itemBuilder: + (context, index) => + ListTile(title: Text('Item ${index + 1}')), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/features/supervision/lib/presentation/root/logic.dart b/features/supervision/lib/presentation/root/logic.dart new file mode 100644 index 0000000..a2f73b3 --- /dev/null +++ b/features/supervision/lib/presentation/root/logic.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:supervision/presentation/filter/view.dart'; + +class RootLogic extends GetxController { + RxInt currentIndex = 0.obs; + List pages = [ + SupervisionFilterPage(), + Placeholder(color: Colors.red), + Placeholder(color: Colors.amber), + ]; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + void changePage(int index) { + currentIndex.value = index; + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/features/supervision/lib/presentation/root/view.dart b/features/supervision/lib/presentation/root/view.dart new file mode 100644 index 0000000..6d70f53 --- /dev/null +++ b/features/supervision/lib/presentation/root/view.dart @@ -0,0 +1,62 @@ +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, + ), + + Positioned( + bottom: 0, + left: 0, + right: 0, + child: ObxValue( + (index) => BottomNavigation1( + items: [ + BottomNavigation1Item( + icon: Assets.vecMapSvg, + label: 'نقشه', + isSelected: controller.currentIndex.value == 0, + onTap: () { + controller.changePage(0); + }, + ), + BottomNavigation1Item( + icon: Assets.vecSettingSvg, + label: 'اقدام', + isSelected: controller.currentIndex.value == 1, + onTap: () { + controller.changePage(1); + }, + ), + BottomNavigation1Item( + icon: Assets.vecProfileCircleSvg, + label: 'پروفایل', + isSelected: controller.currentIndex.value == 2, + onTap: () { + controller.changePage(2); + }, + ), + ], + ), + controller.currentIndex, + ), + ), + ], + ), + ); + } +} diff --git a/features/supervision/lib/presentation/routes/app_pages.dart b/features/supervision/lib/presentation/routes/app_pages.dart index 46dad2e..2b44f68 100644 --- a/features/supervision/lib/presentation/routes/app_pages.dart +++ b/features/supervision/lib/presentation/routes/app_pages.dart @@ -1,6 +1,7 @@ import 'package:rasadyar_core/core.dart'; import 'package:supervision/presentation/filter/logic.dart'; -import 'package:supervision/presentation/filter/view.dart'; +import 'package:supervision/presentation/root/logic.dart'; +import 'package:supervision/presentation/root/view.dart'; import 'package:supervision/presentation/routes/app_routes.dart'; sealed class SupervisionPages { @@ -9,8 +10,11 @@ sealed class SupervisionPages { static final pages = [ GetPage( name: SupervisionRoutes.supervision, - page: () => SupervisionFilterPage(), - binding: BindingsBuilder.put(() => SupervisionLogic()), + page: () => RootPage(), + bindings: [ + BindingsBuilder.put(() => RootLogic()), + BindingsBuilder.put(() => SupervisionFilterLogic()), + ], ), ]; } diff --git a/features/supervision/pubspec.lock b/features/supervision/pubspec.lock new file mode 100644 index 0000000..05a3d7f --- /dev/null +++ b/features/supervision/pubspec.lock @@ -0,0 +1,612 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + cupertino_icons: + dependency: transitive + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_earcut: + dependency: transitive + description: + name: dart_earcut + sha256: e485001bfc05dcbc437d7bfb666316182e3522d4c3f9668048e004d0eb2ce43b + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dartx: + dependency: transitive + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_map: + dependency: "direct main" + description: + name: flutter_map + sha256: f7d0379477274f323c3f3bc12d369a2b42eb86d1e7bd2970ae1ea3cff782449a + url: "https://pub.dev" + source: hosted + version: "8.1.1" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + url: "https://pub.dev" + source: hosted + version: "2.0.17" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c87ff004c8aa6af2d531668b46a4ea379f7191dc6dfa066acd53d506da6e044b + url: "https://pub.dev" + source: hosted + version: "3.0.0" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2 + url: "https://pub.dev" + source: hosted + version: "13.0.4" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d + url: "https://pub.dev" + source: hosted + version: "4.6.2" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 + url: "https://pub.dev" + source: hosted + version: "2.3.13" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" + url: "https://pub.dev" + source: hosted + version: "4.2.6" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172 + url: "https://pub.dev" + source: hosted + version: "4.1.3" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" + url: "https://pub.dev" + source: hosted + version: "0.2.5" + get: + dependency: transitive + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.dev" + source: hosted + version: "4.7.2" + get_it: + dependency: transitive + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" + hive_ce: + dependency: transitive + description: + name: hive_ce + sha256: ac66daee46ad46486a1ed12cf91e9d7479c875fb46889be8d2c96b557406647f + url: "https://pub.dev" + source: hosted + version: "2.10.1" + hive_ce_flutter: + dependency: transitive + description: + name: hive_ce_flutter + sha256: "74c1d5f10d803446b4e7913bb272137e2724ba8a56465444f9e7713aeb60a877" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + http: + dependency: transitive + description: + name: http + sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + url: "https://pub.dev" + source: hosted + version: "1.3.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + latlong2: + dependency: "direct main" + description: + name: latlong2 + sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" + url: "https://pub.dev" + source: hosted + version: "0.9.1" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + location: + dependency: "direct main" + description: + name: location + sha256: c2c4304071ec860525d5c50d142410072f8620c1d9f74874811af2e804e1a9c8 + url: "https://pub.dev" + source: hosted + version: "8.0.0" + location_platform_interface: + dependency: transitive + description: + name: location_platform_interface + sha256: a3404ea6d74e89b121630be62ed8edcc7b39fd108bd19805d0ae55c397135dd7 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + location_web: + dependency: transitive + description: + name: location_web + sha256: "744bdff53dc455a2dc9a34474c49cde364d4fbef2aee009f8b0b4b68570c27a1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + logger: + dependency: transitive + description: + name: logger + sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 + url: "https://pub.dev" + source: hosted + version: "2.5.0" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "0ca7359dad67fd7063cb2892ab0c0737b2daafd807cf1acecd62374c8fae6c12" + url: "https://pub.dev" + source: hosted + version: "2.2.16" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + permission_handler: + dependency: transitive + description: + name: permission_handler + sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849" + url: "https://pub.dev" + source: hosted + version: "11.4.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc + url: "https://pub.dev" + source: hosted + version: "12.1.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: f84a188e79a35c687c132a0a0556c254747a08561e99ab933f12f6ca71ef3c98 + url: "https://pub.dev" + source: hosted + version: "9.4.6" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.dev" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 + url: "https://pub.dev" + source: hosted + version: "4.3.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + polylabel: + dependency: transitive + description: + name: polylabel + sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + proj4dart: + dependency: transitive + description: + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + url: "https://pub.dev" + source: hosted + version: "2.1.0" + rasadyar_core: + dependency: "direct main" + description: + path: "../../packages/core" + relative: true + source: path + version: "1.0.0+1" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + time: + dependency: transitive + description: + name: time + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + url: "https://pub.dev" + source: hosted + version: "1.1.18" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + url: "https://pub.dev" + source: hosted + version: "1.1.16" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" +sdks: + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/flutter_ddd_module/CHANGELOG.md b/flutter_ddd_module/CHANGELOG.md deleted file mode 100644 index f0640d6..0000000 --- a/flutter_ddd_module/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# 0.1.0+1 - -- TODO: Describe initial release. diff --git a/flutter_ddd_module/HELLO.md b/flutter_ddd_module/HELLO.md deleted file mode 100644 index 56a50b8..0000000 --- a/flutter_ddd_module/HELLO.md +++ /dev/null @@ -1 +0,0 @@ -Hello moji -! \ No newline at end of file diff --git a/flutter_ddd_module/LICENSE b/flutter_ddd_module/LICENSE deleted file mode 100644 index ba75c69..0000000 --- a/flutter_ddd_module/LICENSE +++ /dev/null @@ -1 +0,0 @@ -TODO: Add your license here. diff --git a/flutter_ddd_module/README.md b/flutter_ddd_module/README.md deleted file mode 100644 index ec1f8e9..0000000 --- a/flutter_ddd_module/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# flutter_ddd_module - -[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) - -A new brick created with the Mason CLI. - -_Generated by [mason][1] 🧱_ - -## Getting Started 🚀 - -This is a starting point for a new brick. -A few resources to get you started if this is your first brick template: - -- [Official Mason Documentation][2] -- [Code generation with Mason Blog][3] -- [Very Good Livestream: Felix Angelov Demos Mason][4] -- [Flutter Package of the Week: Mason][5] -- [Observable Flutter: Building a Mason brick][6] -- [Meet Mason: Flutter Vikings 2022][7] - -[1]: https://github.com/felangel/mason -[2]: https://docs.brickhub.dev -[3]: https://verygood.ventures/blog/code-generation-with-mason -[4]: https://youtu.be/G4PTjA6tpTU -[5]: https://youtu.be/qjA0JFiPMnQ -[6]: https://youtu.be/o8B1EfcUisw -[7]: https://youtu.be/LXhgiF5HiQg diff --git a/flutter_ddd_module/__brick__/HELLO.md b/flutter_ddd_module/__brick__/HELLO.md deleted file mode 100644 index 2f08230..0000000 --- a/flutter_ddd_module/__brick__/HELLO.md +++ /dev/null @@ -1 +0,0 @@ -Hello {{name}}! \ No newline at end of file diff --git a/flutter_ddd_module/__brick__/lib/data/.gitkeep b/flutter_ddd_module/__brick__/lib/data/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/flutter_ddd_module/__brick__/lib/presentation/routes/app_pages.dart b/flutter_ddd_module/__brick__/lib/presentation/routes/app_pages.dart deleted file mode 100644 index e69de29..0000000 diff --git a/flutter_ddd_module/__brick__/lib/presentation/routes/app_paths.dart b/flutter_ddd_module/__brick__/lib/presentation/routes/app_paths.dart deleted file mode 100644 index e69de29..0000000 diff --git a/flutter_ddd_module/__brick__/pubspec.yaml b/flutter_ddd_module/__brick__/pubspec.yaml deleted file mode 100644 index c892059..0000000 --- a/flutter_ddd_module/__brick__/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: {{feature_name}} -description: {{feature_name}} feature module -version: 0.0.1 -publish_to: 'none' - -environment: - sdk: '>=3.0.0 <4.0.0' - flutter: ">=3.10.0" - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^5.0.0 - -flutter: - uses-material-design: true \ No newline at end of file diff --git a/flutter_ddd_module/brick.yaml b/flutter_ddd_module/brick.yaml deleted file mode 100644 index 591998f..0000000 --- a/flutter_ddd_module/brick.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: flutter_ddd_module -description: A new brick created with the Mason CLI. - -# The following defines the brick repository url. -# Uncomment and update the following line before publishing the brick. -# repository: https://github.com/my_org/my_repo - -# The following defines the version and build number for your brick. -# A version number is three numbers separated by dots, like 1.2.34 -# followed by an optional build number (separated by a +). -version: 0.1.0+1 - -# The following defines the environment for the current brick. -# It includes the version of mason that the brick requires. -environment: - mason: ^0.1.1 - -# Variables specify dynamic values that your brick depends on. -# Zero or more variables can be specified for a given brick. -# Each variable has: -# * a type (string, number, boolean, enum, array, or list) -# * an optional short description -# * an optional default value -# * an optional list of default values (array only) -# * an optional prompt phrase used when asking for the variable -# * a list of values (enums only) -# * an optional separator (list only) -vars: - name: - type: string - description: Your name - default: Dash - prompt: What is your name? diff --git a/flutter_ddd_module/pubspec.yaml b/flutter_ddd_module/pubspec.yaml deleted file mode 100644 index 54cd675..0000000 --- a/flutter_ddd_module/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: -description: feature module -version: 0.0.1 -publish_to: 'none' - -environment: - sdk: '>=3.0.0 <4.0.0' - flutter: ">=3.10.0" - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^5.0.0 - -flutter: - uses-material-design: true \ No newline at end of file diff --git a/lib/presentation/common/assets.dart b/lib/presentation/common/assets.dart index 4d590dc..705ebe1 100644 --- a/lib/presentation/common/assets.dart +++ b/lib/presentation/common/assets.dart @@ -10,10 +10,12 @@ class Assets { static const String iconsEdit = 'assets/icons/edit.svg'; static const String iconsFilter = 'assets/icons/filter.svg'; static const String iconsKey = 'assets/icons/key.svg'; + static const String iconsMap = 'assets/icons/map.svg'; static const String iconsMapMarker = 'assets/icons/map_marker.svg'; + static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; static const String iconsScan = 'assets/icons/scan.svg'; + static const String iconsSetting = 'assets/icons/setting.svg'; static const String iconsTrash = 'assets/icons/trash.svg'; - static const String iconsUser = 'assets/icons/user.svg'; static const String imagesInnerSplash = 'assets/images/inner_splash.webp'; static const String imagesOutterSplash = 'assets/images/outter_splash.webp'; static const String vecAddSvg = 'assets/vec/add.svg.vec'; @@ -24,7 +26,11 @@ class Assets { static const String vecEditSvg = 'assets/vec/edit.svg.vec'; static const String vecFilterSvg = 'assets/vec/filter.svg.vec'; static const String vecKeySvg = 'assets/vec/key.svg.vec'; + static const String vecMapMarkerSvg = 'assets/vec/map_marker.svg.vec'; + static const String vecMapSvg = 'assets/vec/map.svg.vec'; + static const String vecProfileCircleSvg = 'assets/vec/profile_circle.svg.vec'; static const String vecScanSvg = 'assets/vec/scan.svg.vec'; + static const String vecSettingSvg = 'assets/vec/setting.svg.vec'; static const String vecTrashSvg = 'assets/vec/trash.svg.vec'; } diff --git a/packages/core/lib/core.dart b/packages/core/lib/core.dart index 72990be..be75d72 100644 --- a/packages/core/lib/core.dart +++ b/packages/core/lib/core.dart @@ -1,3 +1,8 @@ -library ; +library; + +export 'package:get/get.dart'; +export 'package:rasadyar_core/presentation/common/common.dart'; +export 'package:rasadyar_core/presentation/utils/utils.dart'; +export 'package:rasadyar_core/presentation/widget/widget.dart'; + -export 'package:get/get.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart new file mode 100644 index 0000000..6505e83 --- /dev/null +++ b/packages/core/lib/presentation/common/app_color.dart @@ -0,0 +1,368 @@ +import 'package:flutter/material.dart'; + +class AppColor { + AppColor._(); + + //region --- Blue Colors --- + static const Color blueLight = Color( + 0xFFeaefff, + ); // #eaefff rgb(234, 239, 255) + static const Color blueLightHover = Color( + 0xFFe0e7ff, + ); // #e0e7ff rgb(224, 231, 255) + static const Color blueLightActive = Color( + 0xFFbecdff, + ); // #becdff rgb(190, 205, 255) + static const Color blueNormal = Color(0xFF2d5fff); // #2d5fff rgb(45, 95, 255) + static const Color blueNormalHover = Color( + 0xFF2956e6, + ); // #2956e6 rgb(41, 86, 230) + static const Color blueNormalActive = Color( + 0xFF244ccc, + ); // #244ccc rgb(36, 76, 204) + static const Color blueDark = Color(0xFF2247bf); // #2247bf rgb(34, 71, 191) + static const Color blueDarkHover = Color( + 0xFF1b3999, + ); // #1b3999 rgb(27, 57, 153) + static const Color blueDarkActive = Color( + 0xFF142b73, + ); // #142b73 rgb(20, 43, 115) + static const Color blueDarker = Color(0xFF102159); // #102159 rgb(16, 33, 89) + //endregion + + //region --- Green Colors --- + static const Color greenLight = Color( + 0xFFe6faf5, + ); // #e6faf5 rgb(230, 250, 245) + static const Color greenLightHover = Color( + 0xFFd9f7f0, + ); // #d9f7f0 rgb(217, 247, 240) + static const Color greenLightActive = Color( + 0xFFb0efdf, + ); // #b0efdf rgb(176, 239, 223) + static const Color greenNormal = Color( + 0xFF00cc99, + ); // #00cc99 rgb(0, 204, 153) + static const Color greenNormalHover = Color( + 0xFF00b88a, + ); // #00b88a rgb(0, 184, 138) + static const Color greenNormalActive = Color( + 0xFF00a37a, + ); // #00a37a rgb(0, 163, 122) + static const Color greenDark = Color(0xFF009973); // #009973 rgb(0, 153, 115) + static const Color greenDarkHover = Color( + 0xFF007a5c, + ); // #007a5c rgb(0, 122, 92) + static const Color greenDarkActive = Color( + 0xFF005c45, + ); // #005c45 rgb(0, 92, 69) + static const Color greenDarker = Color(0xFF004736); // #004736 rgb(0, 71, 54) + //endregion + + //region --- Black Colors --- + static const Color blackLight = Color( + 0xFFe6e6e6, + ); // #e6e6e6 rgb(230, 230, 230) + static const Color blackLightHover = Color( + 0xFFd9d9d9, + ); // #d9d9d9 rgb(217, 217, 217) + static const Color blackLightActive = Color( + 0xFFb0b0b0, + ); // #b0b0b0 rgb(176, 176, 176) + static const Color blackNormal = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackNormalHover = Color( + 0xFF000000, + ); // #000000 rgb(0, 0, 0) + static const Color blackNormalActive = Color( + 0xFF000000, + ); // #000000 rgb(0, 0, 0) + static const Color blackDark = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackDarkHover = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackDarkActive = Color( + 0xFF000000, + ); // #000000 rgb(0, 0, 0) + static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0) + //endregion + + //region ---Dark Grey Colors --- + static const Color darkGreyLight = Color( + 0xFFeaeaea, + ); // #eaeaea rgb(234, 234, 234) + static const Color darkGreyLightHover = Color( + 0xFFdfdfdf, + ); // #dfdfdf rgb(223, 223, 223) + static const Color darkGreyLightActive = Color( + 0xFFbdbdbd, + ); // #bdbdbd rgb(189, 189, 189) + static const Color darkGreyNormal = Color( + 0xFF2a2a2a, + ); // #2a2a2a rgb(42, 42, 42) + static const Color darkGreyNormalHover = Color( + 0xFF262626, + ); // #262626 rgb(38, 38, 38) + static const Color darkGreyNormalActive = Color( + 0xFF222222, + ); // #222222 rgb(34, 34, 34) + static const Color darkGreyDark = Color( + 0xFF202020, + ); // #202020 rgb(32, 32, 32) + static const Color darkGreyDarkHover = Color( + 0xFF191919, + ); // #191919 rgb(25, 25, 25) + static const Color darkGreyDarkActive = Color( + 0xFF131313, + ); // #131313 rgb(19, 19, 19) + static const Color darkGreyDarker = Color( + 0xFF0f0f0f, + ); // #0f0f0f rgb(15, 15, 15) + //endregion + + //region ---Medium Grey Colors --- + static const Color mediumGreyLight = Color( + 0xFFf4f4f4, + ); // #f4f4f4 rgb(244, 244, 244) + static const Color mediumGreyLightHover = Color( + 0xFFeeeeee, + ); // #eeeeee rgb(238, 238, 238) + static const Color mediumGreyLightActive = Color( + 0xFFdcdcdc, + ); // #dcdcdc rgb(220, 220, 220) + static const Color mediumGreyNormal = Color( + 0xFF8f8f8f, + ); // #8f8f8f rgb(143, 143, 143) + static const Color mediumGreyNormalHover = Color( + 0xFF818181, + ); // #818181 rgb(129, 129, 129) + static const Color mediumGreyNormalActive = Color( + 0xFF727272, + ); // #727272 rgb(114, 114, 114) + static const Color mediumGreyDark = Color( + 0xFF6b6b6b, + ); // #6b6b6b rgb(107, 107, 107) + static const Color mediumGreyDarkHover = Color( + 0xFF565656, + ); // #565656 rgb(86, 86, 86) + static const Color mediumGreyDarkActive = Color( + 0xFF404040, + ); // #404040 rgb(64, 64, 64) + static const Color mediumGreyDarker = Color( + 0xFF323232, + ); // #323232 rgb(50, 50, 50) + //endregion + + //region ---Light Grey Colors --- + static const Color lightGreyLight = Color( + 0xFFfdfdfd, + ); // #fdfdfd rgb(253, 253, 253) + static const Color lightGreyLightHover = Color( + 0xFFfcfcfc, + ); // #fcfcfc rgb(252, 252, 252) + static const Color lightGreyLightActive = Color( + 0xFFfafafa, + ); // #fafafa rgb(250, 250, 250) + static const Color lightGreyNormal = Color( + 0xFFeeeeee, + ); // #eeeeee rgb(238, 238, 238) + static const Color lightGreyNormalHover = Color( + 0xFFd6d6d6, + ); // #d6d6d6 rgb(214, 214, 214) + static const Color lightGreyNormalActive = Color( + 0xFFbebebe, + ); // #bebebe rgb(190, 190, 190) + static const Color lightGreyDark = Color( + 0xFFb3b3b3, + ); // #b3b3b3 rgb(179, 179, 179) + static const Color lightGreyDarkHover = Color( + 0xFF8f8f8f, + ); // #8f8f8f rgb(143, 143, 143) + static const Color lightGreyDarkActive = Color( + 0xFF6b6b6b, + ); // #6b6b6b rgb(107, 107, 107) + static const Color lightGreyDarker = Color( + 0xFF535353, + ); // #535353 rgb(83, 83, 83) + //endregion + + //region ---WhiteGrey Colors --- + static const Color whiteGreyLight = Color( + 0xFFfefefe, + ); // #fefefe rgb(254, 254, 254) + static const Color whiteGreyLightHover = Color( + 0xFFfefefe, + ); // #fefefe rgb(254, 254, 254) + static const Color whiteGreyLightActive = Color( + 0xFFfdfdfd, + ); // #fdfdfd rgb(253, 253, 253) + static const Color whiteGreyNormal = Color( + 0xFFf9f9f9, + ); // #f9f9f9 rgb(249, 249, 249) + static const Color whiteGreyNormalHover = Color( + 0xFFe0e0e0, + ); // #e0e0e0 rgb(224, 224, 224) + static const Color whiteGreyNormalActive = Color( + 0xFFc7c7c7, + ); // #c7c7c7 rgb(199, 199, 199) + static const Color whiteGreyDark = Color( + 0xFFbbbbbb, + ); // #bbbbbb rgb(187, 187, 187) + static const Color whiteGreyDarkHover = Color( + 0xFF959595, + ); // #959595 rgb(149, 149, 149) + static const Color whiteGreyDarkActive = Color( + 0xFF707070, + ); // #707070 rgb(112, 112, 112) + static const Color whiteGreyDarker = Color( + 0xFF575757, + ); // #575757 rgb(87, 87, 87) + //endregion + + //region ---White Colors --- + static const Color whiteLight = Color( + 0xFFffffff, + ); // #ffffff rgb(255, 255, 255) + static const Color whiteLightHover = Color( + 0xFFffffff, + ); // #ffffff rgb(255, 255, 255) + static const Color whiteLightActive = Color( + 0xFFffffff, + ); // #ffffff rgb(255, 255, 255) + static const Color whiteNormal = Color( + 0xFFffffff, + ); // #ffffff rgb(255, 255, 255) + static const Color whiteNormalHover = Color( + 0xFFe6e6e6, + ); // #e6e6e6 rgb(230, 230, 230) + static const Color whiteNormalActive = Color( + 0xFFcccccc, + ); // #cccccc rgb(204, 204, 204) + static const Color whiteDark = Color( + 0xFFbfbfbf, + ); // #bfbfbf rgb(191, 191, 191) + static const Color whiteDarkHover = Color( + 0xFF999999, + ); // #999999 rgb(153, 153, 153) + static const Color whiteDarkActive = Color( + 0xFF737373, + ); // #737373 rgb(115, 115, 115) + static const Color whiteDarker = Color(0xFF595959); // #595959 rgb(89, 89, 89) + //endregion + + //region --- green1 Colors --- + static const Color green1Light = Color( + 0xFFe6f6f4, + ); // #e6f6f4 rgb(230, 246, 244) + static const Color green1LightHover = Color( + 0xFFd9f2ef, + ); // #d9f2ef rgb(217, 242, 239) + static const Color green1LightActive = Color( + 0xFFb0e4dd, + ); // #b0e4dd rgb(176, 228, 221) + static const Color green1Normal = Color( + 0xFF00a991, + ); // #00a991 rgb(0, 169, 145) + static const Color green1NormalHover = Color( + 0xFF009883, + ); // #009883 rgb(0, 152, 131) + static const Color green1NormalActive = Color( + 0xFF008774, + ); // #008774 rgb(0, 135, 116) + static const Color green1Dark = Color(0xFF007f6d); // #007f6d rgb(0, 127, 109) + static const Color green1DarkHover = Color( + 0xFF006557, + ); // #006557 rgb(0, 101, 87) + static const Color green1DarkActive = Color( + 0xFF004c41, + ); // #004c41 rgb(0, 76, 65) + static const Color green1Darker = Color(0xFF003b33); // #003b33 rgb(0, 59, 51) + //endregion + + //region --- Yellow Colors --- + static const Color yellowLight = Color( + 0xFFfff9e6, + ); // #fff9e6 rgb(255, 249, 230) + static const Color yellowLightHover = Color( + 0xFFfff6da, + ); // #fff6da rgb(255, 246, 218) + static const Color yellowLightActive = Color( + 0xFFffecb2, + ); // #ffecb2 rgb(255, 236, 178) + static const Color yellowNormal = Color( + 0xFFffc107, + ); // #ffc107 rgb(255, 193, 7) + static const Color yellowNormalHover = Color( + 0xFFe6ae06, + ); // #e6ae06 rgb(230, 174, 6) + static const Color yellowNormalActive = Color( + 0xFFcc9a06, + ); // #cc9a06 rgb(204, 154, 6) + static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5) + static const Color yellowDarkHover = Color( + 0xFF997404, + ); // #997404 rgb(153, 116, 4) + static const Color yellowDarkActive = Color( + 0xFF735703, + ); // #735703 rgb(115, 87, 3) + static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2) + //endregion + + //region --- red Colors --- + static const Color redLight = Color(0xFFfdeeee); // #fdeeee rgb(253, 238, 238) + static const Color redLightHover = Color( + 0xFFfce6e6, + ); // #fce6e6 rgb(252, 230, 230) + static const Color redLightActive = Color( + 0xFFf9cbcb, + ); // #f9cbcb rgb(249, 203, 203) + static const Color redNormal = Color(0xFFeb5757); // #eb5757 rgb(235, 87, 87) + static const Color redNormalHover = Color( + 0xFFd44e4e, + ); // #d44e4e rgb(212, 78, 78) + static const Color redNormalActive = Color( + 0xFFbc4646, + ); // #bc4646 rgb(188, 70, 70) + static const Color redDark = Color(0xFFb04141); // #b04141 rgb(176, 65, 65) + static const Color redDarkHover = Color( + 0xFF8d3434, + ); // #8d3434 rgb(141, 52, 52) + static const Color redDarkActive = Color( + 0xFF6a2727, + ); // #6a2727 rgb(106, 39, 39) + static const Color redDarker = Color(0xFF521e1e); // #521e1e rgb(82, 30, 30) + //endregion + + //region --- Teal Colors --- + static const Color tealLight = Color( + 0xFFe8f6f8, + ); // #e8f6f8 rgb(232, 246, 248) + static const Color tealLightHover = Color( + 0xFFdcf1f4, + ); // #dcf1f4 rgb(220, 241, 244) + static const Color tealLightActive = Color( + 0xFFb7e2e9, + ); // #b7e2e9 rgb(183, 226, 233) + static const Color tealNormal = Color( + 0xFF17a2b8, + ); // #17a2b8 rgb(23, 162, 184) + static const Color tealNormalHover = Color( + 0xFF1592a6, + ); // #1592a6 rgb(21, 146, 166) + static const Color tealNormalActive = Color( + 0xFF128293, + ); // #128293 rgb(18, 130, 147) + static const Color tealDark = Color(0xFF117a8a); // #117a8a rgb(17, 122, 138) + static const Color tealDarkHover = Color( + 0xFF0e616e, + ); // #0e616e rgb(14, 97, 110) + static const Color tealDarkActive = Color( + 0xFF0a4953, + ); // #0a4953 rgb(10, 73, 83) + static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64) + //endregion + + //region --- category Colors --- + static const Color confirm = greenNormalActive; + static const Color warning =yellowNormal; + static const Color error =redNormal; + static const Color info = tealNormal; + //endregion +} diff --git a/packages/core/lib/presentation/common/app_fonts.dart b/packages/core/lib/presentation/common/app_fonts.dart new file mode 100644 index 0000000..65be3b0 --- /dev/null +++ b/packages/core/lib/presentation/common/app_fonts.dart @@ -0,0 +1,169 @@ +import 'package:flutter/material.dart'; + +class AppFonts { + AppFonts._(); // Private constructor to prevent instantiation + + // --- Font Families --- + static const String yekan = 'yekan'; + + // --- Font Weights --- + static const FontWeight regular = FontWeight.w400; + static const FontWeight bold = FontWeight.w600; + static const double _height = 1.20; + + static const TextStyle yekan61 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 61, + height: _height, + ); + + static const TextStyle yekan49 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 48, + height: _height, + ); + + static const TextStyle yekan39 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 39, + height: _height, + ); + + static const TextStyle yekan31 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 31, + height: _height, + ); + + static const TextStyle yekan25 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 25, + height: _height, + ); + + static const TextStyle yekan24 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 24, + height: _height, + ); + + static const TextStyle yekan20 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 20, + height: _height, + ); + + static const TextStyle yekan18 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 18, + height: _height, + ); + + static const TextStyle yekan16 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 16, + height: _height, + ); + + static const TextStyle yekan14 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 13, + height: _height, + ); + + static const TextStyle yekan13 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 13, + height: _height, + ); + + static const TextStyle yekan10 = TextStyle( + // Rounded from 10.24 + fontFamily: yekan, + fontWeight: regular, + fontSize: 10, + height: _height, + ); + + static const TextStyle yekan61Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 61, + height: _height, + ); + + static const TextStyle yekan49Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 48, + height: _height, + ); + + static const TextStyle yekan39Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 39, + height: _height, + ); + + static const TextStyle yekan31Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 31, + height: _height, + ); + + static const TextStyle yekan25Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 25, + height: _height, + ); + + static const TextStyle yekan24Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 24, + height: _height, + ); + + static const TextStyle yekan20Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 20, + height: _height, + ); + + static const TextStyle yekan16Bold = TextStyle( + // Base size bold + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 16, + height: _height, + ); + + static const TextStyle yekan13Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 13, + height: _height, + ); + + static const TextStyle yekan10Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 10, + height: _height, + ); +} diff --git a/packages/core/lib/presentation/common/assets.dart b/packages/core/lib/presentation/common/assets.dart new file mode 100644 index 0000000..705ebe1 --- /dev/null +++ b/packages/core/lib/presentation/common/assets.dart @@ -0,0 +1,36 @@ +///This file is automatically generated. DO NOT EDIT, all your changes would be lost. +class Assets { + Assets._(); + + static const String iconsAdd = 'assets/icons/add.svg'; + static const String iconsArrowLeft = 'assets/icons/arrow_left.svg'; + static const String iconsArrowRight = 'assets/icons/arrow_right.svg'; + static const String iconsCall = 'assets/icons/call.svg'; + static const String iconsDownload = 'assets/icons/download.svg'; + static const String iconsEdit = 'assets/icons/edit.svg'; + static const String iconsFilter = 'assets/icons/filter.svg'; + static const String iconsKey = 'assets/icons/key.svg'; + static const String iconsMap = 'assets/icons/map.svg'; + static const String iconsMapMarker = 'assets/icons/map_marker.svg'; + static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; + static const String iconsScan = 'assets/icons/scan.svg'; + static const String iconsSetting = 'assets/icons/setting.svg'; + static const String iconsTrash = 'assets/icons/trash.svg'; + static const String imagesInnerSplash = 'assets/images/inner_splash.webp'; + static const String imagesOutterSplash = 'assets/images/outter_splash.webp'; + static const String vecAddSvg = 'assets/vec/add.svg.vec'; + static const String vecArrowLeftSvg = 'assets/vec/arrow_left.svg.vec'; + static const String vecArrowRightSvg = 'assets/vec/arrow_right.svg.vec'; + static const String vecCallSvg = 'assets/vec/call.svg.vec'; + static const String vecDownloadSvg = 'assets/vec/download.svg.vec'; + static const String vecEditSvg = 'assets/vec/edit.svg.vec'; + static const String vecFilterSvg = 'assets/vec/filter.svg.vec'; + static const String vecKeySvg = 'assets/vec/key.svg.vec'; + static const String vecMapMarkerSvg = 'assets/vec/map_marker.svg.vec'; + static const String vecMapSvg = 'assets/vec/map.svg.vec'; + static const String vecProfileCircleSvg = 'assets/vec/profile_circle.svg.vec'; + static const String vecScanSvg = 'assets/vec/scan.svg.vec'; + static const String vecSettingSvg = 'assets/vec/setting.svg.vec'; + static const String vecTrashSvg = 'assets/vec/trash.svg.vec'; + +} diff --git a/packages/core/lib/presentation/common/common.dart b/packages/core/lib/presentation/common/common.dart new file mode 100644 index 0000000..c3e9fa3 --- /dev/null +++ b/packages/core/lib/presentation/common/common.dart @@ -0,0 +1,3 @@ +export 'app_color.dart'; +export 'app_fonts.dart'; +export 'assets.dart'; diff --git a/packages/core/lib/presentation/utils/color_utils.dart b/packages/core/lib/presentation/utils/color_utils.dart new file mode 100644 index 0000000..46f9bb8 --- /dev/null +++ b/packages/core/lib/presentation/utils/color_utils.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; + +extension ColorUtils on Color { + Color _darken([double amount = 0.1]) { + assert(amount >= 0 && amount <= 1, 'مقدار تیرگی باید بین 0 و 1 باشد'); + final hslColor = HSLColor.fromColor(this); + final newLightness = (hslColor.lightness - amount).clamp(0.0, 1.0); + final hslDarkerColor = hslColor.withLightness(newLightness); + return hslDarkerColor.toColor(); + } + + get disabledColor{ + return withAlpha(38); + } + + get hoverColor{ + return _darken(0.5); + } + + get pressedColor{ + return _darken(0.10); + } + +} diff --git a/packages/core/lib/presentation/utils/utils.dart b/packages/core/lib/presentation/utils/utils.dart new file mode 100644 index 0000000..7eb0ee4 --- /dev/null +++ b/packages/core/lib/presentation/utils/utils.dart @@ -0,0 +1 @@ +import 'color_utils.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart b/packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart new file mode 100644 index 0000000..07f98f4 --- /dev/null +++ b/packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class BottomNavigation1 extends StatefulWidget { + const BottomNavigation1({super.key, required this.items}); + + final List items; + + @override + State createState() => _BottomNavigation1State(); +} + +class _BottomNavigation1State extends State { + @override + Widget build(BuildContext context) { + return Container( + height: 90, + padding: EdgeInsets.fromLTRB(50, 10, 50, 10), + decoration: BoxDecoration( + color: AppColor.blueNormal, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(50), + topRight: Radius.circular(50), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget.items, + ), + ); + } +} + +class BottomNavigation1Item extends StatelessWidget { + final String icon; + final String label; + final bool isSelected; + final Function() onTap; + + const BottomNavigation1Item({ + super.key, + required this.icon, + required this.label, + required this.isSelected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Container( + width: 80, + height: 80, + padding: const EdgeInsets.symmetric(horizontal: 10), + decoration: BoxDecoration( + color: isSelected ? Colors.white.withAlpha(208) : Colors.transparent, + borderRadius: BorderRadius.circular(10), + ), + child: InkWell( + onTap: onTap, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + vecWidget( + icon, + width: 32, + height: 32, + color: isSelected ? AppColor.blueNormal : Colors.white, + ), + const SizedBox(height: 5), + Text( + label, + style: AppFonts.yekan14.copyWith( + color: isSelected ? AppColor.blueNormal : Colors.white, + ), + ), + ], + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/elevated.dart b/packages/core/lib/presentation/widget/buttons/elevated.dart new file mode 100644 index 0000000..1aa97d9 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/elevated.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class RElevated extends StatefulWidget { + RElevated({ + super.key, + required this.text, + required this.onPressed, + foregroundColor, + backgroundColor, + disabledBackgroundColor, + disabledForegroundColor, + radius, + textStyle, + this.width = 150.0, + this.height = 56.0, + }); + + final String text; + final VoidCallback? onPressed; + final double width; + final double height; + Color? foregroundColor; + Color? backgroundColor; + Color? disabledForegroundColor; + Color? disabledBackgroundColor; + double? radius; + TextStyle? textStyle; + + @override + State createState() => _RElevatedState(); +} + +class _RElevatedState extends State { + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: widget.onPressed, + style: ElevatedButton.styleFrom( + backgroundColor: widget.backgroundColor ?? AppColor.blueNormal, + foregroundColor: widget.foregroundColor ?? Colors.white, + disabledBackgroundColor: + widget.disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38), + disabledForegroundColor: widget.disabledForegroundColor ?? Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.radius ?? 8), + ), + fixedSize: Size(widget.width, widget.height), + padding: EdgeInsets.zero, + textStyle: widget.textStyle ?? AppFonts.yekan24, + ), + child: Text(widget.text), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/fab.dart b/packages/core/lib/presentation/widget/buttons/fab.dart new file mode 100644 index 0000000..c7c768e --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/fab.dart @@ -0,0 +1,232 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/assets.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; +import 'package:rasadyar_core/presentation/widget/vec_widget.dart'; + +class RFab extends StatefulWidget { + + + final VoidCallback? onPressed; + Color? foregroundColor; + Color? backgroundColor; + Color? disabledForegroundColor; + Color? disabledBackgroundColor; + double? radius; + ShapeBorder? shapeBorder; + Widget? icon; + + @override + State createState() => _RFabState(); + + //region Add + RFab.smallAdd({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecAddSvg), + backgroundColor: AppColor.greenNormal, + key: key, + ); + + RFab.add({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecAddSvg), + backgroundColor: AppColor.greenNormal, + key: key, + ); + + //endregion + + //region Edit + RFab.smallEdit({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecEditSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.edit({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecEditSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region delete + RFab.smallDelete({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecTrashSvg), + backgroundColor: AppColor.redNormal, + key: key, + ); + + RFab.delete({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecTrashSvg), + backgroundColor: AppColor.redNormal, + key: key, + ); + + //endregion + + //region action + RFab.smallAction({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecScanSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.action({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecScanSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region filter + RFab.smallFilter({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecFilterSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.filter({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecFilterSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region download + RFab.smallDownload({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecDownloadSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.download({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecDownloadSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region Excel + RFab.smallExcel({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecDownloadSvg), + backgroundColor: AppColor.greenDark, + key: key, + ); + + RFab.excel({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecDownloadSvg), + backgroundColor: AppColor.greenDark, + key: key, + ); + + //endregion + + //region Back + RFab.smallBack({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: vecWidget(Assets.vecArrowLeftSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.back({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: vecWidget(Assets.vecArrowLeftSvg), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region General + RFab.small({ + required this.onPressed, + required this.icon, + required this.backgroundColor, + super.key, + }) : radius = 40.0, + foregroundColor = Colors.white; + + RFab({ + required this.onPressed, + required this.icon, + required this.backgroundColor, + super.key, + }) : radius = 56.0, + foregroundColor = Colors.white; + + //endregion +} + +class _RFabState extends State { + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: widget.onPressed, + style: ButtonStyle( + side: WidgetStateProperty.all(BorderSide.none), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.backgroundColor?.pressedColor ?? + AppColor.blueNormalActive; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.hoverColor ?? + AppColor.blueNormalHover; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor?.disabledColor ?? + AppColor.blueNormal.disabledColor; + } + return widget.backgroundColor ?? AppColor.blueNormal; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { + return widget.foregroundColor?.disabledColor; + } + return widget.foregroundColor; + }), + + shape: WidgetStatePropertyAll( + CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)), + ), + fixedSize: WidgetStatePropertyAll( + Size(widget.radius ?? 56, widget.radius ?? 56), + ), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + ), + child: widget.icon, + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/fab_outlined.dart b/packages/core/lib/presentation/widget/buttons/fab_outlined.dart new file mode 100644 index 0000000..fc9f209 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/fab_outlined.dart @@ -0,0 +1,605 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/assets.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; +import 'package:rasadyar_core/presentation/widget/vec_widget.dart'; + +class RFabOutlined extends StatefulWidget { + final Widget icon; + VoidCallback? onPressed; + final Color backgroundColor; + final Color? borderColor; + final double? radius; + OutlinedBorder? shapeBorder; + + @override + State createState() => _RFabOutlinedState(); + + //region General + RFabOutlined({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + required this.borderColor, + this.radius = 56.0, + super.key, + }) : shapeBorder = CircleBorder( + side: BorderSide(color: borderColor ?? Colors.transparent), + ); + + RFabOutlined.noBorder({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + super.key, + }) : borderColor = Colors.transparent, + radius = 56.0, + shapeBorder = CircleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + ); + + RFabOutlined.small({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + required this.borderColor, + super.key, + }) : radius = 40.0, + shapeBorder = CircleBorder( + side: BorderSide(color: borderColor ?? Colors.transparent, width: 1), + ); + + RFabOutlined.smallNoBorder({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + super.key, + }) : borderColor = Colors.transparent, + radius = 40.0, + shapeBorder = CircleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + ); + + //endregion + + //region Add + RFabOutlined.smallAdd({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + borderColor: AppColor.greenNormal, + icon: vecWidget2( + Assets.vecAddSvg, + + color: AppColor.greenNormal, + ), + ); + + RFabOutlined.smallAddNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + icon: vecWidget( + Assets.vecAddSvg, + color: + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + ), + ); + + RFabOutlined.add({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + borderColor: AppColor.greenNormal, + icon: vecWidget( + Assets.vecAddSvg, + color: + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + ), + ); + + RFabOutlined.addNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + icon: vecWidget( + Assets.vecAddSvg, + color: + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + ), + ); + + //endregion + + //region Edit + RFabOutlined.smallEdit({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecEditSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.smallEditNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecEditSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.edit({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecEditSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.editNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecEditSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + //endregion + + //region Delete + RFabOutlined.smallDelete({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + borderColor: AppColor.redNormal, + icon: vecWidget( + Assets.vecTrashSvg, + color: + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + ), + ); + + RFabOutlined.smallDeleteNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + icon: vecWidget( + Assets.vecTrashSvg, + color: + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + ), + ); + + RFabOutlined.delete({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + borderColor: AppColor.redNormal, + icon: vecWidget( + Assets.vecTrashSvg, + color: + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + ), + ); + + RFabOutlined.deleteNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + icon: vecWidget( + Assets.vecTrashSvg, + color: + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + ), + ); + + //endregion + + //region Action + RFabOutlined.smallAction({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecScanSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.smallActionNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecScanSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.action({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecScanSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.actionNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecScanSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + //endregion + + //region Filter + RFabOutlined.smallFilter({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecFilterSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.smallFilterNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecFilterSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.filter({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecFilterSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.filterNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecFilterSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + //endregion + + //region Download + RFabOutlined.smallDownload({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + RFabOutlined.smallDownloadNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + RFabOutlined.download({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + RFabOutlined.downloadNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + //endregion + + //region Excel + RFabOutlined.smallExcel({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + borderColor: AppColor.greenDark, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + RFabOutlined.smallExcelNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + RFabOutlined.excel({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + borderColor: AppColor.greenDark, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + RFabOutlined.excelNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + icon: vecWidget( + Assets.vecDownloadSvg, + color: + onPressed != null + ? AppColor.greenDark + : AppColor.greenDark.disabledColor, + ), + ); + + //endregion + + //region Back + RFabOutlined.smallBack({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecArrowLeftSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.smallBackNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecArrowLeftSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.back({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecArrowLeftSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + RFabOutlined.backNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: vecWidget( + Assets.vecArrowLeftSvg, + color: + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + ), + ); + + //endregion +} + +class _RFabOutlinedState extends State { + bool isOnPressed =false; + @override + Widget build(BuildContext context) { + return OutlinedButton( + onPressed:widget.onPressed , + style: ButtonStyle( + side: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { + return BorderSide( + color: + widget.borderColor?.disabledColor ?? + AppColor.blueNormal.disabledColor, + width: 2, + ); + } + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal, + width: 2, + ); + }), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.backgroundColor; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor.hoverColor ?? + AppColor.blueNormal.hoverColor; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor.disabledColor ?? + AppColor.blueNormal.disabledColor; + } + return Colors.transparent; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor.disabledColor ?? + AppColor.blueNormal.disabledColor; + } + return widget.backgroundColor; + }), + + shape: WidgetStatePropertyAll(widget.shapeBorder), + fixedSize: WidgetStatePropertyAll( + Size(widget.radius ?? 56, widget.radius ?? 56), + ), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + ), + child: widget.icon + ); + } +} + diff --git a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart new file mode 100644 index 0000000..a4b2806 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart @@ -0,0 +1,101 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; + +class ROutlinedElevated extends StatefulWidget { + ROutlinedElevated({ + super.key, + required this.text, + required this.onPressed, + this.foregroundColor, + this.backgroundColor, + this.borderColor, + this.disabledBackgroundColor, + this.pressedBackgroundColor, + this.radius, + this.textStyle, + this.width = 150.0, + this.height = 56.0, + }); + + final String text; + final VoidCallback? onPressed; + final double width; + final double height; + Color? foregroundColor; + Color? backgroundColor; + + Color? borderColor; + + Color? disabledBackgroundColor; + Color? pressedBackgroundColor; + double? radius; + TextStyle? textStyle; + + @override + State createState() => _ROutlinedElevatedState(); +} + +class _ROutlinedElevatedState extends State { + @override + Widget build(BuildContext context) { + return OutlinedButton( + onPressed: widget.onPressed, + style: ButtonStyle( + side: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal, + width: 2, + ); + } else if (states.contains(WidgetState.disabled)) { + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal.withAlpha(38), + width: 2, + ); + } + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal, + width: 2, + ); + }), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + if (widget.pressedBackgroundColor != null) { + return widget.pressedBackgroundColor; + } + return widget.backgroundColor?.pressedColor ?? AppColor.blueNormal; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.hoverColor ?? + AppColor.blueNormal.hoverColor; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor?.disabledColor ?? Colors.transparent; + } + return widget.backgroundColor; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return AppColor.blueNormal.withAlpha(38); + } + return AppColor.blueNormal; + }), + + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.radius ?? 8), + ), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.width, widget.height)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + textStyle: WidgetStatePropertyAll( + widget.textStyle ?? + AppFonts.yekan24.copyWith(color: AppColor.blueNormal), + ), + ), + child: Text(widget.text), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/text_button.dart b/packages/core/lib/presentation/widget/buttons/text_button.dart new file mode 100644 index 0000000..5c9bbb7 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/text_button.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class RTextButton extends StatefulWidget { + RTextButton({ + super.key, + required this.text, + required this.onPressed, + this.foregroundColor, + this.backgroundColor, + this.borderColor, + this.disabledBackgroundColor, + this.radius, + this.textStyle, + this.width = 150.0, + this.height = 56.0, + }); + + final String text; + final VoidCallback? onPressed; + final double width; + final double height; + Color? foregroundColor; + Color? backgroundColor; + Color? borderColor; + + Color? disabledBackgroundColor; + double? radius; + TextStyle? textStyle; + + @override + State createState() => _RTextButtonState(); +} + +class _RTextButtonState extends State { + @override + Widget build(BuildContext context) { + return TextButton( + style: ButtonStyle( + side: WidgetStatePropertyAll(BorderSide.none), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.backgroundColor ?? AppColor.blueNormal; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.withAlpha(38) ?? AppColor.blueNormal.withAlpha(38); + } else if (states.contains(WidgetState.disabled)) { + return widget.disabledBackgroundColor ?? Colors.transparent; + } + return Colors.transparent; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return AppColor.blueNormal.withAlpha(38); + } + return AppColor.blueNormal; + }), + + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.radius ?? 8), + ), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.width, widget.height)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + textStyle: WidgetStatePropertyAll( + widget.textStyle ?? + AppFonts.yekan24.copyWith(color: AppColor.blueNormal), + ), + ), + onPressed:widget.onPressed, + child: Text(widget.text), + ); + } +} diff --git a/packages/core/lib/presentation/widget/captcha/captcha_widget.dart b/packages/core/lib/presentation/widget/captcha/captcha_widget.dart new file mode 100644 index 0000000..fc20c4e --- /dev/null +++ b/packages/core/lib/presentation/widget/captcha/captcha_widget.dart @@ -0,0 +1,266 @@ +import 'dart:math'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class CaptchaController { + int? captchaCode; + TextEditingController textController = TextEditingController(); + GlobalKey formKey = GlobalKey(); + + late Function() refreshCaptcha; + + bool validate() { + if (formKey.currentState?.validate() == true) { + return true; + } + return false; + } + + String get enteredText => textController.text; + + bool isCorrect() { + return textController.text == captchaCode.toString(); + } + + void clear() { + textController.clear(); + } +} + +class RandomLinePainter extends CustomPainter { + final Random random = Random(); + final Paint linePaint; + final List points; + + RandomLinePainter({ + required this.points, + required Color lineColor, + double strokeWidth = 2.0, + }) : linePaint = + Paint() + ..color = lineColor + ..strokeWidth = strokeWidth + ..strokeCap = StrokeCap.round + ..style = PaintingStyle.stroke; + + @override + void paint(Canvas canvas, Size size) { + final path = Path(); + + if (points.isNotEmpty) { + path.moveTo(points[0].dx, points[0].dy); + + for (int i = 1; i < points.length; i++) { + path.lineTo(points[i].dx, points[i].dy); + } + + canvas.drawPath(path, linePaint); + } + } + + @override + bool shouldRepaint(RandomLinePainter oldDelegate) => true; +} + +class CaptchaWidget extends StatefulWidget { + final CaptchaController controller; + final bool autoValidateMode; + + const CaptchaWidget({ + required this.controller, + this.autoValidateMode = false, + super.key, + }); + + @override + _CaptchaWidgetState createState() => _CaptchaWidgetState(); +} + +class _CaptchaWidgetState extends State { + late List points; + late List points1; + late List points2; + bool isOnError = false; + + @override + void initState() { + super.initState(); + generateLines(); + getRandomSixDigitNumber(); + + // Set the refresh function in the controller + widget.controller.refreshCaptcha = () { + getRandomSixDigitNumber(); + generateLines(); + setState(() {}); + }; + } + + void generateLines() { + points = generateRandomLine(); + points1 = generateRandomLine(); + points2 = generateRandomLine(); + setState(() {}); + } + + List generateRandomLine() { + final random = Random(); + int pointCount = random.nextInt(10) + 5; + List points = []; + + double previousY = 0; + + for (int i = 0; i < pointCount; i++) { + double x = (i / (pointCount - 1)) * 135; + + if (i == 0) { + previousY = 24; + } else { + double change = (random.nextDouble() * 20) - 10; + previousY = max(5, min(43, previousY + change)); + } + + points.add(Offset(x, previousY)); + } + + return points; + } + + void getRandomSixDigitNumber() { + final random = Random(); + widget.controller.captchaCode = random.nextInt(900000) + 100000; + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 135, + height: 48, + decoration: BoxDecoration( + color: AppColor.whiteNormalHover, + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(8), + ), + child: Stack( + alignment: AlignmentDirectional.center, + children: [ + CustomPaint( + painter: RandomLinePainter( + points: points, + lineColor: Colors.blue, + strokeWidth: 1.0, + ), + size: const Size(double.infinity, double.infinity), + ), + CustomPaint( + painter: RandomLinePainter( + points: points1, + lineColor: Colors.green, + strokeWidth: 1.0, + ), + size: const Size(double.infinity, double.infinity), + ), + CustomPaint( + painter: RandomLinePainter( + points: points2, + lineColor: Colors.red, + strokeWidth: 1.0, + ), + size: const Size(double.infinity, double.infinity), + ), + Text( + widget.controller.captchaCode.toString(), + style: AppFonts.yekan24, + ), + ], + ), + ), + const SizedBox(height: 20), + IconButton( + padding: EdgeInsets.zero, + onPressed: widget.controller.refreshCaptcha, + icon: Icon(CupertinoIcons.refresh, size: 16), + ), + Expanded( + child: Form( + key: widget.controller.formKey, + autovalidateMode: + widget.autoValidateMode + ? AutovalidateMode.onUserInteraction + : AutovalidateMode.disabled, + child: TextFormField( + controller: widget.controller.textController, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + gapPadding: 11, + ), + labelText: 'کد امنیتی', + labelStyle: AppFonts.yekan13, + errorStyle: AppFonts.yekan10.copyWith( + color: AppColor.redNormal, + fontSize: 8, + ), + suffixIconConstraints: BoxConstraints( + maxHeight: 24, + minHeight: 24, + maxWidth: 24, + minWidth: 24, + ), + + suffix: + widget.controller.textController.text.trim().isNotEmpty + ? clearButton(() { + widget.controller.textController.clear(); + setState(() {}); + }) + : null, + counterText: '', + ), + keyboardType: TextInputType.numberWithOptions( + decimal: false, + signed: false, + ), + maxLines: 1, + maxLength: 6, + onChanged: (value) { + if (isOnError) { + isOnError = !isOnError; + widget.controller.formKey.currentState?.reset(); + widget.controller.textController.text = value; + } + setState(() {}); + }, + validator: (value) { + if (value == null || value.isEmpty) { + isOnError = true; + return 'کد امنیتی را وارد کنید'; + } + if (value != widget.controller.captchaCode.toString()) { + isOnError = true; + return '⚠️کد امنیتی وارد شده اشتباه است'; + } + return null; + }, + style: AppFonts.yekan13, + ), + ), + ), + ], + ); + } + + Widget clearButton(VoidCallback onTap) { + return GestureDetector( + onTap: onTap, + child: Icon(CupertinoIcons.multiply_circle, size: 18), + ); + } +} diff --git a/packages/core/lib/presentation/widget/inputs/r_input.dart b/packages/core/lib/presentation/widget/inputs/r_input.dart new file mode 100644 index 0000000..07edc2b --- /dev/null +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -0,0 +1,216 @@ + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +@immutable +class RTextField extends StatefulWidget { + RTextField( + {super.key, + this.maxLines, + this.maxLength, + this.hintText, + this.padding, + this.onChanged, + this.onSubmitted, + this.keyboardType, + this.showCounter = false, + this.isDense, + this.initText, + this.isForNumber = false, + this.style, + this.hintStyle, + this.suffixIcon, + this.prefixIcon, + this.validator, + this.readonly = false, + this.boxConstraints, + this.minLines, + this.radius, + this.filled, + this.enabled, + this.errorStyle, + this.labelStyle, + this.label}) { + filled = filled ?? false; + obscure = false; + _inputBorder = OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(radius ?? 16)); + } + + RTextField.noBorder( + {super.key, + this.maxLines, + this.maxLength, + this.hintText, + this.padding, + this.onChanged, + this.onSubmitted, + this.keyboardType, + this.showCounter = false, + this.isDense, + this.initText, + this.style, + this.hintStyle, + this.suffixIcon, + this.radius, + this.validator, + this.boxConstraints, + this.minLines, + this.isForNumber = false, + this.readonly = false, + this.label, + this.filled, + this.errorStyle, + this.labelStyle, + this.enabled}) { + _inputBorder = OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(radius ?? 16)); + obscure = false; + filled = filled ?? true; + } + + RTextField.password( + {super.key, + this.maxLines = 1, + this.maxLength, + this.hintText, + this.padding, + this.onChanged, + this.onSubmitted, + this.keyboardType, + this.showCounter = false, + this.isDense, + this.initText, + this.style, + this.hintStyle, + this.suffixIcon, + this.prefixIcon, + this.radius, + this.validator, + this.boxConstraints, + this.minLines, + this.isForNumber = false, + this.readonly = false, + this.label, + this.filled, + this.errorStyle, + this.labelStyle, + this.enabled}) { + _inputBorder = OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(radius ?? 16)); + filled = filled ?? true; + obscure = true; + _isPassword = true; + prefixIcon = prefixIcon ?? const Icon(CupertinoIcons.person); + } + + final int? maxLines; + final int? minLines; + final int? maxLength; + final String? hintText; + final String? label; + final EdgeInsets? padding; + final TextStyle? style; + final TextStyle? errorStyle; + final TextStyle? hintStyle; + final TextStyle? labelStyle; + final bool showCounter; + final bool? isDense; + final bool? isForNumber; + final bool readonly; + bool? obscure; + final bool? enabled; + final double? radius; + final TextInputType? keyboardType; + final Function(String)? onChanged; + final Function(String)? onSubmitted; + final FormFieldValidator? validator; + final String? initText; + Widget? suffixIcon; + Widget? prefixIcon; + bool? filled; + bool _isPassword = false; + + final BoxConstraints? boxConstraints; + late final InputBorder? _inputBorder; + + @override + State createState() => _RTextFieldState(); +} + +class _RTextFieldState extends State { + final TextEditingController _controller = TextEditingController(); + bool? obscure; + + @override + void initState() { + super.initState(); + if (widget.initText != null) { + _controller.text = widget.initText!; + } + obscure = widget.obscure; + } + + @override + void didUpdateWidget(covariant RTextField oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.initText != oldWidget.initText) { + _controller.text = widget.initText ?? ''; + } + } + + @override + Widget build(BuildContext context) { + return Padding( + padding: widget.padding ?? const EdgeInsets.symmetric(vertical: 6.0), + child: TextFormField( + controller: _controller, + readOnly: widget.readonly, + minLines: widget.minLines, + maxLines: widget.maxLines, + onChanged: widget.onChanged, + validator: widget.validator, + enabled: widget.enabled, + obscureText: obscure ?? false, + onTapOutside: (event) { + FocusScope.of(context).unfocus(); + }, + onFieldSubmitted: widget.onSubmitted, + maxLength: widget.maxLength, + textDirection: TextDirection.rtl, + style: widget.style , + keyboardType: widget.keyboardType, + decoration: InputDecoration( + errorStyle: widget.errorStyle, + errorMaxLines: 1, + isDense: widget.isDense, + suffixIcon: widget.suffixIcon ?? + (widget._isPassword + ? IconButton( + onPressed: () { + setState(() { + obscure = !obscure!; + }); + }, + icon: Icon(!obscure! + ? CupertinoIcons.eye_slash + : CupertinoIcons.eye)) + : null), + suffixIconConstraints: widget.boxConstraints, + prefixIcon: widget.prefixIcon, + prefixIconConstraints: widget.boxConstraints, + hintText: widget.hintText, + labelText: widget.label, + labelStyle: widget.labelStyle, + filled: widget.filled, + counter: widget.showCounter ? null : const SizedBox(), + hintStyle: widget.hintStyle, + enabledBorder: widget._inputBorder, + focusedBorder: widget._inputBorder, + border: widget._inputBorder), + )); + } +} \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart b/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart new file mode 100644 index 0000000..63c1ac0 --- /dev/null +++ b/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart @@ -0,0 +1,255 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class PaginationFromUntil extends StatefulWidget { + const PaginationFromUntil({super.key}); + + @override + State createState() => _PaginationFromUntilState(); +} + +class _PaginationFromUntilState extends State { + int current = 1; + int total = 10; + + @override + Widget build(BuildContext context) { + return Container( + width: 164, + height: 47, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: const Color(0xFFEAEFFF), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)), + ), + child: Row( + children: [ + FloatingActionButton.small( + onPressed: () { + if(current>1){ + setState(() { + current--; + }); + } + + }, + shape: CircleBorder(), + elevation: 0, + backgroundColor: Colors.white, + child: Icon(CupertinoIcons.arrow_left, color: AppColor.blueNormal), + ), + Expanded( + child: Text( + '$current از $total', + textAlign: TextAlign.center, + textDirection: TextDirection.rtl, + style: AppFonts.yekan16.copyWith( + color: AppColor.blueNormal, + ), + ), + ), + FloatingActionButton.small( + + onPressed:() { + if (current < total) { + setState(() { + current++; + }); + } + }, + shape: CircleBorder(), + elevation: 0, + backgroundColor: AppColor.blueNormal, + child: Icon(CupertinoIcons.arrow_right, color: Colors.white), + ), + ], + ), + ); + } + + Stack buildStack() { + return Stack( + children: [ + Positioned( + left: 4, + top: 4, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 40, + top: 40, + child: Container( + transform: + Matrix4.identity() + ..translate(0.0, 0.0) + ..rotateZ(-3.14), + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: + Colors.white /* Secondary */, + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + color: + Colors + .white /* Secondary */, + ), + borderRadius: + BorderRadius.circular(50), + ), + ), + child: Stack(), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + Positioned( + left: 8, + top: 8, + child: Container(width: 24, height: 24, child: Stack()), + ), + ], + ), + ), + ), + Positioned( + left: 120, + top: 3, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 40, + top: 40, + child: Container( + transform: + Matrix4.identity() + ..translate(0.0, 0.0) + ..rotateZ(-3.14), + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: const Color( + 0xFF2D5FFF, + ) /* Primary */, + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + color: const Color( + 0xFF2D5FFF, + ) /* Primary */, + ), + borderRadius: + BorderRadius.circular(50), + ), + ), + child: Stack(), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + Positioned( + left: 8, + top: 8, + child: Container(width: 24, height: 24, child: Stack()), + ), + ], + ), + ), + ), + Positioned( + left: 63, + top: 9, + child: Text( + '1 از 17', + style: TextStyle( + color: const Color(0xFF2D5FFF) /* Primary */, + fontSize: 16, + fontFamily: 'IRANYekanFN', + fontWeight: FontWeight.w400, + height: 1.75, + ), + ), + ), + ], + ); + } +} diff --git a/packages/core/lib/presentation/widget/pagination/show_more.dart b/packages/core/lib/presentation/widget/pagination/show_more.dart new file mode 100644 index 0000000..757e952 --- /dev/null +++ b/packages/core/lib/presentation/widget/pagination/show_more.dart @@ -0,0 +1,78 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class RShowMore extends StatefulWidget { + const RShowMore({super.key}); + + @override + State createState() => _RShowMoreState(); +} + +class _RShowMoreState extends State + with SingleTickerProviderStateMixin { + bool _toggled = false; + late final AnimationController _controller; + late final Animation _iconRotation; + + @override + void initState() { + super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 500), + ); + _iconRotation = Tween( + begin: 0, + end: 0.50, + ) // 90 degrees (quarter turn) + .animate(CurvedAnimation(parent: _controller, curve: Curves.easeInOut)); + } + + void _toggle() { + setState(() => _toggled = !_toggled); + _toggled ? _controller.forward() : _controller.reverse(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: _toggle, + behavior: HitTestBehavior.opaque, + child: Row( + mainAxisSize: MainAxisSize.min, + spacing: 8, + children: [ + RotationTransition( + turns: _iconRotation, + child: const Icon(CupertinoIcons.chevron_down, size: 12,color:AppColor.blueNormal ,), + ), + + AnimatedSwitcher( + duration: const Duration(milliseconds: 500), + transitionBuilder: + (child, animation) => + FadeTransition(opacity: animation, child: child), + child: Text( + _toggled ? 'کمتر' : 'مشاهده بیشتر', + key: ValueKey(_toggled), + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + ), + SizedBox(height: 50,) + ], + + + + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/tabs/new_tab.dart b/packages/core/lib/presentation/widget/tabs/new_tab.dart new file mode 100644 index 0000000..c6e73c4 --- /dev/null +++ b/packages/core/lib/presentation/widget/tabs/new_tab.dart @@ -0,0 +1,784 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// @docImport 'switch.dart'; +library; + +import 'dart:collection'; +import 'dart:math' as math; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/rendering.dart'; + +// Minimum padding from edges of the segmented control to edges of +// encompassing widget. +const EdgeInsetsGeometry _kHorizontalItemPadding = EdgeInsets.symmetric( + horizontal: 16.0, +); + +// Minimum height of the segmented control. +const double _kMinSegmentedControlHeight = 28.0; + +// The default color used for the text of the disabled segment. +const Color _kDisableTextColor = Color.fromARGB(115, 122, 122, 122); + +// The duration of the fade animation used to transition when a new widget +// is selected. +const Duration _kFadeDuration = Duration(milliseconds: 165); + +class NewCupertinoSegmentedControl extends StatefulWidget { + /// Creates an iOS-style segmented control bar. + /// + /// The [children] argument must be an ordered [Map] such as a + /// [LinkedHashMap]. Further, the length of the [children] list must be + /// greater than one. + /// + /// Each widget value in the map of [children] must have an associated key + /// that uniquely identifies this widget. This key is what will be returned + /// in the [onValueChanged] callback when a new value from the [children] map + /// is selected. + /// + /// The [groupValue] is the currently selected value for the segmented control. + /// If no [groupValue] is provided, or the [groupValue] is null, no widget will + /// appear as selected. The [groupValue] must be either null or one of the keys + /// in the [children] map. + NewCupertinoSegmentedControl({ + super.key, + required this.children, + required this.onValueChanged, + this.groupValue, + this.unselectedColor, + this.selectedColor, + this.borderColor, + this.pressedColor, + this.disabledColor, + this.disabledTextColor, + this.padding, + this.disabledChildren = const {}, + }) : assert(children.length >= 2), + assert( + groupValue == null || + children.keys.any((T child) => child == groupValue), + 'The groupValue must be either null or one of the keys in the children map.', + ); + + /// The identifying keys and corresponding widget values in the + /// segmented control. + /// + /// The map must have more than one entry. + /// This attribute must be an ordered [Map] such as a [LinkedHashMap]. + final Map children; + + /// The identifier of the widget that is currently selected. + /// + /// This must be one of the keys in the [Map] of [children]. + /// If this attribute is null, no widget will be initially selected. + final T? groupValue; + + /// The callback that is called when a new option is tapped. + /// + /// The segmented control passes the newly selected widget's associated key + /// to the callback but does not actually change state until the parent + /// widget rebuilds the segmented control with the new [groupValue]. + final ValueChanged onValueChanged; + + /// The color used to fill the backgrounds of unselected widgets and as the + /// text color of the selected widget. + /// + /// Defaults to [CupertinoTheme]'s `primaryContrastingColor` if null. + final Color? unselectedColor; + + /// The color used to fill the background of the selected widget and as the text + /// color of unselected widgets. + /// + /// Defaults to [CupertinoTheme]'s `primaryColor` if null. + final Color? selectedColor; + + /// The color used as the border around each widget. + /// + /// Defaults to [CupertinoTheme]'s `primaryColor` if null. + final Color? borderColor; + + /// The color used to fill the background of the widget the user is + /// temporarily interacting with through a long press or drag. + /// + /// Defaults to the selectedColor at 20% opacity if null. + final Color? pressedColor; + + /// The color used to fill the background of the segment when it is disabled. + /// + /// If null, this color will be 50% opacity of the [selectedColor] when + /// the segment is selected. If the segment is unselected, this color will be + /// set to [unselectedColor]. + final Color? disabledColor; + + /// The color used for the text of the segment when it is disabled. + final Color? disabledTextColor; + + /// The CupertinoSegmentedControl will be placed inside this padding. + /// + /// Defaults to EdgeInsets.symmetric(horizontal: 16.0) + final EdgeInsetsGeometry? padding; + + /// The set of identifying keys that correspond to the segments that should be disabled. + /// + /// All segments are enabled by default. + final Set disabledChildren; + + @override + State> createState() => + _SegmentedControlState(); +} + +class _SegmentedControlState + extends State> + with TickerProviderStateMixin> { + T? _pressedKey; + + final List _selectionControllers = + []; + final List _childTweens = []; + + late ColorTween _forwardBackgroundColorTween; + late ColorTween _reverseBackgroundColorTween; + late ColorTween _textColorTween; + + Color? _selectedColor; + Color? _unselectedColor; + Color? _borderColor; + Color? _pressedColor; + Color? _selectedDisabledColor; + Color? _unselectedDisabledColor; + Color? _disabledTextColor; + + AnimationController createAnimationController() { + return AnimationController(duration: _kFadeDuration, vsync: this) + ..addListener(() { + setState(() { + // State of background/text colors has changed + }); + }); + } + + bool _updateColors() { + assert(mounted, 'This should only be called after didUpdateDependencies'); + bool changed = false; + final Color disabledTextColor = + widget.disabledTextColor ?? _kDisableTextColor; + if (_disabledTextColor != disabledTextColor) { + changed = true; + _disabledTextColor = disabledTextColor; + } + final Color selectedColor = + widget.selectedColor ?? CupertinoTheme.of(context).primaryColor; + if (_selectedColor != selectedColor) { + changed = true; + _selectedColor = selectedColor; + } + final Color unselectedColor = + widget.unselectedColor ?? + CupertinoTheme.of(context).primaryContrastingColor; + if (_unselectedColor != unselectedColor) { + changed = true; + _unselectedColor = unselectedColor; + } + final Color selectedDisabledColor = + widget.disabledColor ?? selectedColor.withOpacity(0.5); + final Color unselectedDisabledColor = + widget.disabledColor ?? unselectedColor; + if (_selectedDisabledColor != selectedDisabledColor || + _unselectedDisabledColor != unselectedDisabledColor) { + changed = true; + _selectedDisabledColor = selectedDisabledColor; + _unselectedDisabledColor = unselectedDisabledColor; + } + final Color borderColor = + widget.borderColor ?? CupertinoTheme.of(context).primaryColor; + if (_borderColor != borderColor) { + changed = true; + _borderColor = borderColor; + } + final Color pressedColor = + widget.pressedColor ?? + CupertinoTheme.of(context).primaryColor.withOpacity(0.2); + if (_pressedColor != pressedColor) { + changed = true; + _pressedColor = pressedColor; + } + + _forwardBackgroundColorTween = ColorTween( + begin: _pressedColor, + end: _selectedColor, + ); + _reverseBackgroundColorTween = ColorTween( + begin: _unselectedColor, + end: _selectedColor, + ); + _textColorTween = ColorTween(begin: _selectedColor, end: _unselectedColor); + return changed; + } + + void _updateAnimationControllers() { + assert(mounted, 'This should only be called after didUpdateDependencies'); + for (final AnimationController controller in _selectionControllers) { + controller.dispose(); + } + _selectionControllers.clear(); + _childTweens.clear(); + + for (final T key in widget.children.keys) { + final AnimationController animationController = + createAnimationController(); + if (widget.groupValue == key) { + _childTweens.add(_reverseBackgroundColorTween); + animationController.value = 1.0; + } else { + _childTweens.add(_forwardBackgroundColorTween); + } + _selectionControllers.add(animationController); + } + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + if (_updateColors()) { + _updateAnimationControllers(); + } + } + + @override + void didUpdateWidget(NewCupertinoSegmentedControl oldWidget) { + super.didUpdateWidget(oldWidget); + + if (_updateColors() || + oldWidget.children.length != widget.children.length) { + _updateAnimationControllers(); + } + + if (oldWidget.groupValue != widget.groupValue) { + int index = 0; + for (final T key in widget.children.keys) { + if (widget.groupValue == key) { + _childTweens[index] = _forwardBackgroundColorTween; + _selectionControllers[index].forward(); + } else { + _childTweens[index] = _reverseBackgroundColorTween; + _selectionControllers[index].reverse(); + } + index += 1; + } + } + } + + @override + void dispose() { + for (final AnimationController animationController + in _selectionControllers) { + animationController.dispose(); + } + super.dispose(); + } + + void _onTapDown(T currentKey) { + if (_pressedKey == null && currentKey != widget.groupValue) { + setState(() { + _pressedKey = currentKey; + }); + } + } + + void _onTapCancel() { + setState(() { + _pressedKey = null; + }); + } + + void _onTap(T currentKey) { + if (currentKey != _pressedKey) { + return; + } + if (!widget.disabledChildren.contains(currentKey)) { + if (currentKey != widget.groupValue) { + widget.onValueChanged(currentKey); + } + } + _pressedKey = null; + } + + Color? getTextColor(int index, T currentKey) { + if (widget.disabledChildren.contains(currentKey)) { + return _disabledTextColor; + } + if (_selectionControllers[index].isAnimating) { + return _textColorTween.evaluate(_selectionControllers[index]); + } + if (widget.groupValue == currentKey) { + return _unselectedColor; + } + return _selectedColor; + } + + Color? getBackgroundColor(int index, T currentKey) { + if (widget.disabledChildren.contains(currentKey)) { + return widget.groupValue == currentKey + ? _selectedDisabledColor + : _unselectedDisabledColor; + } + if (_selectionControllers[index].isAnimating) { + return _childTweens[index].evaluate(_selectionControllers[index]); + } + if (widget.groupValue == currentKey) { + return _selectedColor; + } + if (_pressedKey == currentKey) { + return _pressedColor; + } + return _unselectedColor; + } + + @override + Widget build(BuildContext context) { + final List gestureChildren = []; + final List backgroundColors = []; + int index = 0; + int? selectedIndex; + int? pressedIndex; + for (final T currentKey in widget.children.keys) { + selectedIndex = (widget.groupValue == currentKey) ? index : selectedIndex; + pressedIndex = (_pressedKey == currentKey) ? index : pressedIndex; + + final TextStyle textStyle = DefaultTextStyle.of( + context, + ).style.copyWith(color: getTextColor(index, currentKey)); + final IconThemeData iconTheme = IconThemeData( + color: getTextColor(index, currentKey), + ); + + Widget child = Center(child: widget.children[currentKey]); + + child = MouseRegion( + cursor: kIsWeb ? SystemMouseCursors.click : MouseCursor.defer, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTapDown: + widget.disabledChildren.contains(currentKey) + ? null + : (TapDownDetails event) { + _onTapDown(currentKey); + }, + onTapCancel: + widget.disabledChildren.contains(currentKey) + ? null + : _onTapCancel, + onTap: () { + _onTap(currentKey); + }, + child: IconTheme( + data: iconTheme, + child: DefaultTextStyle( + style: textStyle, + child: Semantics( + button: true, + inMutuallyExclusiveGroup: true, + selected: widget.groupValue == currentKey, + child: child, + ), + ), + ), + ), + ); + + backgroundColors.add(getBackgroundColor(index, currentKey)!); + gestureChildren.add(child); + index += 1; + } + + final Widget box = _SegmentedControlRenderWidget( + selectedIndex: selectedIndex, + pressedIndex: pressedIndex, + backgroundColors: backgroundColors, + borderColor: _borderColor!, + children: gestureChildren, + ); + + return Padding( + padding: widget.padding ?? _kHorizontalItemPadding, + child: UnconstrainedBox(constrainedAxis: Axis.horizontal, child: box), + ); + } +} + +class _SegmentedControlRenderWidget extends MultiChildRenderObjectWidget { + const _SegmentedControlRenderWidget({ + super.key, + super.children, + required this.selectedIndex, + required this.pressedIndex, + required this.backgroundColors, + required this.borderColor, + }); + + final int? selectedIndex; + final int? pressedIndex; + final List backgroundColors; + final Color borderColor; + + @override + RenderObject createRenderObject(BuildContext context) { + return _RenderSegmentedControl( + textDirection: Directionality.of(context), + selectedIndex: selectedIndex, + pressedIndex: pressedIndex, + backgroundColors: backgroundColors, + borderColor: borderColor, + ); + } + + @override + void updateRenderObject( + BuildContext context, + _RenderSegmentedControl renderObject, + ) { + renderObject + ..textDirection = Directionality.of(context) + ..selectedIndex = selectedIndex + ..pressedIndex = pressedIndex + ..backgroundColors = backgroundColors + ..borderColor = borderColor; + } +} + +class _SegmentedControlContainerBoxParentData + extends ContainerBoxParentData { + RRect? surroundingRect; +} + +typedef _NextChild = RenderBox? Function(RenderBox child); + +class _RenderSegmentedControl extends RenderBox + with + ContainerRenderObjectMixin< + RenderBox, + ContainerBoxParentData + >, + RenderBoxContainerDefaultsMixin< + RenderBox, + ContainerBoxParentData + > { + _RenderSegmentedControl({ + required int? selectedIndex, + required int? pressedIndex, + required TextDirection textDirection, + required List backgroundColors, + required Color borderColor, + }) : _textDirection = textDirection, + _selectedIndex = selectedIndex, + _pressedIndex = pressedIndex, + _backgroundColors = backgroundColors, + _borderColor = borderColor; + + int? get selectedIndex => _selectedIndex; + int? _selectedIndex; + + set selectedIndex(int? value) { + if (_selectedIndex == value) { + return; + } + _selectedIndex = value; + markNeedsPaint(); + } + + int? get pressedIndex => _pressedIndex; + int? _pressedIndex; + + set pressedIndex(int? value) { + if (_pressedIndex == value) { + return; + } + _pressedIndex = value; + markNeedsPaint(); + } + + TextDirection get textDirection => _textDirection; + TextDirection _textDirection; + + set textDirection(TextDirection value) { + if (_textDirection == value) { + return; + } + _textDirection = value; + markNeedsLayout(); + } + + List get backgroundColors => _backgroundColors; + List _backgroundColors; + + set backgroundColors(List value) { + if (_backgroundColors == value) { + return; + } + _backgroundColors = value; + markNeedsPaint(); + } + + Color get borderColor => _borderColor; + Color _borderColor; + + set borderColor(Color value) { + if (_borderColor == value) { + return; + } + _borderColor = value; + markNeedsPaint(); + } + + @override + double computeMinIntrinsicWidth(double height) { + RenderBox? child = firstChild; + double minWidth = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childWidth = child.getMinIntrinsicWidth(height); + minWidth = math.max(minWidth, childWidth); + child = childParentData.nextSibling; + } + return minWidth * childCount; + } + + @override + double computeMaxIntrinsicWidth(double height) { + RenderBox? child = firstChild; + double maxWidth = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childWidth = child.getMaxIntrinsicWidth(height); + maxWidth = math.max(maxWidth, childWidth); + child = childParentData.nextSibling; + } + return maxWidth * childCount; + } + + @override + double computeMinIntrinsicHeight(double width) { + RenderBox? child = firstChild; + double minHeight = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childHeight = child.getMinIntrinsicHeight(width); + minHeight = math.max(minHeight, childHeight); + child = childParentData.nextSibling; + } + return minHeight; + } + + @override + double computeMaxIntrinsicHeight(double width) { + RenderBox? child = firstChild; + double maxHeight = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childHeight = child.getMaxIntrinsicHeight(width); + maxHeight = math.max(maxHeight, childHeight); + child = childParentData.nextSibling; + } + return maxHeight; + } + + @override + double? computeDistanceToActualBaseline(TextBaseline baseline) { + return defaultComputeDistanceToHighestActualBaseline(baseline); + } + + @override + void setupParentData(RenderBox child) { + if (child.parentData is! _SegmentedControlContainerBoxParentData) { + child.parentData = _SegmentedControlContainerBoxParentData(); + } + } + + void _layoutRects( + _NextChild nextChild, + RenderBox? leftChild, + RenderBox? rightChild, + ) { + RenderBox? child = leftChild; + double start = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final Offset childOffset = Offset(start, 0.0); + childParentData.offset = childOffset; + final Rect childRect = Rect.fromLTWH( + start, + 0.0, + child.size.width, + child.size.height, + ); + final RRect rChildRect; + if (child == leftChild) { + rChildRect = RRect.fromRectAndCorners( + childRect, + topLeft: const Radius.circular(10.0), + bottomLeft: const Radius.circular(10.0), + ); + } else if (child == rightChild) { + rChildRect = RRect.fromRectAndCorners( + childRect, + topRight: const Radius.circular(10.0), + bottomRight: const Radius.circular(10.0), + ); + } else { + rChildRect = RRect.fromRectAndCorners(childRect); + } + childParentData.surroundingRect = rChildRect; + start += child.size.width; + child = nextChild(child); + } + } + + Size _calculateChildSize(BoxConstraints constraints) { + double maxHeight = _kMinSegmentedControlHeight; + double childWidth = constraints.minWidth / childCount; + RenderBox? child = firstChild; + while (child != null) { + childWidth = math.max( + childWidth, + child.getMaxIntrinsicWidth(double.infinity), + ); + child = childAfter(child); + } + childWidth = math.min(childWidth, constraints.maxWidth / childCount); + child = firstChild; + while (child != null) { + final double boxHeight = child.getMaxIntrinsicHeight(childWidth); + maxHeight = math.max(maxHeight, boxHeight); + child = childAfter(child); + } + return Size(childWidth, maxHeight); + } + + Size _computeOverallSizeFromChildSize(Size childSize) { + return constraints.constrain( + Size(childSize.width * childCount, childSize.height), + ); + } + + @override + double? computeDryBaseline( + covariant BoxConstraints constraints, + TextBaseline baseline, + ) { + final Size childSize = _calculateChildSize(constraints); + final BoxConstraints childConstraints = BoxConstraints.tight(childSize); + + BaselineOffset baselineOffset = BaselineOffset.noBaseline; + for ( + RenderBox? child = firstChild; + child != null; + child = childAfter(child) + ) { + baselineOffset = baselineOffset.minOf( + BaselineOffset(child.getDryBaseline(childConstraints, baseline)), + ); + } + return baselineOffset.offset; + } + + @override + Size computeDryLayout(BoxConstraints constraints) { + final Size childSize = _calculateChildSize(constraints); + return _computeOverallSizeFromChildSize(childSize); + } + + @override + void performLayout() { + final BoxConstraints constraints = this.constraints; + final Size childSize = _calculateChildSize(constraints); + + final BoxConstraints childConstraints = BoxConstraints.tightFor( + width: childSize.width, + height: childSize.height, + ); + + RenderBox? child = firstChild; + while (child != null) { + child.layout(childConstraints, parentUsesSize: true); + child = childAfter(child); + } + + switch (textDirection) { + case TextDirection.rtl: + _layoutRects(childBefore, lastChild, firstChild); + case TextDirection.ltr: + _layoutRects(childAfter, firstChild, lastChild); + } + + size = _computeOverallSizeFromChildSize(childSize); + } + + @override + void paint(PaintingContext context, Offset offset) { + RenderBox? child = firstChild; + int index = 0; + while (child != null) { + _paintChild(context, offset, child, index); + child = childAfter(child); + index += 1; + } + } + + void _paintChild( + PaintingContext context, + Offset offset, + RenderBox child, + int childIndex, + ) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + + context.canvas.drawRRect( + childParentData.surroundingRect!.shift(offset), + Paint() + ..color = backgroundColors[childIndex] + ..style = PaintingStyle.fill, + ); + context.canvas.drawRRect( + childParentData.surroundingRect!.shift(offset), + Paint() + ..color = borderColor + ..strokeWidth = 1.0 + ..style = PaintingStyle.stroke, + ); + + context.paintChild(child, childParentData.offset + offset); + } + + @override + bool hitTestChildren(BoxHitTestResult result, {required Offset position}) { + RenderBox? child = lastChild; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + if (childParentData.surroundingRect!.contains(position)) { + return result.addWithPaintOffset( + offset: childParentData.offset, + position: position, + hitTest: (BoxHitTestResult result, Offset localOffset) { + assert(localOffset == position - childParentData.offset); + return child!.hitTest(result, position: localOffset); + }, + ); + } + child = childParentData.previousSibling; + } + return false; + } +} diff --git a/packages/core/lib/presentation/widget/tabs/tab.dart b/packages/core/lib/presentation/widget/tabs/tab.dart new file mode 100644 index 0000000..fc90a70 --- /dev/null +++ b/packages/core/lib/presentation/widget/tabs/tab.dart @@ -0,0 +1,115 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +import 'new_tab.dart'; + +class CupertinoSegmentedControlDemo extends StatefulWidget { + const CupertinoSegmentedControlDemo({super.key}); + + @override + State createState() => + _CupertinoSegmentedControlDemoState(); +} + +class _CupertinoSegmentedControlDemoState + extends State { + int _selectedSegment = 0; + + // The data for the segments + final Map _segments = const { + 0: Text('Segment 1'), + 1: Text('Segment 2'), + 2: Text('Segment 3'), + }; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CupertinoSlidingSegmentedControl( + children: _segments, + groupValue: _selectedSegment, + + onValueChanged: (int? value) { + setState(() { + _selectedSegment = value!; + }); + }, + ), + const SizedBox(height: 20), + Text( + 'Selected Segment: ${_selectedSegment + 1}', + style: const TextStyle(fontSize: 24), + ), + ], + ), + ); + } +} + +class CupertinoSegmentedControlDemo2 extends StatefulWidget { + const CupertinoSegmentedControlDemo2({super.key}); + + @override + State createState() => + _CupertinoSegmentedControlDemoState2(); +} + +class _CupertinoSegmentedControlDemoState2 + extends State { + int _selectedSegment = 0; + + // The data for the segments + final Map _segments = { + 0:Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50) + ), + child: Text('لاشه', style: AppFonts.yekan13), + ), + 1: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50) + ), + child: Text('زنده', style: AppFonts.yekan13), + ), + }; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + NewCupertinoSegmentedControl( + padding: EdgeInsetsDirectional.symmetric( + horizontal: 20, + vertical: 10, + ), + children: _segments, + groupValue: _selectedSegment, + selectedColor: AppColor.blueNormal, + unselectedColor: Colors.white, + borderColor: Colors.grey.shade300, + onValueChanged: (int value) { + setState(() { + _selectedSegment = value; + }); + }, + ), + const SizedBox(height: 20), + Text( + 'Selected Segment: ${_selectedSegment + 1}', + style: const TextStyle(fontSize: 24), + ), + ], + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/vec_widget.dart b/packages/core/lib/presentation/widget/vec_widget.dart new file mode 100644 index 0000000..3fb78f1 --- /dev/null +++ b/packages/core/lib/presentation/widget/vec_widget.dart @@ -0,0 +1,66 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:vector_graphics/vector_graphics.dart'; + +SvgPicture vecWidget( + String assets, { + double? width, + double? height, + BoxFit? fit, + Color? color, +}) { + return SvgPicture( + AssetBytesLoader(assets), + width: width, + height: height, + fit: fit ?? BoxFit.contain, + colorFilter: + color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null, + ); +} + +SvgPicture svgWidget( + String assets, { + double? width, + double? height, + BoxFit? fit, + Color? color, + }) { + return SvgPicture.asset( + assets, + width: width, + height: height, + fit: fit ?? BoxFit.contain, + colorFilter: + color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null, + ); +} + + +Widget vecWidget2( + String assets, { + double? width, + double? height, + BoxFit? fit, + Color? color, + }) { + final resolvedColor = WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } + return color; + }).resolve({}); // You can pass actual states if needed + + return IconTheme( + data: IconThemeData(color: resolvedColor), + child: SvgPicture( + AssetBytesLoader(assets), + width: width, + height: height, + fit: fit ?? BoxFit.contain, + colorFilter: resolvedColor != null + ? ColorFilter.mode(resolvedColor, BlendMode.srcIn) + : null, + ), + ); +} diff --git a/packages/core/lib/presentation/widget/widget.dart b/packages/core/lib/presentation/widget/widget.dart new file mode 100644 index 0000000..2e060ee --- /dev/null +++ b/packages/core/lib/presentation/widget/widget.dart @@ -0,0 +1,2 @@ +export 'vec_widget.dart'; +export 'bottom_navigation/bottom_navigation_1.dart'; diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock new file mode 100644 index 0000000..c2b2c17 --- /dev/null +++ b/packages/core/pubspec.lock @@ -0,0 +1,890 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: dc27559385e905ad30838356c5f5d574014ba39872d732111cd07ac0beff4c57 + url: "https://pub.dev" + source: hosted + version: "80.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "192d1c5b944e7e53b24b5586db760db934b177d4147c42fbca8c8c5f1eb8d11e" + url: "https://pub.dev" + source: hosted + version: "7.3.0" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" + url: "https://pub.dev" + source: hosted + version: "2.4.15" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + url: "https://pub.dev" + source: hosted + version: "8.0.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4 + url: "https://pub.dev" + source: hosted + version: "8.9.5" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + dartx: + dependency: "direct main" + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + url: "https://pub.dev" + source: hosted + version: "2.0.17" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: "6022db4c7bfa626841b2a10f34dd1e1b68e8f8f9650db6112dcdeeca45ca793c" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: c87ff004c8aa6af2d531668b46a4ea379f7191dc6dfa066acd53d506da6e044b + url: "https://pub.dev" + source: hosted + version: "3.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + get: + dependency: "direct main" + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.dev" + source: hosted + version: "4.7.2" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" + get_test: + dependency: "direct dev" + description: + name: get_test + sha256: "558c39cb35fb37bd501f337dc143de60a4314d5ef3b75f4b0551d6741634995b" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + hive_ce: + dependency: "direct main" + description: + name: hive_ce + sha256: ac66daee46ad46486a1ed12cf91e9d7479c875fb46889be8d2c96b557406647f + url: "https://pub.dev" + source: hosted + version: "2.10.1" + hive_ce_flutter: + dependency: "direct main" + description: + name: hive_ce_flutter + sha256: "74c1d5f10d803446b4e7913bb272137e2724ba8a56465444f9e7713aeb60a877" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + hive_ce_generator: + dependency: "direct dev" + description: + name: hive_ce_generator + sha256: "0b1c750e2d10c55a14cde16d479ada42704be6cef43c54b728ed0e4e02f7d808" + url: "https://pub.dev" + source: hosted + version: "1.8.2" + http: + dependency: transitive + description: + name: http + sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + url: "https://pub.dev" + source: hosted + version: "1.3.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: "81f04dee10969f89f604e1249382d46b97a1ccad53872875369622b5bfc9e58a" + url: "https://pub.dev" + source: hosted + version: "6.9.4" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + url: "https://pub.dev" + source: hosted + version: "10.0.8" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.dev" + source: hosted + version: "3.0.9" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logger: + dependency: "direct main" + description: + name: logger + sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 + url: "https://pub.dev" + source: hosted + version: "2.5.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: transitive + description: + name: mockito + sha256: f99d8d072e249f719a5531735d146d8cf04c580d93920b04de75bef6dfb2daf6 + url: "https://pub.dev" + source: hosted + version: "5.4.5" + mocktail: + dependency: "direct dev" + description: + name: mocktail + sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "0ca7359dad67fd7063cb2892ab0c0737b2daafd807cf1acecd62374c8fae6c12" + url: "https://pub.dev" + source: hosted + version: "2.2.16" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849" + url: "https://pub.dev" + source: hosted + version: "11.4.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc + url: "https://pub.dev" + source: hosted + version: "12.1.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: f84a188e79a35c687c132a0a0556c254747a08561e99ab933f12f6ca71ef3c98 + url: "https://pub.dev" + source: hosted + version: "9.4.6" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.dev" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 + url: "https://pub.dev" + source: hosted + version: "4.3.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + rxdart: + dependency: "direct main" + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + url: "https://pub.dev" + source: hosted + version: "1.3.5" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + time: + dependency: transitive + description: + name: time + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + url: "https://pub.dev" + source: hosted + version: "1.1.18" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + url: "https://pub.dev" + source: hosted + version: "1.1.16" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" + yaml_writer: + dependency: transitive + description: + name: yaml_writer + sha256: "69651cd7238411179ac32079937d4aa9a2970150d6b2ae2c6fe6de09402a5dc5" + url: "https://pub.dev" + source: hosted + version: "2.1.0" +sdks: + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 7bdd078..1aca781 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -56,6 +56,5 @@ dev_dependencies: get_test: ^4.0.1 - flutter: uses-material-design: true