initial commit to gitea
This commit is contained in:
@@ -4,11 +4,13 @@ import 'package:flutter/rendering.dart';
|
||||
|
||||
import '../../generated/l10n.dart';
|
||||
import '../../routes.dart';
|
||||
import 'navigationbar.dart';
|
||||
|
||||
class BreadCrumbs extends StatelessWidget {
|
||||
final List<BreadCrumb> breadCrumbs;
|
||||
final bool hasBack;
|
||||
const BreadCrumbs(this.hasBack, {this.breadCrumbs, Key key}) : super(key: key);
|
||||
final OnBackPress onBackPress;
|
||||
const BreadCrumbs(this.hasBack, {this.breadCrumbs, Key key, this.onBackPress}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -39,8 +41,8 @@ class BreadCrumbs extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
Routes.router.pop(context);
|
||||
onTap: onBackPress != null ? onBackPress : () {
|
||||
Navigator.of(context).maybePop();
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -72,7 +74,7 @@ class BreadCrumbs extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 0.0),
|
||||
padding: EdgeInsets.only(top: 6.0, left: 4.0, right: 4.0),
|
||||
child: Icon(
|
||||
Icons.circle,
|
||||
size: 6.0,
|
||||
@@ -123,7 +125,7 @@ class BreadCrumbs extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 0.0),
|
||||
padding: EdgeInsets.only(top: 6.0, left: 4.0, right: 4.0),
|
||||
child: Icon(
|
||||
Icons.circle,
|
||||
size: 6.0,
|
||||
|
||||
@@ -6,7 +6,9 @@ import '../../widgets/desktop/desktop_navigationbar.dart';
|
||||
import '../../widgets/mobile/mobile_navigationbar.dart';
|
||||
import 'breadcrumbs.dart';
|
||||
|
||||
class NavigationBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
typedef OnBackPress();
|
||||
|
||||
class MiniNavigationBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
final Key key;
|
||||
final String title;
|
||||
final bool back;
|
||||
@@ -16,7 +18,7 @@ class NavigationBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
final double breadCrumbHeight;
|
||||
final Widget shoppingCart;
|
||||
|
||||
NavigationBar({Key key, PreferredSizeWidget bottom, String title,
|
||||
MiniNavigationBar({Key key, PreferredSizeWidget bottom, String title,
|
||||
bool back, bool toHome, bool showMe, this.breadCrumbs,
|
||||
this.breadCrumbHeight, this.shoppingCart})
|
||||
: key = key,
|
||||
@@ -32,12 +34,12 @@ class NavigationBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return NavigationBarState();
|
||||
return MiniNavigationBarState();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class NavigationBarState extends State<NavigationBar> {
|
||||
class MiniNavigationBarState extends State<MiniNavigationBar> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -33,6 +33,9 @@ class PaymentVerificationCodeDialogState extends State<PaymentVerificationCodeDi
|
||||
String getCodeText = '';
|
||||
String paymentCodeEncrypt = '';
|
||||
|
||||
String verifyMethod;
|
||||
String verifyName;
|
||||
|
||||
final TextEditingController _pinPutController = TextEditingController();
|
||||
final FocusNode _pinPutFocusNode = FocusNode();
|
||||
BoxDecoration get _pinPutDecoration {
|
||||
@@ -53,12 +56,15 @@ class PaymentVerificationCodeDialogState extends State<PaymentVerificationCodeDi
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 0.0, right: 0.0),
|
||||
child: Text(
|
||||
S.of(context).payment_verification_sent(Utils.safePhoneNumber(widget.user.mobile)),
|
||||
(verifyMethod != null) ? S.of(context).payment_verification_sent(
|
||||
(verifyName == 'sms') ? S.of(context).mobile : S.of(context).email,
|
||||
Utils.safePhoneNumber(verifyName)
|
||||
) : '',
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 0.0, right: 0.0),
|
||||
child: FlatButton(
|
||||
child: TextButton(
|
||||
child: Text(getCodeText),
|
||||
onPressed: enableGetCode ? () {
|
||||
getPaymentCode();
|
||||
@@ -146,6 +152,8 @@ class PaymentVerificationCodeDialogState extends State<PaymentVerificationCodeDi
|
||||
},
|
||||
).then((data) {
|
||||
paymentCodeEncrypt = data['payment_code_encrypt'];
|
||||
verifyMethod = data['verify_method'];
|
||||
verifyName = data['verify_name'];
|
||||
print('data: $data');
|
||||
startCountDown();
|
||||
}).catchError((error) {
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/models/business.dart';
|
||||
import 'package:flutter_wisetronic/models/product.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_product_item.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_product_item.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
class ProductItem extends StatelessWidget {
|
||||
final Product product;
|
||||
final Business business;
|
||||
|
||||
const ProductItem({Key key, this.product, this.business}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileProductItem(product: product, business: business,),
|
||||
tablet: DesktopProductItem(product: product, business: business,),
|
||||
desktop: DesktopProductItem(product: product, business: business,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import 'package:fluro/fluro.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_wisetronic/utils/utils.dart';
|
||||
import 'package:hovering/hovering.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../routes.dart';
|
||||
@@ -11,6 +12,7 @@ class TextLink extends StatelessWidget {
|
||||
final String title;
|
||||
final String url;
|
||||
final Color color;
|
||||
final Color hoverColor;
|
||||
final double paddingHorizontal;
|
||||
final double paddingVertical;
|
||||
final FontWeight fontWeight;
|
||||
@@ -24,8 +26,14 @@ class TextLink extends StatelessWidget {
|
||||
final bool closeDrawer;
|
||||
final bool isEmail;
|
||||
final bool isPhone;
|
||||
final double fontSize;
|
||||
final bool isAddress;
|
||||
final TextOverflow overflow;
|
||||
final int maxLines;
|
||||
|
||||
TextLink(this.title, this.url, {
|
||||
this.color,
|
||||
this.hoverColor,
|
||||
this.paddingHorizontal,
|
||||
this.paddingVertical,
|
||||
this.fontWeight,
|
||||
@@ -39,6 +47,10 @@ class TextLink extends StatelessWidget {
|
||||
bool closeDrawer,
|
||||
bool isEmail,
|
||||
bool isPhone,
|
||||
double fontSize,
|
||||
bool isAddress,
|
||||
TextOverflow overflow,
|
||||
int maxLines,
|
||||
}) :
|
||||
isLink = isLink ?? false,
|
||||
replace = replace ?? false,
|
||||
@@ -47,7 +59,11 @@ class TextLink extends StatelessWidget {
|
||||
rootNavigator = rootNavigator ?? false,
|
||||
closeDrawer = closeDrawer ?? false,
|
||||
isEmail = isEmail ?? false,
|
||||
isPhone = isPhone ?? false;
|
||||
isPhone = isPhone ?? false,
|
||||
fontSize = fontSize ?? null,
|
||||
isAddress = isAddress ?? false,
|
||||
overflow = overflow ?? TextOverflow.ellipsis,
|
||||
maxLines = maxLines ?? 1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -59,19 +75,37 @@ class TextLink extends StatelessWidget {
|
||||
vertical: paddingVertical ?? 0.0,
|
||||
horizontal: paddingHorizontal ?? 0.0
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: color ?? Colors.blue,
|
||||
fontWeight: fontWeight ?? FontWeight.normal,
|
||||
child: HoverWidget(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: color ?? Colors.blue,
|
||||
fontWeight: fontWeight ?? FontWeight.normal,
|
||||
fontSize: fontSize,
|
||||
),
|
||||
overflow: overflow,
|
||||
maxLines: maxLines,
|
||||
),
|
||||
hoverChild: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: hoverColor ?? Colors.grey,
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeight ?? FontWeight.normal,
|
||||
),
|
||||
overflow: overflow,
|
||||
maxLines: maxLines,
|
||||
),
|
||||
onHover: (event) {
|
||||
|
||||
},
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: (selected != null && selected) ? Border(
|
||||
bottom: BorderSide(
|
||||
color: color ?? Colors.blue,
|
||||
width: 3.0,
|
||||
)
|
||||
bottom: BorderSide(
|
||||
color: color ?? Colors.blue,
|
||||
width: 3.0,
|
||||
)
|
||||
) : null,
|
||||
),
|
||||
),
|
||||
@@ -81,6 +115,8 @@ class TextLink extends StatelessWidget {
|
||||
Utils.openEmail(url);
|
||||
} else if (isPhone) {
|
||||
Utils.callPhone(url);
|
||||
} else if (isAddress) {
|
||||
await launch('https://maps.google.com/?q=${url}');
|
||||
} else if (!isLink) {
|
||||
if (closeDrawer) {
|
||||
Routes.router.pop(context);
|
||||
|
||||
Reference in New Issue
Block a user