Update project
This commit is contained in:
@@ -7,6 +7,8 @@ import 'package:lottie/lottie.dart';
|
||||
import 'package:nearledaily/view/qr_scaner/qr_scaner.dart';
|
||||
import '../constants/font_constants.dart';
|
||||
import '../controllers/cart_controller/cart.dart';
|
||||
import '../features/Store/presentation/screens/store_view.dart';
|
||||
import '../features/dashboard/presentation/screens/dash_view.dart';
|
||||
import '../widgets/text_widget.dart';
|
||||
import 'account/account_view.dart';
|
||||
import 'cart/cart_view.dart';
|
||||
@@ -22,8 +24,9 @@ const Color _kInactive = Color(0xFFCBA8E4);
|
||||
// ─── Screens ──────────────────────────────────────────────────────────────────
|
||||
|
||||
final List<Widget> _screens = [
|
||||
DashboardPage(),
|
||||
const OrdersByStoreScreen(showBackArrow: false),
|
||||
HomeScreen(),
|
||||
StoreViewPage(),
|
||||
// const OrdersByStoreScreen(showBackArrow: false),
|
||||
QrScannerPage(),
|
||||
CartPage(),
|
||||
AccountPage(),
|
||||
@@ -131,18 +134,29 @@ class BottomNavigation extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
extendBody: true,
|
||||
bottomNavigationBar: Obx(
|
||||
() => _BottomNavBar(
|
||||
currentIndex: controller.currentIndex.value,
|
||||
cartController: cartController,
|
||||
onTap: (i) => controller.currentIndex.value = i,
|
||||
return PopScope(
|
||||
canPop: controller.currentIndex.value == 0,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
if (didPop) return;
|
||||
|
||||
// Not on Home tab -> go back to Home instead of exiting/popping
|
||||
if (controller.currentIndex.value != 0) {
|
||||
controller.currentIndex.value = 0;
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
extendBody: true,
|
||||
bottomNavigationBar: Obx(
|
||||
() => _BottomNavBar(
|
||||
currentIndex: controller.currentIndex.value,
|
||||
cartController: cartController,
|
||||
onTap: (i) => controller.currentIndex.value = i,
|
||||
),
|
||||
),
|
||||
body: Obx(
|
||||
() => _screens[controller.currentIndex.value],
|
||||
),
|
||||
),
|
||||
body: Obx(
|
||||
() => _screens[controller.currentIndex.value],
|
||||
),
|
||||
);
|
||||
});
|
||||
@@ -240,8 +254,8 @@ class _GlassPill extends StatelessWidget {
|
||||
onTap: () => onTap(0),
|
||||
),
|
||||
_NavItem(
|
||||
icon: Icons.receipt_long_rounded,
|
||||
label: 'Order',
|
||||
icon: Icons.storefront,
|
||||
label: 'Stores',
|
||||
isActive: currentIndex == 1,
|
||||
onTap: () => onTap(1),
|
||||
),
|
||||
@@ -440,4 +454,4 @@ class _CartNavItem extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user