aman-kassa-flutter/lib/views/home/components/bottom_bar.dart

68 lines
2.5 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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),
label: 'Касса',
// title: new Text(
// 'Касса',
// style: TextStyle(color: Colors.white),
// )
)
: BottomNavigationBarItem(
backgroundColor: menuColor,
icon: Icon(MdiIcons.calculator, color: Colors.white),
label: 'Калькулятор',
// title: new Text(
// 'Калькулятор',
// style: TextStyle(color: Colors.white),
// )
),
BottomNavigationBarItem(
backgroundColor: menuColor,
icon: Icon(MdiIcons.tune, color: Colors.white),
label: 'Опции'
// title: new Text(
// 'Опции',
// style: TextStyle(color: Colors.white),
// )
),
],
onTap: (index) {
pageController.animateToPage(
index,
duration: const Duration(milliseconds: 300),
curve: Curves.easeIn,
);
},
);
});
}
}