fixes
parent
1a9958e84f
commit
9d10e06104
|
|
@ -0,0 +1,7 @@
|
||||||
|
import 'package:satu/core/utils/utils_parse.dart';
|
||||||
|
|
||||||
|
class PopupItemDao {
|
||||||
|
PopupItemDao({required this.code, required this.name});
|
||||||
|
String name;
|
||||||
|
String code;
|
||||||
|
}
|
||||||
|
|
@ -19,8 +19,6 @@ import 'package:satu/widgets/fields/input_field.dart';
|
||||||
import 'package:satu/widgets/ui/logo.dart';
|
import 'package:satu/widgets/ui/logo.dart';
|
||||||
|
|
||||||
class LoginView extends StatefulWidget {
|
class LoginView extends StatefulWidget {
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_LoginViewState createState() => _LoginViewState();
|
_LoginViewState createState() => _LoginViewState();
|
||||||
}
|
}
|
||||||
|
|
@ -32,15 +30,13 @@ class _LoginViewState extends State<LoginView> {
|
||||||
|
|
||||||
final FocusNode passwordNode = new FocusNode();
|
final FocusNode passwordNode = new FocusNode();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final DialogService _dialogService = locator<DialogService>();
|
final DialogService _dialogService = locator<DialogService>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
emailController = TextEditingController(text: 'test11@gmail.com');
|
emailController = TextEditingController(text: 'test11@gmail.com');
|
||||||
passwordController = TextEditingController();
|
passwordController = TextEditingController();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -57,61 +53,69 @@ class _LoginViewState extends State<LoginView> {
|
||||||
converter: (store) => store.state.userState!,
|
converter: (store) => store.state.userState!,
|
||||||
builder: (context, vm) {
|
builder: (context, vm) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SingleChildScrollView(
|
body: LayoutBuilder(
|
||||||
physics: BouncingScrollPhysics(),
|
builder: (context, constraints) {
|
||||||
child: Column(
|
return SingleChildScrollView(
|
||||||
mainAxisSize: MainAxisSize.max,
|
child: ConstrainedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
constraints: BoxConstraints(minHeight: constraints.maxHeight),
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Column(
|
||||||
children: <Widget>[
|
mainAxisSize: MainAxisSize.max,
|
||||||
LogoSatu(),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
InputField(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
placeholder: 'Введите почту',
|
children: <Widget>[
|
||||||
controller: emailController,
|
const LogoSatu(),
|
||||||
textInputType: TextInputType.emailAddress,
|
InputField(
|
||||||
nextFocusNode: passwordNode,
|
placeholder: 'Введите почту',
|
||||||
),
|
controller: emailController,
|
||||||
verticalSpaceSmall,
|
textInputType: TextInputType.emailAddress,
|
||||||
InputField(
|
nextFocusNode: passwordNode,
|
||||||
placeholder: 'Введите пароль',
|
),
|
||||||
password: true,
|
verticalSpaceSmall,
|
||||||
controller: passwordController,
|
InputField(
|
||||||
fieldFocusNode: passwordNode,
|
placeholder: 'Введите пароль',
|
||||||
enterPressed: _pressBtnEnter,
|
password: true,
|
||||||
textInputAction: TextInputAction.done,
|
controller: passwordController,
|
||||||
),
|
fieldFocusNode: passwordNode,
|
||||||
verticalSpaceMedium,
|
enterPressed: _pressBtnEnter,
|
||||||
Padding(
|
textInputAction: TextInputAction.done,
|
||||||
padding: EdgeInsets.only( left: 45.sp, right: 45.sp, top: 30.sp ),
|
),
|
||||||
child: BusyButton(
|
verticalSpaceMedium,
|
||||||
title: 'ВОЙТИ',
|
Padding(
|
||||||
busy: vm.isLoading!,
|
padding:
|
||||||
onPressed: _pressBtnEnter,
|
EdgeInsets.only(left: 45.sp, right: 45.sp, top: 30.sp),
|
||||||
|
child: BusyButton(
|
||||||
|
title: 'ВОЙТИ',
|
||||||
|
busy: vm.isLoading!,
|
||||||
|
onPressed: _pressBtnEnter,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
verticalSpaceLarge,
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(MdiIcons.qrcodeScan),
|
||||||
|
iconSize: ScreenUtil().setSp(40.0),
|
||||||
|
tooltip: 'Scan',
|
||||||
|
onPressed: scan,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
verticalSpaceLarge,
|
);
|
||||||
IconButton(
|
},
|
||||||
icon: Icon(MdiIcons.qrcodeScan),
|
|
||||||
iconSize: ScreenUtil().setSp(40.0),
|
|
||||||
tooltip: "Scan",
|
|
||||||
onPressed: scan,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _pressBtnEnter() async {
|
Future<void> _pressBtnEnter() async {
|
||||||
Redux.store!.dispatch(authenticate(emailController.text, passwordController.text));
|
Redux.store!
|
||||||
|
.dispatch(authenticate(emailController.text, passwordController.text));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> scan() async {
|
Future<void> scan() async {
|
||||||
|
final NavigatorService _nav = locator<NavigatorService>();
|
||||||
final NavigatorService _nav = locator<NavigatorService>().push(addByBarcodeViewRoute) as NavigatorService;
|
final dynamic result = await _nav.push(addByBarcodeViewRoute);
|
||||||
final dynamic result = await _nav.push(addByBarcodeViewRoute) ;
|
if (result != null) {
|
||||||
if(result != null) {
|
if (result.length == 60) {
|
||||||
if( result.length == 60 ) {
|
|
||||||
Redux.store?.dispatch(authenticateByToken(result as String));
|
Redux.store?.dispatch(authenticateByToken(result as String));
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(description: 'Не верный формат QR кода');
|
_dialogService.showDialog(description: 'Не верный формат QR кода');
|
||||||
|
|
@ -154,5 +158,6 @@ class LoginModel {
|
||||||
final String login;
|
final String login;
|
||||||
final String password;
|
final String password;
|
||||||
|
|
||||||
LoginModel({required this.authType, required this.login, required this.password});
|
LoginModel(
|
||||||
|
{required this.authType, required this.login, required this.password});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,40 +66,16 @@ class _ProductListItemState extends State<ProductListItem> {
|
||||||
),
|
),
|
||||||
direction: DismissDirection.endToStart,
|
direction: DismissDirection.endToStart,
|
||||||
confirmDismiss: (DismissDirection direction) async {
|
confirmDismiss: (DismissDirection direction) async {
|
||||||
DialogResponse response = await _dialogService.showConfirmationDialog(
|
final DialogResponse response =
|
||||||
title: 'Внимание',
|
await _dialogService.showConfirmationDialog(
|
||||||
description: 'Удалить товар'
|
title: 'Внимание',
|
||||||
'"${widget.name}"'
|
description: 'Удалить из списка товар '
|
||||||
' - ${widget.count} ед. ?',
|
'"${widget.name}"'
|
||||||
confirmationTitle: 'Удалить',
|
' - ${widget.count} ед. ?',
|
||||||
cancelTitle: 'Отмена'
|
confirmationTitle: 'Удалить',
|
||||||
);
|
cancelTitle: 'Отмена');
|
||||||
|
|
||||||
return response.confirmed;
|
return response.confirmed;
|
||||||
|
|
||||||
// return await showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (BuildContext context) {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// return AlertDialog(
|
|
||||||
// title: const Text('Внимание'),
|
|
||||||
// content: Text('Удалить товар '
|
|
||||||
// '"${widget.name}"'
|
|
||||||
// ' - ${widget.count} ед. ?'),
|
|
||||||
// actions: <Widget>[
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () => Navigator.of(context).pop(true),
|
|
||||||
// child: const Text('Удалить')),
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () => Navigator.of(context).pop(false),
|
|
||||||
// child: const Text('Отмена'),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
},
|
},
|
||||||
onDismissed: (direction) {
|
onDismissed: (direction) {
|
||||||
Redux.store!
|
Redux.store!
|
||||||
|
|
@ -108,7 +84,9 @@ class _ProductListItemState extends State<ProductListItem> {
|
||||||
key: Key(widget.name),
|
key: Key(widget.name),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
//onTap: () => _onItemTapped(context),
|
//onTap: () => _onItemTapped(context),
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
editProductModal();
|
||||||
|
},
|
||||||
contentPadding:
|
contentPadding:
|
||||||
const EdgeInsets.symmetric(horizontal: 10.0, vertical: 4.0),
|
const EdgeInsets.symmetric(horizontal: 10.0, vertical: 4.0),
|
||||||
title: Row(
|
title: Row(
|
||||||
|
|
@ -142,8 +120,7 @@ class _ProductListItemState extends State<ProductListItem> {
|
||||||
children: [
|
children: [
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(5),
|
||||||
BorderRadius.circular(5),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Redux.store!.dispatch(counterOrEditSellItem(
|
Redux.store!.dispatch(counterOrEditSellItem(
|
||||||
|
|
@ -152,11 +129,12 @@ class _ProductListItemState extends State<ProductListItem> {
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
//color: whiteColor,
|
//color: whiteColor,
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
ScreenUtil().radius(5)),
|
ScreenUtil().radius(5),
|
||||||
border: Border.all(
|
),
|
||||||
width: 1, color: successColor)),
|
border: Border.all(color: successColor),
|
||||||
|
),
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
color: successColor,
|
color: successColor,
|
||||||
|
|
@ -170,31 +148,24 @@ class _ProductListItemState extends State<ProductListItem> {
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 5.0),
|
margin: const EdgeInsets.symmetric(horizontal: 5.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: whiteColor,
|
color: whiteColor,
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(5),
|
||||||
BorderRadius.circular(5),
|
|
||||||
boxShadow: [cardShadowBox]),
|
boxShadow: [cardShadowBox]),
|
||||||
child: InkWell(
|
child: Padding(
|
||||||
onTap: () {
|
padding: const EdgeInsets.symmetric(vertical: 6.0),
|
||||||
editProductModal();
|
child: SizedBox(
|
||||||
},
|
width: 45,
|
||||||
child: Padding(
|
child: Text(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 6.0),
|
'${widget.count} шт',
|
||||||
child: SizedBox(
|
style: const TextStyle(
|
||||||
width: 45,
|
fontSize: 10, color: placeholderColor),
|
||||||
child: Text(
|
textAlign: TextAlign.center,
|
||||||
'${widget.count} шт',
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 10, color: placeholderColor),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(5),
|
||||||
BorderRadius.circular(5),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (widget.count! > 1.0) {
|
if (widget.count! > 1.0) {
|
||||||
|
|
@ -206,8 +177,7 @@ class _ProductListItemState extends State<ProductListItem> {
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
//color: whiteColor,
|
//color: whiteColor,
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(5),
|
||||||
5),
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 1.0.sp,
|
width: 1.0.sp,
|
||||||
color: widget.count! <= 1.0
|
color: widget.count! <= 1.0
|
||||||
|
|
|
||||||
|
|
@ -134,9 +134,7 @@ class SellView extends StatelessWidget {
|
||||||
mini: true,
|
mini: true,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final NavigatorService _nav =
|
final NavigatorService _nav =
|
||||||
locator<NavigatorService>()
|
locator<NavigatorService>();
|
||||||
.push(addByBarcodeViewRoute)
|
|
||||||
as NavigatorService;
|
|
||||||
final dynamic result =
|
final dynamic result =
|
||||||
await _nav.push(addByBarcodeViewRoute);
|
await _nav.push(addByBarcodeViewRoute);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:satu/core/services/navigator_service.dart';
|
||||||
|
import 'package:satu/core/utils/locator.dart';
|
||||||
import 'package:satu/widgets/bar/products_app_bar.dart';
|
import 'package:satu/widgets/bar/products_app_bar.dart';
|
||||||
import 'package:satu/widgets/tools/app_barcode_scanner_widget.dart';
|
import 'package:satu/widgets/tools/app_barcode_scanner_widget.dart';
|
||||||
|
|
||||||
|
|
@ -20,7 +22,7 @@ class _AddByBarcodeViewState extends State<AddByBarcodeView> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: ProductsAppBar(
|
appBar: const ProductsAppBar(
|
||||||
title: 'Сканер',
|
title: 'Сканер',
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
|
|
@ -28,8 +30,10 @@ class _AddByBarcodeViewState extends State<AddByBarcodeView> {
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppBarcodeScannerWidget.defaultStyle(
|
child: AppBarcodeScannerWidget.defaultStyle(
|
||||||
resultCallback: (String code) {
|
resultCallback: (String code) {
|
||||||
Navigator.pop(context, code);
|
final NavigatorService _nav = locator<NavigatorService>();
|
||||||
// print(code);
|
_nav.pop(code);
|
||||||
|
//Navigator.pop(context, code);
|
||||||
|
|
||||||
// setState(() {
|
// setState(() {
|
||||||
// _code = code;
|
// _code = code;
|
||||||
// });
|
// });
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@ import 'dart:io';
|
||||||
import 'package:esc_pos_bluetooth/esc_pos_bluetooth.dart';
|
import 'package:esc_pos_bluetooth/esc_pos_bluetooth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
||||||
import 'package:satu/core/models/flow/sell_response.dart';
|
import 'package:satu/core/models/flow/sell_response.dart';
|
||||||
import 'package:satu/core/models/settings/printer_setting.dart';
|
import 'package:satu/core/models/settings/printer_setting.dart';
|
||||||
|
import 'package:satu/core/models/ui_dao/popup_item_dao.dart';
|
||||||
import 'package:satu/core/redux/store.dart';
|
import 'package:satu/core/redux/store.dart';
|
||||||
import 'package:satu/core/services/dialog_service.dart';
|
import 'package:satu/core/services/dialog_service.dart';
|
||||||
import 'package:satu/core/utils/locator.dart';
|
import 'package:satu/core/utils/locator.dart';
|
||||||
|
|
@ -31,7 +33,16 @@ class _ReceiptViewState extends State<ReceiptView> {
|
||||||
PrinterBluetoothManager printerManager = PrinterBluetoothManager();
|
PrinterBluetoothManager printerManager = PrinterBluetoothManager();
|
||||||
bool printerLocked = false;
|
bool printerLocked = false;
|
||||||
|
|
||||||
void print() async {
|
List<PopupItemDao> menus = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
//menus.add(PopupItemDao(code: 'return', name: 'Возврат'));
|
||||||
|
//menus.add(PopupItemDao(code: 'share', name: 'Поделится'));
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
void printRec() async {
|
||||||
setState(() {
|
setState(() {
|
||||||
printerLocked = true;
|
printerLocked = true;
|
||||||
});
|
});
|
||||||
|
|
@ -53,10 +64,9 @@ class _ReceiptViewState extends State<ReceiptView> {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
data = await getReceipt(
|
data = await getReceipt(
|
||||||
printerSetting.encoding!,
|
printerSetting.encoding!,
|
||||||
printerSetting.paperSize!,
|
printerSetting.paperSize!,
|
||||||
widget.transactionData.sellResponse!.check!
|
widget.transactionData.sellResponse!.check!);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final PosPrintResult printResult = await printerManager.writeBytes(
|
final PosPrintResult printResult = await printerManager.writeBytes(
|
||||||
|
|
@ -75,6 +85,10 @@ class _ReceiptViewState extends State<ReceiptView> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onSelectChoice(PopupItemDao itemDao ) {
|
||||||
|
print(itemDao.code);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -82,20 +96,31 @@ class _ReceiptViewState extends State<ReceiptView> {
|
||||||
appBar: ProductsAppBar(
|
appBar: ProductsAppBar(
|
||||||
title: 'Просмотр чека',
|
title: 'Просмотр чека',
|
||||||
actions: [
|
actions: [
|
||||||
StoreConnector<AppState, PrinterSetting>(
|
// StoreConnector<AppState, PrinterSetting>(
|
||||||
converter: (store) => store.state.settingState!.printer!,
|
// converter: (store) => store.state.settingState!.printer!,
|
||||||
builder: (context, snapshot) {
|
// builder: (context, snapshot) {
|
||||||
final bool success =
|
// final bool success =
|
||||||
snapshot.device != null && printerLocked == false;
|
// snapshot.device != null && printerLocked == false;
|
||||||
return IconButton(
|
// return IconButton(
|
||||||
onPressed: success ? print : null,
|
// onPressed: success ? print : null,
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.print,
|
// Icons.print,
|
||||||
color: success ? textColor : placeholderColor,
|
// color: success ? textColor : placeholderColor,
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
|
// },
|
||||||
|
// )
|
||||||
|
PopupMenuButton<PopupItemDao>(
|
||||||
|
onSelected: onSelectChoice,
|
||||||
|
itemBuilder: (BuildContext context) {
|
||||||
|
return menus.map((PopupItemDao choice) {
|
||||||
|
return PopupMenuItem<PopupItemDao>(
|
||||||
|
value: choice,
|
||||||
|
child: Text(choice.name),
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
|
|
@ -113,12 +138,22 @@ class _ReceiptViewState extends State<ReceiptView> {
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Add your onPressed code here!
|
final PrinterSetting printerSetting =
|
||||||
|
Redux.store!.state.settingState!.printer!;
|
||||||
|
final bool success =
|
||||||
|
printerSetting.device != null && printerLocked == false;
|
||||||
|
if (success) {
|
||||||
|
printRec();
|
||||||
|
} else {
|
||||||
|
_dialogService.showDialog(
|
||||||
|
description: 'Необходимо настроить принтер',
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
backgroundColor: successColor,
|
backgroundColor: successColor,
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.share_rounded,
|
Icons.print,
|
||||||
size: 20,
|
size: 25,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class BottomBar extends StatelessWidget {
|
||||||
elevation: 8.0,
|
elevation: 8.0,
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 60.0,
|
height: 75.0,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -23,17 +23,20 @@ class BottomBar extends StatelessWidget {
|
||||||
active: selectedIndex == 0,
|
active: selectedIndex == 0,
|
||||||
onTap: () => onTap(0),
|
onTap: () => onTap(0),
|
||||||
svgFile: 'sell',
|
svgFile: 'sell',
|
||||||
|
name: 'Продажа',
|
||||||
),
|
),
|
||||||
BottomButton(
|
BottomButton(
|
||||||
active: selectedIndex == 1,
|
active: selectedIndex == 1,
|
||||||
onTap: () => onTap(1),
|
onTap: () => onTap(1),
|
||||||
svgFile: 'buy',
|
svgFile: 'buy',
|
||||||
disable: true,
|
disable: true,
|
||||||
|
name: 'Покупка',
|
||||||
),
|
),
|
||||||
BottomButton(
|
BottomButton(
|
||||||
active: selectedIndex == 2,
|
active: selectedIndex == 2,
|
||||||
onTap: () => onTap(2),
|
onTap: () => onTap(2),
|
||||||
svgFile: 'journal',
|
svgFile: 'journal',
|
||||||
|
name: 'Журнал',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -48,6 +51,7 @@ class BottomButton extends StatelessWidget {
|
||||||
{required this.svgFile,
|
{required this.svgFile,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
required this.active,
|
required this.active,
|
||||||
|
required this.name,
|
||||||
Key? key,
|
Key? key,
|
||||||
this.disable = false})
|
this.disable = false})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
@ -56,6 +60,7 @@ class BottomButton extends StatelessWidget {
|
||||||
final void Function() onTap;
|
final void Function() onTap;
|
||||||
final bool active;
|
final bool active;
|
||||||
final bool disable;
|
final bool disable;
|
||||||
|
final String name;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -66,8 +71,9 @@ class BottomButton extends StatelessWidget {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
top: BorderSide(
|
top: BorderSide(
|
||||||
width: 3.0,
|
width: 3.0,
|
||||||
color: active ? primaryColor : Colors.transparent),
|
color: active ? primaryColor : Colors.transparent,
|
||||||
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -76,18 +82,33 @@ class BottomButton extends StatelessWidget {
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: disable == true ? (){} : onTap,
|
onTap: disable == true ? () {} : onTap,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: SvgPicture.asset(
|
child: Column(
|
||||||
'assets/images/svg/$svgFile.svg',
|
children: [
|
||||||
height: 30,
|
SvgPicture.asset(
|
||||||
width: 30,
|
'assets/images/svg/$svgFile.svg',
|
||||||
color: disable
|
height: 25,
|
||||||
? disableColor
|
width: 25,
|
||||||
: active
|
color: disable
|
||||||
|
? disableColor
|
||||||
|
: active
|
||||||
|
? primaryColor
|
||||||
|
: placeholderColor,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
name,
|
||||||
|
style: TextStyle(fontSize: 10, color: disable
|
||||||
|
? disableColor
|
||||||
|
: active
|
||||||
? primaryColor
|
? primaryColor
|
||||||
: placeholderColor,
|
: placeholderColor),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
44
pubspec.lock
44
pubspec.lock
|
|
@ -42,7 +42,7 @@ packages:
|
||||||
name: auto_size_text
|
name: auto_size_text
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0-nullsafety.0"
|
version: "3.0.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -105,14 +105,14 @@ packages:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.4"
|
||||||
device_info:
|
device_info:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: device_info
|
name: device_info
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.3"
|
||||||
device_info_platform_interface:
|
device_info_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -267,7 +267,7 @@ packages:
|
||||||
name: implicitly_animated_reorderable_list
|
name: implicitly_animated_reorderable_list
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.1"
|
version: "0.4.2"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -337,7 +337,7 @@ packages:
|
||||||
name: material_floating_search_bar
|
name: material_floating_search_bar
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.4"
|
version: "0.3.6"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -379,14 +379,28 @@ packages:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.5"
|
version: "2.0.7"
|
||||||
|
path_provider_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_android
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.6"
|
||||||
|
path_provider_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_ios
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.6"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -407,14 +421,14 @@ packages:
|
||||||
name: path_provider_windows
|
name: path_provider_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.4"
|
||||||
permission_handler:
|
permission_handler:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: permission_handler
|
name: permission_handler
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.2.5"
|
version: "8.2.6"
|
||||||
permission_handler_platform_interface:
|
permission_handler_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -428,7 +442,7 @@ packages:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.3.0"
|
version: "4.4.0"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -449,7 +463,7 @@ packages:
|
||||||
name: process
|
name: process
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.3"
|
version: "4.2.4"
|
||||||
provider:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -526,7 +540,7 @@ packages:
|
||||||
name: shared_preferences_linux
|
name: shared_preferences_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.3"
|
||||||
shared_preferences_macos:
|
shared_preferences_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -554,7 +568,7 @@ packages:
|
||||||
name: shared_preferences_windows
|
name: shared_preferences_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.3"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
@ -713,7 +727,7 @@ packages:
|
||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.9"
|
version: "2.3.0"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -727,7 +741,7 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.0"
|
version: "5.3.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.14.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=2.5.0"
|
flutter: ">=2.5.0"
|
||||||
|
|
|
||||||
14
pubspec.yaml
14
pubspec.yaml
|
|
@ -23,7 +23,7 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
cupertino_icons: ^1.0.3
|
cupertino_icons: ^1.0.4
|
||||||
redux: ^5.0.0
|
redux: ^5.0.0
|
||||||
flutter_redux: ^0.8.2
|
flutter_redux: ^0.8.2
|
||||||
redux_thunk: ^0.4.0
|
redux_thunk: ^0.4.0
|
||||||
|
|
@ -36,22 +36,22 @@ dependencies:
|
||||||
equatable: ^2.0.3
|
equatable: ^2.0.3
|
||||||
http: ^0.13.4
|
http: ^0.13.4
|
||||||
sqflite: ^2.0.0+4
|
sqflite: ^2.0.0+4
|
||||||
path_provider: ^2.0.5
|
path_provider: ^2.0.7
|
||||||
material_design_icons_flutter: ^5.0.6295
|
material_design_icons_flutter: ^5.0.6295
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
device_info: ^2.0.2
|
device_info: ^2.0.3
|
||||||
auto_size_text: ^3.0.0-nullsafety.0
|
auto_size_text: ^3.0.0
|
||||||
url_launcher: ^6.0.12
|
url_launcher: ^6.0.12
|
||||||
qr_flutter: ^4.0.0
|
qr_flutter: ^4.0.0
|
||||||
mask_text_input_formatter: ^2.0.0
|
mask_text_input_formatter: ^2.0.0
|
||||||
flutter_screenutil: ^5.0.0+2
|
flutter_screenutil: ^5.0.0+2
|
||||||
shared_preferences: ^2.0.8
|
shared_preferences: ^2.0.8
|
||||||
material_floating_search_bar: ^0.3.4
|
material_floating_search_bar: ^0.3.6
|
||||||
implicitly_animated_reorderable_list: ^0.4.1
|
implicitly_animated_reorderable_list: ^0.4.2
|
||||||
uuid: ^3.0.5
|
uuid: ^3.0.5
|
||||||
charset_converter: ^2.0.0
|
charset_converter: ^2.0.0
|
||||||
ai_barcode: ^3.0.1
|
ai_barcode: ^3.0.1
|
||||||
permission_handler: ^8.2.5
|
permission_handler: ^8.2.6
|
||||||
flutter_svg: ^0.23.0+1
|
flutter_svg: ^0.23.0+1
|
||||||
grouped_list: ^4.1.0
|
grouped_list: ^4.1.0
|
||||||
flutter_bluetooth_basic: ^0.1.7
|
flutter_bluetooth_basic: ^0.1.7
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue