Initial commit
This commit is contained in:
40
lib/feature/main/presentation/pages/main_page/main_page.dart
Normal file
40
lib/feature/main/presentation/pages/main_page/main_page.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import '../../../../../food_delivery_client.dart';
|
||||
|
||||
class MainPage extends StatelessWidget with MainPageMixin {
|
||||
MainPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => sl<MainBloc>(),
|
||||
child: BlocBuilder<MainBloc, MainState>(
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
body: IndexedStack(
|
||||
index: state.currentIndex,
|
||||
sizing: StackFit.expand,
|
||||
alignment: AlignmentGeometry.center,
|
||||
children: pages,
|
||||
),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
onTap: (value) {
|
||||
context.read<MainBloc>().add(MainEvent.loaded(value));
|
||||
},
|
||||
currentIndex: state.currentIndex,
|
||||
items: List.generate(
|
||||
defaultIcons.length,
|
||||
(index) => BottomNavigationBarItem(
|
||||
icon: defaultIcons[index].paddingOnly(bottom: 4.85),
|
||||
activeIcon: activeIcons[index].paddingOnly(bottom: 4.85),
|
||||
label: labels[index],
|
||||
tooltip: labels[index],
|
||||
backgroundColor: AppColors.cFFFFFF,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user