62 lines
2.2 KiB
Dart
62 lines
2.2 KiB
Dart
import 'package:aman_kassa_flutter/redux/constants/setting_const.dart';
|
||
import 'package:aman_kassa_flutter/redux/state/setting_state.dart';
|
||
import 'package:aman_kassa_flutter/redux/store.dart';
|
||
import 'package:aman_kassa_flutter/shared/app_colors.dart';
|
||
import 'package:flutter/material.dart';
|
||
import 'package:flutter_redux/flutter_redux.dart';
|
||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||
|
||
class BottomBar extends StatelessWidget {
|
||
final PageController pageController;
|
||
final int selectedTabIndex;
|
||
|
||
BottomBar({
|
||
this.pageController,
|
||
this.selectedTabIndex,
|
||
});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return StoreConnector<AppState, SettingState>(
|
||
converter: (store) => store.state.settingState,
|
||
builder: (context, vm) {
|
||
return BottomNavigationBar(
|
||
currentIndex: selectedTabIndex,
|
||
backgroundColor: menuColor,
|
||
type: BottomNavigationBarType.shifting,
|
||
items: [
|
||
vm.mode == SettingModeKassa
|
||
? BottomNavigationBarItem(
|
||
backgroundColor: menuColor,
|
||
icon: Icon(MdiIcons.cashRegister, color: Colors.white),
|
||
title: new Text(
|
||
'Касса',
|
||
style: TextStyle(color: Colors.white),
|
||
))
|
||
: BottomNavigationBarItem(
|
||
backgroundColor: menuColor,
|
||
icon: Icon(MdiIcons.calculator, color: Colors.white),
|
||
title: new Text(
|
||
'Калькулятор',
|
||
style: TextStyle(color: Colors.white),
|
||
)),
|
||
BottomNavigationBarItem(
|
||
backgroundColor: menuColor,
|
||
icon: Icon(MdiIcons.tune, color: Colors.white),
|
||
title: new Text(
|
||
'Опции',
|
||
style: TextStyle(color: Colors.white),
|
||
)),
|
||
],
|
||
onTap: (index) {
|
||
pageController.animateToPage(
|
||
index,
|
||
duration: const Duration(milliseconds: 300),
|
||
curve: Curves.easeIn,
|
||
);
|
||
},
|
||
);
|
||
});
|
||
}
|
||
}
|