global share release

4.4
Serik.Uvaissov 2020-06-25 12:31:26 +06:00
parent d3d983ba3f
commit 5dcb99ec67
8 changed files with 19 additions and 36 deletions

View File

@ -45,7 +45,6 @@ android {
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.aman_kassa_flutter"
minSdkVersion 18
targetSdkVersion 28

View File

@ -7,8 +7,6 @@ class CalcModel {
@override
String toString() {
// TODO: implement toString
return 'num1: $num1 num2:$num2 operation:$operation closed:$closed';
}
}

View File

@ -38,12 +38,9 @@ Future<void> cleanCalcItems(Store<AppState> store) async {
ThunkAction<AppState> onTapAction(String value) {
return (Store<AppState> store) async {
if(value == Calculations.EQUAL){
return setEqual(store);
}
//TODO create private methods by operations and values
List calcItems = Calculator.action(value: value, items: store.state.calcState.calcItems);
calcItems.asMap().forEach((index,element ) {
print('#$index: ${element.toString()}');

View File

@ -4,6 +4,7 @@ import 'package:aman_kassa_flutter/shared/ui_helpers.dart';
import 'package:aman_kassa_flutter/widgets/fields/busy_button.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:esys_flutter_share/esys_flutter_share.dart';
//import 'package:flutter/services.dart';
class ImageShowContainer extends StatelessWidget {
@ -21,7 +22,7 @@ class ImageShowContainer extends StatelessWidget {
body: ListView(
children: <Widget>[imageFromBase64String(data.data)],
),
floatingActionButton: MyFloatingActionButton(),
floatingActionButton: MyFloatingActionButton(data),
);
}
@ -42,6 +43,8 @@ class ImageShowModel {
}
class MyFloatingActionButton extends StatefulWidget {
final ImageShowModel data;
MyFloatingActionButton(this.data);
@override
_MyFloatingActionButtonState createState() => _MyFloatingActionButtonState();
}
@ -88,11 +91,11 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
child: Column(
children: <Widget>[
verticalSpaceSmall,
BusyButton(title: 'Электронная почта', onPressed: () {} , mainColor: primaryColor, icon: Icons.mail, ),
BusyButton(title: 'Электронная почта', onPressed: shareFile , mainColor: primaryColor, icon: Icons.mail, enabled: false, ),
verticalSpaceSmall,
BusyButton(title: 'WhatsApp', onPressed: () {} , mainColor: greenColor, icon: MdiIcons.whatsapp, ),
BusyButton(title: 'WhatsApp', onPressed: shareFile , mainColor: greenColor, icon: MdiIcons.whatsapp, enabled: false,),
verticalSpaceSmall,
BusyButton(title: '', onPressed: () {} , mainColor: yellowColor, icon: Icons.share,),
BusyButton(title: '', onPressed: shareFile , mainColor: yellowColor, icon: Icons.share,),
],
)
));
@ -103,30 +106,19 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
},
): Container() ;
}
void shareFile() async {
try {
await Share.file(
'Aman Kassa', 'aman_kassa_check.png', base64Decode(widget.data.data),
'image/png');
} catch (e) {
print('error: $e');
}
}
void showFoatingActionButton(bool value) {
setState(() {
showFab = value;
});
}
}
class DecoratedTextField extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.centerLeft,
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
//color: fillColor, borderRadius: BorderRadius.circular(10)
),
child: TextField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.mail_outline, color: primaryColor,),
labelStyle: TextStyle(color: primaryColor),
labelText: 'Отправить на Email',
),
));
}
}

View File

@ -22,7 +22,6 @@ class _ProductAddBottomSheetState extends State<ProductAddBottomSheet> {
@override
void initState() {
// TODO: implement initState
super.initState();
nameController = new TextEditingController();
countController = new TextEditingController();

View File

@ -40,7 +40,6 @@ class _PaymentViewState extends State<PaymentView> {
@override
void initState() {
// TODO: implement initState
super.initState();
isBusy = false;
}

View File

@ -14,7 +14,6 @@ class _StartUpViewState extends State<StartUpView> {
@override
void initState() {
// TODO: implement initState
super.initState();
Redux.store.dispatch(checkUserAction);
}

View File

@ -31,7 +31,7 @@ class _BusyButtonState extends State<BusyButton> {
return AnimatedContainer(
duration: const Duration(milliseconds: 300),
decoration: BoxDecoration(
color: widget.enabled ? ( widget.mainColor ?? primaryColor) : blueColorLigth,
color: widget.enabled ? ( widget.mainColor ?? primaryColor) : widget.mainColor?.withOpacity(0.2) ?? primaryColor.withOpacity(0.2),
borderRadius: BorderRadius.circular(7),
boxShadow: [
cardShadowBox
@ -40,7 +40,7 @@ class _BusyButtonState extends State<BusyButton> {
child: Material(
type: MaterialType.transparency,
child: InkWell(
onTap: widget.busy ? () {} : widget.onPressed,
onTap: widget.busy || !widget.enabled ? null : widget.onPressed,
child: AnimatedContainer(
height: widget.busy ? 40 : 40,
//width: widget.busy ? 40 : 40,