feat : new bottom sheet V1
This commit is contained in:
@@ -11,48 +11,42 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
ObxValue(
|
// سایر محتواها (مثلا صفحات اصلی)
|
||||||
(currentIndex) => IndexedStack(
|
Align(
|
||||||
index: currentIndex.value,
|
alignment: Alignment.bottomCenter,
|
||||||
children: controller.pages,
|
child: Column(
|
||||||
),
|
children: [
|
||||||
controller.currentIndex,
|
const Spacer(),
|
||||||
),
|
Container(
|
||||||
|
height: 100,
|
||||||
Positioned(
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
bottom: 0,
|
decoration: const BoxDecoration(
|
||||||
left: 0,
|
color: AppColor.blueNormal,
|
||||||
right: 0,
|
borderRadius: BorderRadius.vertical(
|
||||||
child: ObxValue(
|
top: Radius.circular(40),
|
||||||
(index) => BottomNavigation1(
|
),
|
||||||
items: [
|
|
||||||
BottomNavigation1Item(
|
|
||||||
icon: Assets.vecMapSvg,
|
|
||||||
label: 'نقشه',
|
|
||||||
isSelected: controller.currentIndex.value == 0,
|
|
||||||
onTap: () {
|
|
||||||
controller.changePage(0);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
BottomNavigation1Item(
|
child: SingleChildScrollView(
|
||||||
icon: Assets.vecSettingSvg,
|
clipBehavior: Clip.none,
|
||||||
label: 'اقدام',
|
scrollDirection: Axis.horizontal,
|
||||||
isSelected: controller.currentIndex.value == 1,
|
physics: const BouncingScrollPhysics(),
|
||||||
onTap: () {
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
controller.changePage(1);
|
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<RootLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,11 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_localizations:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
flutter_map:
|
flutter_map:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -159,18 +164,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: geolocator
|
name: geolocator
|
||||||
sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2
|
sha256: e7ebfa04ce451daf39b5499108c973189a71a919aa53c1204effda1c5b93b822
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "13.0.4"
|
version: "14.0.0"
|
||||||
geolocator_android:
|
geolocator_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: geolocator_android
|
name: geolocator_android
|
||||||
sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d
|
sha256: "114072db5d1dce0ec0b36af2697f55c133bc89a2c8dd513e137c0afe59696ed4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.6.2"
|
version: "5.0.1+1"
|
||||||
geolocator_apple:
|
geolocator_apple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -255,10 +260,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: intl
|
name: intl
|
||||||
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
|
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.20.2"
|
version: "0.19.0"
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -656,5 +661,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "6.5.0"
|
version: "6.5.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.0 <4.0.0"
|
dart: ">=3.7.2 <4.0.0"
|
||||||
flutter: ">=3.27.0"
|
flutter: ">=3.27.0"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ publish_to: 'none'
|
|||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.7.0
|
sdk: ^3.7.2
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
@@ -15,4 +15,4 @@ dependencies:
|
|||||||
flutter_map_animations: ^0.9.0
|
flutter_map_animations: ^0.9.0
|
||||||
location: ^8.0.0
|
location: ^8.0.0
|
||||||
latlong2: ^0.9.1
|
latlong2: ^0.9.1
|
||||||
geolocator: ^13.0.4
|
geolocator: ^14.0.0
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.13.0"
|
version: "2.12.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -189,10 +189,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.2"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -939,5 +939,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.0 <4.0.0"
|
dart: ">=3.7.2 <4.0.0"
|
||||||
flutter: ">=3.27.0"
|
flutter: ">=3.27.0"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ publish_to: 'none'
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.7.0
|
sdk: ^3.7.2
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
10
pubspec.lock
10
pubspec.lock
@@ -13,10 +13,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.13.0"
|
version: "2.12.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -85,10 +85,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.2"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -769,5 +769,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "6.5.0"
|
version: "6.5.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.0 <4.0.0"
|
dart: ">=3.7.2 <4.0.0"
|
||||||
flutter: ">=3.27.0"
|
flutter: ">=3.27.0"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ publish_to: 'none'
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.7.0
|
sdk: ^3.7.2
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
9
tools/pubspecAll.sh
Normal file
9
tools/pubspecAll.sh
Normal file
@@ -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' \;
|
||||||
Reference in New Issue
Block a user