v6.0.0 - Flutter format
This commit is contained in:
parent
e40b36a181
commit
f5d22921b9
@ -0,0 +1 @@
|
||||
|
||||
@ -516,8 +516,7 @@ Future<List<dynamic>> getWishlistProducts() async {
|
||||
String? currentProductsJSON =
|
||||
await (NyStorage.read(SharedKey.wishlistProducts));
|
||||
if (currentProductsJSON != null) {
|
||||
favouriteProducts =
|
||||
(jsonDecode(currentProductsJSON)).toList();
|
||||
favouriteProducts = (jsonDecode(currentProductsJSON)).toList();
|
||||
}
|
||||
return favouriteProducts;
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
|
||||
|
||||
import 'package:woosignal/models/response/order.dart';
|
||||
|
||||
class AccountOrderDetailPage extends NyStatefulWidget {
|
||||
|
||||
@ -19,7 +19,6 @@ import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
|
||||
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:woosignal/models/response/product_category.dart';
|
||||
import 'package:woosignal/models/response/products.dart' as ws_product;
|
||||
|
||||
@ -16,7 +16,6 @@ import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
|
||||
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:woosignal/models/response/products.dart' as ws_product;
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
|
||||
|
||||
class CheckoutPaymentTypePage extends StatefulWidget {
|
||||
CheckoutPaymentTypePage();
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ import 'package:nylo_framework/nylo_framework.dart';
|
||||
|
||||
import 'package:woosignal/models/response/order.dart' as ws_order;
|
||||
|
||||
|
||||
import '../widgets/woosignal_ui.dart';
|
||||
|
||||
class CheckoutStatusPage extends NyStatefulWidget {
|
||||
|
||||
@ -15,9 +15,6 @@ import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_swiper_tv/flutter_swiper.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
|
||||
|
||||
|
||||
|
||||
class ProductImageViewerPage extends NyStatefulWidget {
|
||||
@override
|
||||
final ProductImageViewerController controller =
|
||||
|
||||
@ -104,7 +104,13 @@ class _WishListPageWidgetState extends State<WishListPageWidget> {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(product.name!, style: TextStyle(fontWeight: FontWeight.bold), maxLines: 2, overflow: TextOverflow.ellipsis,),
|
||||
Text(
|
||||
product.name!,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
formatStringCurrency(
|
||||
total: product.price),
|
||||
|
||||
@ -176,18 +176,21 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
|
||||
onLoading: _onLoading,
|
||||
child: (products.isNotEmpty
|
||||
? ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: false,
|
||||
itemBuilder: (cxt, i) {
|
||||
return Container(
|
||||
// height: 200,
|
||||
width: MediaQuery.of(context).size.width / 2.5,
|
||||
child: ProductItemContainer(
|
||||
product: products[i], onTap: _showProduct),
|
||||
);
|
||||
},
|
||||
itemCount: products.length,
|
||||
)
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: false,
|
||||
itemBuilder: (cxt, i) {
|
||||
return Container(
|
||||
// height: 200,
|
||||
width:
|
||||
MediaQuery.of(context).size.width /
|
||||
2.5,
|
||||
child: ProductItemContainer(
|
||||
product: products[i],
|
||||
onTap: _showProduct),
|
||||
);
|
||||
},
|
||||
itemCount: products.length,
|
||||
)
|
||||
: NoResultsForProductsWidget()),
|
||||
),
|
||||
)
|
||||
|
||||
@ -73,9 +73,8 @@ class _NoticThemeWidgetState extends State<NoticThemeWidget> {
|
||||
),
|
||||
showSelectedLabels: false,
|
||||
showUnselectedLabels: false,
|
||||
items: allNavWidgets!
|
||||
.map((e) => e.bottomNavigationBarItem)
|
||||
.toList(),
|
||||
items:
|
||||
allNavWidgets!.map((e) => e.bottomNavigationBarItem).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -47,8 +47,8 @@ class ProductDetailBodyWidget extends StatelessWidget {
|
||||
// </Product reviews>
|
||||
|
||||
if (product != null)
|
||||
ProductDetailUpsellWidget(
|
||||
productIds: product!.upsellIds, wooSignalApp: wooSignalApp),
|
||||
ProductDetailUpsellWidget(
|
||||
productIds: product!.upsellIds, wooSignalApp: wooSignalApp),
|
||||
// </You may also like>
|
||||
|
||||
ProductDetailRelatedProductsWidget(
|
||||
|
||||
@ -28,7 +28,6 @@ class ProductDetailUpsellWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ProductDetailUpsellWidgetState extends State<ProductDetailUpsellWidget> {
|
||||
|
||||
final ProductLoaderController _productLoaderController =
|
||||
ProductLoaderController();
|
||||
|
||||
@ -73,18 +72,21 @@ class _ProductDetailUpsellWidgetState extends State<ProductDetailUpsellWidget> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: products
|
||||
.map((e) => Container(
|
||||
width: MediaQuery.of(context).size.width / 2.2,
|
||||
child: ProductItemContainer(product: e),),)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: products
|
||||
.map(
|
||||
(e) => Container(
|
||||
width: MediaQuery.of(context).size.width / 2.2,
|
||||
child: ProductItemContainer(product: e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ class SafeAreaWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return SafeArea(
|
||||
minimum: EdgeInsets.only(left: 16, right: 16, bottom: 8),
|
||||
child: child!,
|
||||
|
||||
@ -313,148 +313,134 @@ class ProductItemContainer extends StatelessWidget {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
return LayoutBuilder(
|
||||
builder: (cxt, constraints) =>
|
||||
InkWell(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: constraints.maxHeight / 2,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.grey[100],
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
),
|
||||
CachedImageWidget(
|
||||
image: (product!.images.isNotEmpty
|
||||
? product!.images.first.src
|
||||
: getEnv("PRODUCT_PLACEHOLDER_IMAGE")),
|
||||
fit: BoxFit.contain,
|
||||
height: constraints.maxHeight / 2,
|
||||
width: double.infinity,
|
||||
),
|
||||
if (product!.onSale! && product!.type != "variable")
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(3),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
text: '',
|
||||
style: Theme
|
||||
.of(context)
|
||||
builder: (cxt, constraints) => InkWell(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: constraints.maxHeight / 2,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.grey[100],
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
),
|
||||
CachedImageWidget(
|
||||
image: (product!.images.isNotEmpty
|
||||
? product!.images.first.src
|
||||
: getEnv("PRODUCT_PLACEHOLDER_IMAGE")),
|
||||
fit: BoxFit.contain,
|
||||
height: constraints.maxHeight / 2,
|
||||
width: double.infinity,
|
||||
),
|
||||
if (product!.onSale! && product!.type != "variable")
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(3),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
text: '',
|
||||
style: Theme.of(context).textTheme.bodyText1,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text:
|
||||
"${workoutSaleDiscount(salePrice: product!.salePrice, priceBefore: product!.regularPrice)}% ${trans("off")}",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text:
|
||||
"${workoutSaleDiscount(
|
||||
salePrice: product!.salePrice,
|
||||
priceBefore: product!
|
||||
.regularPrice)}% ${trans(
|
||||
"off")}",
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.bodyText1!
|
||||
.copyWith(
|
||||
.bodyText1!
|
||||
.copyWith(
|
||||
color: Colors.black87,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 2, bottom: 2),
|
||||
child: Text(
|
||||
product!.name!,
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.bodyText2!
|
||||
.copyWith(fontSize: 15),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AutoSizeText(
|
||||
"${formatStringCurrency(total: product!.price)} ",
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.bodyText2!
|
||||
.copyWith(fontWeight: FontWeight.w600),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
if (product!.onSale! && product!.type != "variable")
|
||||
RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text: '${trans("Was")}: ',
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.bodyText1!
|
||||
.copyWith(
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 2, bottom: 2),
|
||||
child: Text(
|
||||
product!.name!,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText2!
|
||||
.copyWith(fontSize: 15),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AutoSizeText(
|
||||
"${formatStringCurrency(total: product!.price)} ",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText2!
|
||||
.copyWith(fontWeight: FontWeight.w600),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
if (product!.onSale! && product!.type != "variable")
|
||||
RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text: '${trans("Was")}: ',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1!
|
||||
.copyWith(
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: formatStringCurrency(
|
||||
total: product!.regularPrice,
|
||||
),
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.bodyText1!
|
||||
.copyWith(
|
||||
),
|
||||
TextSpan(
|
||||
text: formatStringCurrency(
|
||||
total: product!.regularPrice,
|
||||
),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1!
|
||||
.copyWith(
|
||||
decoration: TextDecoration.lineThrough,
|
||||
color: Colors.grey,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
].toList(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
].toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () =>
|
||||
onTap != null
|
||||
? onTap!(product)
|
||||
: Navigator.pushNamed(context, "/product-detail",
|
||||
arguments: product),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () => onTap != null
|
||||
? onTap!(product)
|
||||
: Navigator.pushNamed(context, "/product-detail",
|
||||
arguments: product),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user