updated new flutter version
This commit is contained in:
@@ -22,6 +22,7 @@ class AddRemoveButton extends StatefulWidget {
|
||||
final bool addOnly;
|
||||
final int cartLineItemIndex;
|
||||
final bool addToBasket;
|
||||
final bool onHovor;
|
||||
|
||||
AddRemoveButton({
|
||||
this.product,
|
||||
@@ -29,6 +30,7 @@ class AddRemoveButton extends StatefulWidget {
|
||||
this.addOnly = false,
|
||||
this.cartLineItemIndex = -1,
|
||||
this.addToBasket = false,
|
||||
this.onHovor = false,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -72,7 +74,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top: 5.0, bottom: 5.0, left: 32.0, right: 32.0),
|
||||
child: Text(
|
||||
'x$_qty'
|
||||
'x$_qty'
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -121,13 +123,16 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
padding: EdgeInsets.all(10),
|
||||
position: BadgePosition.topEnd(top: -15, end: -10),
|
||||
badgeColor: Colors.lightBlueAccent,
|
||||
child: RaisedButton.icon(
|
||||
padding: EdgeInsets.only(left: 32, right: 32, top: 20, bottom: 20),
|
||||
elevation: 2.0,
|
||||
shape: new RoundedRectangleBorder(
|
||||
borderRadius: new BorderRadius.circular(10.0),
|
||||
child: ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.redAccent,
|
||||
onPrimary: Colors.white,
|
||||
padding: EdgeInsets.only(left: 32, right: 32, top: 20, bottom: 20),
|
||||
elevation: 2.0,
|
||||
shape: new RoundedRectangleBorder(
|
||||
borderRadius: new BorderRadius.circular(10.0),
|
||||
),
|
||||
),
|
||||
color: Colors.redAccent,
|
||||
icon: Icon(
|
||||
Icons.shopping_basket_outlined,
|
||||
size: 32.0,
|
||||
@@ -147,13 +152,15 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return RaisedButton.icon(
|
||||
padding: EdgeInsets.only(left: 32, right: 32, top: 20, bottom: 20),
|
||||
elevation: 2.0,
|
||||
shape: new RoundedRectangleBorder(
|
||||
borderRadius: new BorderRadius.circular(10.0),
|
||||
return ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.redAccent,
|
||||
padding: EdgeInsets.only(left: 32, right: 32, top: 20, bottom: 20),
|
||||
elevation: 2.0,
|
||||
shape: new RoundedRectangleBorder(
|
||||
borderRadius: new BorderRadius.circular(10.0),
|
||||
),
|
||||
),
|
||||
color: Colors.redAccent,
|
||||
icon: Icon(
|
||||
Icons.shopping_basket_outlined,
|
||||
size: 32.0,
|
||||
@@ -172,7 +179,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
},
|
||||
);
|
||||
}
|
||||
}else if (widget.addOnly) {
|
||||
} else if (widget.addOnly) {
|
||||
return Container(
|
||||
key: startKey,
|
||||
padding: EdgeInsets.all(0.0),
|
||||
@@ -235,6 +242,9 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
],
|
||||
);
|
||||
} else {
|
||||
if (!widget.onHovor && _qty == 0) {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
return new Row(
|
||||
key: startKey,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
@@ -337,28 +347,28 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
if (widget.cartLineItemIndex != -1) {
|
||||
if (cartInfo.productList[widget.cartLineItemIndex].quantity <= 1) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).warning),
|
||||
content: Text(S.of(context).are_you_sure_to_remove_the_item),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(S.of(context).cancel),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
FlatButton(
|
||||
child: Text(S.of(context).yes_i_am_sure),
|
||||
onPressed: () {
|
||||
_removeCartLineItem();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).warning),
|
||||
content: Text(S.of(context).are_you_sure_to_remove_the_item),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text(S.of(context).cancel),
|
||||
onPressed: () {
|
||||
Navigator.of(context).maybePop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: Text(S.of(context).yes_i_am_sure),
|
||||
onPressed: () {
|
||||
_removeCartLineItem();
|
||||
Navigator.of(context).maybePop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
_removeCartLineItem();
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../widgets/general/text_link.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../generated/l10n.dart';
|
||||
import '../../utils/utils.dart';
|
||||
import '../../utils/extensions.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
import '../../constants.dart';
|
||||
import '../../generated/l10n.dart';
|
||||
import '../../utils/extensions.dart';
|
||||
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
|
||||
import '../../utils/utils.dart';
|
||||
|
||||
class DownloadItem extends StatefulWidget {
|
||||
final dynamic desc;
|
||||
@@ -242,9 +241,11 @@ class DownloadItemState extends State<DownloadItem> {
|
||||
),
|
||||
);
|
||||
} else if (downloadUrl != null && downloadUrl.isNotEmpty) {
|
||||
return RaisedButton(
|
||||
color: Theme.of(context).primaryColor,
|
||||
padding: EdgeInsets.all(8.0),
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Theme.of(context).primaryColor,
|
||||
padding: EdgeInsets.all(8)
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@@ -95,7 +95,7 @@ class PaymentVerificationCodeDialogState extends State<PaymentVerificationCodeDi
|
||||
title: Text(S.of(context).error),
|
||||
content: Text(S.of(context).wrong_payment_verification_code),
|
||||
actions: [
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(S.of(context).ok),
|
||||
onPressed: () {
|
||||
_pinPutController.clear();
|
||||
@@ -124,7 +124,7 @@ class PaymentVerificationCodeDialogState extends State<PaymentVerificationCodeDi
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(S.of(context).close),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -215,7 +215,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
|
||||
|
||||
ScrollController _sc;
|
||||
bool _scrollingEnabled = false;
|
||||
VelocityTracker _vt = new VelocityTracker();
|
||||
VelocityTracker _vt = VelocityTracker.withKind(PointerDeviceKind.touch);
|
||||
|
||||
bool _isPanelVisible = true;
|
||||
|
||||
@@ -312,7 +312,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
|
||||
);
|
||||
},
|
||||
child: Stack(
|
||||
overflow: Overflow.visible,
|
||||
clipBehavior: Clip.none,
|
||||
children: <Widget>[
|
||||
|
||||
//open panel
|
||||
|
||||
Reference in New Issue
Block a user