From e9b065062a8dc539a12f040f2274b78a5e26ec3e Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Mon, 28 Apr 2025 12:29:13 +0330 Subject: [PATCH] feat : new bottom sheet V1 --- .../lib/presentation/root/view.dart | 139 +++++++++++++----- features/inspection/pubspec.lock | 19 ++- features/inspection/pubspec.yaml | 4 +- packages/core/pubspec.lock | 10 +- packages/core/pubspec.yaml | 2 +- pubspec.lock | 10 +- pubspec.yaml | 2 +- tools/pubspecAll.sh | 9 ++ 8 files changed, 134 insertions(+), 61 deletions(-) create mode 100644 tools/pubspecAll.sh diff --git a/features/inspection/lib/presentation/root/view.dart b/features/inspection/lib/presentation/root/view.dart index 6d70f53..e81db3f 100644 --- a/features/inspection/lib/presentation/root/view.dart +++ b/features/inspection/lib/presentation/root/view.dart @@ -11,48 +11,42 @@ class RootPage extends GetView { 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); - }, + // سایر محتواها (مثلا صفحات اصلی) + Align( + alignment: Alignment.bottomCenter, + child: Column( + children: [ + const Spacer(), + Container( + height: 100, + padding: const EdgeInsets.symmetric(vertical: 10), + decoration: const BoxDecoration( + color: AppColor.blueNormal, + borderRadius: BorderRadius.vertical( + top: Radius.circular(40), + ), ), - BottomNavigation1Item( - icon: Assets.vecSettingSvg, - label: 'اقدام', - isSelected: controller.currentIndex.value == 1, - onTap: () { - controller.changePage(1); - }, + child: SingleChildScrollView( + clipBehavior: Clip.none, + scrollDirection: Axis.horizontal, + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Row( + children: List.generate( + 50, + (index) => ObxValue((data) { + return BottomNavigation1ItemTST( + icon: Assets.vecMapSvg, + label: 'item$index', + isSelected: controller.currentIndex.value == index, + onTap: () => controller.changePage(index), + ); + }, controller.currentIndex), + ), + ), ), - BottomNavigation1Item( - icon: Assets.vecProfileCircleSvg, - label: 'پروفایل', - isSelected: controller.currentIndex.value == 2, - onTap: () { - controller.changePage(2); - }, - ), - ], - ), - controller.currentIndex, + ), + ], ), ), ], @@ -60,3 +54,68 @@ class RootPage extends GetView { ); } } + +class BottomNavigation1ItemTST extends StatelessWidget { + final String icon; + final String label; + final bool isSelected; + final Function() onTap; + + const BottomNavigation1ItemTST({ + super.key, + required this.icon, + required this.label, + required this.isSelected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 80, + height: 130, + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.bottomCenter, + children: [ + AnimatedPositioned( + duration: const Duration(milliseconds: 400), + width: 80, + height: 80, + bottom: isSelected ? 50 : 0, + child: InkWell( + splashColor: Colors.transparent, + onTap: onTap, + child: Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: isSelected ? AppColor.greenNormal : Colors.transparent, + borderRadius: BorderRadius.circular(40), + border: + isSelected + ? Border.all(width: 2, color: Colors.white) + : null, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + vecWidget(icon, width: 32, height: 32, color: Colors.white), + const SizedBox(height: 7), + Text( + label, + style: AppFonts.yekan14.copyWith(color: Colors.white), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + + + diff --git a/features/inspection/pubspec.lock b/features/inspection/pubspec.lock index 415d395..eeeefab 100644 --- a/features/inspection/pubspec.lock +++ b/features/inspection/pubspec.lock @@ -94,6 +94,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" flutter_map: dependency: "direct main" description: @@ -159,18 +164,18 @@ packages: dependency: "direct main" description: name: geolocator - sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2 + sha256: e7ebfa04ce451daf39b5499108c973189a71a919aa53c1204effda1c5b93b822 url: "https://pub.dev" source: hosted - version: "13.0.4" + version: "14.0.0" geolocator_android: dependency: transitive description: name: geolocator_android - sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d + sha256: "114072db5d1dce0ec0b36af2697f55c133bc89a2c8dd513e137c0afe59696ed4" url: "https://pub.dev" source: hosted - version: "4.6.2" + version: "5.0.1+1" geolocator_apple: dependency: transitive description: @@ -255,10 +260,10 @@ packages: dependency: transitive description: name: intl - sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.20.2" + version: "0.19.0" json_annotation: dependency: transitive description: @@ -656,5 +661,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.7.2 <4.0.0" flutter: ">=3.27.0" diff --git a/features/inspection/pubspec.yaml b/features/inspection/pubspec.yaml index cea82c7..b577dea 100644 --- a/features/inspection/pubspec.yaml +++ b/features/inspection/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ^3.7.0 + sdk: ^3.7.2 dependencies: flutter: @@ -15,4 +15,4 @@ dependencies: flutter_map_animations: ^0.9.0 location: ^8.0.0 latlong2: ^0.9.1 - geolocator: ^13.0.4 + geolocator: ^14.0.0 diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock index f5a3aee..0bfb36b 100644 --- a/packages/core/pubspec.lock +++ b/packages/core/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: async - sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.12.0" boolean_selector: dependency: transitive description: @@ -189,10 +189,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.2" ffi: dependency: transitive description: @@ -939,5 +939,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.7.2 <4.0.0" flutter: ">=3.27.0" diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 4df8b74..edb8b47 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0 + sdk: ^3.7.2 dependencies: flutter: diff --git a/pubspec.lock b/pubspec.lock index 8f91457..1f5a0d1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: async - sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.12.0" boolean_selector: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.2" ffi: dependency: transitive description: @@ -769,5 +769,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.7.2 <4.0.0" flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6916a57..200f78e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.7.0 + sdk: ^3.7.2 dependencies: flutter: diff --git a/tools/pubspecAll.sh b/tools/pubspecAll.sh new file mode 100644 index 0000000..9c22f36 --- /dev/null +++ b/tools/pubspecAll.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Navigate to the project root (assuming tools is one level below root) +cd "$(dirname "$0")/.." + +# Find all pubspec.yaml files, print their directories, and run flutter pub get +#find . -name "pubspec.yaml" -exec sh -c 'echo "Running flutter pub get in $(dirname {}) 🙂🙂🙂🙂🙂"; cd $(dirname {}) ; flutter pub get' \; + +find . -name "pubspec.yaml" -exec sh -c 'echo "Running flutter pub get in $(dirname {}) ⬆️🆙🆙🆙⬆️"; cd $(dirname {}) ; flutter pub upgrade' \; \ No newline at end of file