Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import 'utils/shared_pref..dart';
import 'utils/string.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SharedPref.shared.getPref();
Expand Down
2 changes: 1 addition & 1 deletion lib/view/auth/login/otp_verification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _OTPVerificationState extends State<OTPVerification> {
padding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: Text(
"${translation(context).entertheotpsentto} $mobile",
"${translation(context).entertheotpsentto} $mobile",//translation(context).entertheotpsentto
style: const TextStyle(
color: colors.lightTextColor,
fontSize: 16,
Expand Down
4 changes: 2 additions & 2 deletions lib/view/auth/login/sign_in.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ class _SignInState extends State<SignIn> {
mobileOrEmailController.text, data);
},
style: ElevatedButton.styleFrom(
primary: colors.buttonColor,
onPrimary: colors.textColor,
backgroundColor: colors.buttonColor,
// onPrimary: colors.textColor,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
Expand Down
3 changes: 1 addition & 2 deletions lib/view/auth/signup/sign_up.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ class _SignUPState extends State<SignUP> {
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 10),
child: Text(
translation(context)
.createanaccounttoviewandmanageyourprojects,
translation(context).createanaccounttoviewandmanageyourprojects,
style: const TextStyle(
color: colors.lightTextColor, fontSize: 15),
),
Expand Down
8 changes: 6 additions & 2 deletions lib/view/cart/cards/cartCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:alpha_ecommerce_18oct/utils/color.dart';
import 'package:alpha_ecommerce_18oct/utils/routes.dart';
import 'package:alpha_ecommerce_18oct/view/cart/model/cartModel.dart';
import 'package:alpha_ecommerce_18oct/view/home/models/productsModel.dart';
import 'package:alpha_ecommerce_18oct/view/widget_common/app_image.dart';
import 'package:alpha_ecommerce_18oct/view/widget_common/toast_message.dart';
import 'package:alpha_ecommerce_18oct/viewModel/cartViewModel.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
Expand All @@ -19,6 +20,8 @@ cartCard(
quantity.add("$i");
}

print('${model.images[0]}___________Dfdfsd');

return Padding(
padding: const EdgeInsets.only(left: 10.0, top: 8, right: 10, bottom: 8),
child: Container(
Expand All @@ -45,11 +48,12 @@ cartCard(
Routes.navigateToProductDetailPageScreen(
context, model as ProductList);
},
child: Image.network(
child: AppImage(image: model.thumbnail,width: 110,
height: 140,)/*Image.network(
model.images[0],
width: 110,
height: 140,
),
),*/
),
const SizedBox(width: 30),
Column(
Expand Down
6 changes: 3 additions & 3 deletions lib/view/cart/model/cartModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class CartProduct {
unit: json["unit"],
minQty: json["min_qty"],
featured: json["featured"],
refundable: json["refundable"],
refundable: int.tryParse(json["refundable"]) ?? 0,
variantCartProduct: json["variant_product"],
attributes: List<int>.from(json["attributes"].map((x) => x)),
choiceOptions: List<ChoiceOption>.from(
Expand Down Expand Up @@ -594,8 +594,8 @@ class Shop {
});

factory Shop.fromJson(Map<String, dynamic> json) => Shop(
id: json["id"],
sellerId: json["seller_id"],
id: int.parse(json["id"].toString()),
sellerId: int.parse(json["seller_id"].toString()),
name: json["name"],
address: json["address"],
contact: json["contact"],
Expand Down
2 changes: 1 addition & 1 deletion lib/view/category/category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class _AllCategoryState extends State<AllCategory> {
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
primary: isSelected ? colors.buttonColor : Colors.transparent,
backgroundColor: isSelected ? colors.buttonColor : Colors.transparent,
),
child: Text(
label,
Expand Down
3 changes: 0 additions & 3 deletions lib/view/category/categoryCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ categoryCard(
onTap: () {
searchProvider.categoryId = categoryId;
searchProvider.subCategoryId = model.id!.toString();
print("Category Id ${searchProvider.categoryId}");
print("Sub Category Id ${searchProvider.subCategoryId}");

searchProvider.isHome = false;
Routes.navigateToSearchScreen(context);
searchProvider.getProductsListNew(context, "25", "1");
Expand Down
37 changes: 23 additions & 14 deletions lib/view/home/models/productsModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import 'dart:convert';

ProductsModel productsModelFromJson(String str) =>
ProductsModel.fromJson(json.decode(str));
ProductsModel productsModelFromJson(String str) => ProductsModel.fromJson(json.decode(str));

String productsModelToJson(ProductsModel data) => json.encode(data.toJson());

Expand Down Expand Up @@ -149,7 +148,12 @@ class ProductList {
required this.cart_id,
});

factory ProductList.fromJson(Map<String, dynamic> json) => ProductList(
factory ProductList.fromJson(Map<String, dynamic> json) {

try {
return ProductList(


id: json["id"],
categoryIds: List<CategoryId>.from(
json["category_ids"].map((x) => CategoryId.fromJson(x))),
Expand All @@ -165,7 +169,7 @@ class ProductList {
unit: json["unit"]!,
minQty: json["min_qty"],
featured: json["featured"],
refundable: json["refundable"],
refundable: int.tryParse(json["refundable"]) ?? 0,
variantProduct: json["variant_product"],
attributes: List<int>.from(json["attributes"].map((x) => x)),
choiceOptions: List<ChoiceOption>.from(
Expand Down Expand Up @@ -198,19 +202,26 @@ class ProductList {
multiplyQty: json["multiply_qty"],
code: json["code"],
reviewsCount: json["reviews_count"],
rating:
List<Rating>.from(json["rating"].map((x) => Rating.fromJson(x))),
rating: List<Rating>.from(
json["rating"].map((x) => Rating.fromJson(x))),
tags: List<Tag>.from(json["tags"].map((x) => Tag.fromJson(x))),
translations: List<dynamic>.from(json["translations"].map((x) => x)),
shareLink: json["share_link"],
reviews:
List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
reviews: List<Review>.from(
json["reviews"].map((x) => Review.fromJson(x))),
colorsFormatted: List<ColorsFormatted>.from(
json["colors_formatted"].map((x) => ColorsFormatted.fromJson(x))),
isFavorite: json["is_favorite"],
isCart: json["is_cart"],
cart_id: json["cart_id"],
);
}catch(e, stacktrace) {
print('❌ Error parsing YourModel: $e');
print('Stacktrace: $stacktrace');
rethrow;
}
}


Map<String, dynamic> toJson() => {
"id": id,
Expand All @@ -229,8 +240,7 @@ class ProductList {
"refundable": refundable,
"variant_product": variantProduct,
"attributes": List<dynamic>.from(attributes.map((x) => x)),
"choice_options":
List<dynamic>.from(choiceOptions.map((x) => x.toJson())),
"choice_options": List<dynamic>.from(choiceOptions.map((x) => x.toJson())),
"variation": List<dynamic>.from(variation.map((x) => x.toJson())),
"weight": weight,
"published": published,
Expand Down Expand Up @@ -263,8 +273,7 @@ class ProductList {
"translations": List<dynamic>.from(translations.map((x) => x)),
"share_link": shareLink,
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
"colors_formatted":
List<dynamic>.from(colorsFormatted.map((x) => x.toJson())),
"colors_formatted": List<dynamic>.from(colorsFormatted.map((x) => x.toJson())),
"is_favorite": isFavorite,
"is_cart": isCart,
"cart_id": cart_id,
Expand Down Expand Up @@ -529,8 +538,8 @@ class Shop {
});

factory Shop.fromJson(Map<String, dynamic> json) => Shop(
id: json["id"],
sellerId: json["seller_id"],
id: int.tryParse(json['id'].toString()) ?? 0,
sellerId: int.tryParse(json['seller_id'].toString()) ?? 0,
name: json["name"]!,
address: json["address"]!,
contact: json["contact"],
Expand Down
4 changes: 2 additions & 2 deletions lib/view/order/orderDetailDelivered.dart
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ class _OrderDetailDeliveredState extends State<OrderDetailDelivered> {
width: 200,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: colors.buttonColor,
onPrimary: Colors.white,
backgroundColor: colors.buttonColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/view/order/orderDetailOnTheWay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ class _OrderDetailOnTheWayState extends State<OrderDetailOnTheWay> {
width: 200,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: colors.buttonColor,
onPrimary: Colors.white,
backgroundColor: colors.buttonColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Expand Down
5 changes: 3 additions & 2 deletions lib/view/productDetail/recommendedProductCard.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:alpha_ecommerce_18oct/utils/app_dimens/app_dimens.dart';
import 'package:alpha_ecommerce_18oct/view/home/models/productsModel.dart';
import 'package:alpha_ecommerce_18oct/view/widget_common/app_image.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:like_button/like_button.dart';
Expand Down Expand Up @@ -38,10 +39,10 @@ recommendedProductCard({required context, required List<ProductList> model}) {
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: CachedNetworkImage(
child: AppImage(image: card.images.first,) /*CachedNetworkImage(
imageUrl: card.images.first,
fit: BoxFit.fitWidth,
)),
)*/),
SizedBox(height: MediaQuery.of(context).size.height * 0.0005),
Padding(
padding: const EdgeInsets.symmetric(
Expand Down
3 changes: 1 addition & 2 deletions lib/view/profile/address/addressList.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ class _AddressListScreenState extends State<AddressListScreen> {
Routes.navigateToManageAddressScreen(context);
},
style: ElevatedButton.styleFrom(
primary: colors.buttonColor,
onPrimary: Colors.white,
foregroundColor: Colors.white, backgroundColor: colors.buttonColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/view/profile/address/manage_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ class _ManageAddressState extends State<ManageAddress> {
addressProvider.getCurrentLoc(context);
},
style: ElevatedButton.styleFrom(
primary: colors.buttonColor,
onPrimary: Colors.white,
foregroundColor: Colors.white, backgroundColor: colors.buttonColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/view/profile/payment/refund/refundHistory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class _RefundHistoryState extends State<RefundHistory> {

return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColor.withOpacity(0.2),
onPrimary: textColor,
backgroundColor: buttonColor.withOpacity(0.2),
foregroundColor: textColor,
),
onPressed: () {},
child: Text(isSuccess ? "SUCCESS" : "unsuccessful"),
Expand Down
4 changes: 2 additions & 2 deletions lib/view/profile/payment/refund/refundHistoryCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ Widget buildCustomButton(bool isSuccess) {

return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColor.withOpacity(0.2),
onPrimary: textColor,
backgroundColor: buttonColor.withOpacity(0.2),
foregroundColor: textColor,
),
onPressed: () {},
child: Text(isSuccess ? "SUCCESS" : "unsuccessful"),
Expand Down
8 changes: 4 additions & 4 deletions lib/view/profile/payment/refund/singleRefund.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ class _SingleRefundState extends State<SingleRefund> {
width: MediaQuery.of(context).size.width * 0.54,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary:
backgroundColor:
const Color(0xff2568EE).withOpacity(0.2),
onPrimary: colors.textColor,
foregroundColor: colors.textColor,
),
onPressed: () {},
child: const Row(
Expand Down Expand Up @@ -272,8 +272,8 @@ class _SingleRefundState extends State<SingleRefund> {

return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColor.withOpacity(0.2),
onPrimary: textColor,
backgroundColor: buttonColor.withOpacity(0.2),
foregroundColor: textColor,
),
onPressed: () {},
child: Text(isSuccess ? "SUCCESS" : "unsuccessful"),
Expand Down
8 changes: 4 additions & 4 deletions lib/view/profile/subscribe/subscribe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ class _SubscribeState extends State<Subscribe> {
0.3,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.white,
onPrimary: Colors.black,
backgroundColor: Colors.white,
foregroundColor: Colors.black,
padding: EdgeInsets.zero,
),
onPressed: () {
Expand Down Expand Up @@ -530,8 +530,8 @@ class _SubscribeState extends State<Subscribe> {
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
primary: isSelected ? Colors.white : Colors.transparent,
onPrimary: textColor,
backgroundColor: isSelected ? Colors.white : Colors.transparent,
foregroundColor: textColor,
),
child: Text(
label,
Expand Down
5 changes: 3 additions & 2 deletions lib/view/search/productsForYouCardSearch.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:alpha_ecommerce_18oct/utils/app_dimens/app_dimens.dart';
import 'package:alpha_ecommerce_18oct/view/home/models/productsModel.dart';
import 'package:alpha_ecommerce_18oct/view/widget_common/app_image.dart';
import 'package:alpha_ecommerce_18oct/viewModel/homeViewModel.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -41,10 +42,10 @@ productForYouCardSearch(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: CachedNetworkImage(
child: AppImage(image: model.images.first,)/*CachedNetworkImage(
imageUrl: model.images.first,
fit: BoxFit.fitWidth,
)),
)*/),
SizedBox(height: MediaQuery.of(context).size.height * 0.0005),
Padding(
padding: const EdgeInsets.symmetric(
Expand Down
11 changes: 3 additions & 8 deletions lib/view/search/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ class _SearchState extends State<Search> {
child: Column(
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 20),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
// height: MediaQuery.of(context).size.height *
// 0.5 *
// searchProvider.searchResults.length /
Expand All @@ -354,17 +353,13 @@ class _SearchState extends State<Search> {
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: const NeverScrollableScrollPhysics(),
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 0.68,
),
itemCount: searchProvider.searchResults.length,
itemBuilder: (context, j) {
return productForYouCardSearch(
searchProvider.searchResults[j],
context,
homeProvider);
return productForYouCardSearch(searchProvider.searchResults[j], context, homeProvider);
},
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/vendor/vendorDetails.dart
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class _VendorDetailsState extends State<VendorDetails> {
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
primary: isSelected ? colors.buttonColor : Colors.transparent,
backgroundColor: isSelected ? colors.buttonColor : Colors.transparent,
),
child: Text(
label,
Expand Down
Loading