BASE: Update Icons & Name Of The App.

This commit is contained in:
2025-12-04 10:23:59 +05:00
parent b04050384d
commit e602782edd
228 changed files with 34364 additions and 7905 deletions

View File

@@ -5,12 +5,12 @@ import 'package:customer/models/cart_product_model.dart';
import 'package:customer/themes/custom_dialog_box.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import 'database_helper.dart';
class CartProvider with ChangeNotifier {
final _cartStreamController = StreamController<List<CartProductModel>>.broadcast();
final _cartStreamController =
StreamController<List<CartProductModel>>.broadcast();
List<CartProductModel> _cartItems = [];
Stream<List<CartProductModel>> get cartStream => _cartStreamController.stream;
@@ -24,7 +24,11 @@ class CartProvider with ChangeNotifier {
_cartStreamController.sink.add(_cartItems);
}
Future<void> addToCart(BuildContext context, CartProductModel product, int quantity) async {
Future<void> addToCart(
BuildContext context,
CartProductModel product,
int quantity,
) async {
_cartItems = await DatabaseHelper.instance.fetchCartProducts();
if ((_cartItems.where((item) => item.id == product.id)).isNotEmpty) {
var index = _cartItems.indexWhere((item) => item.id == product.id);
@@ -38,7 +42,10 @@ class CartProvider with ChangeNotifier {
}
await DatabaseHelper.instance.updateCartProduct(_cartItems[index]);
} else {
if (_cartItems.isEmpty || _cartItems.where((item) => item.vendorID == product.vendorID).isNotEmpty) {
if (_cartItems.isEmpty ||
_cartItems
.where((item) => item.vendorID == product.vendorID)
.isNotEmpty) {
product.quantity = quantity;
_cartItems.add(product);
cartItem.add(product);
@@ -50,7 +57,9 @@ class CartProvider with ChangeNotifier {
builder: (BuildContext context) {
return CustomDialogBox(
title: "Alert".tr(),
descriptions: "Your cart already contains items from another restaurant. Would you like to replace them with items from this restaurant instead?".tr(),
descriptions:
"Your cart already contains items from another restaurant. Would you like to replace them with items from this restaurant instead?"
.tr(),
positiveString: "Add".tr(),
negativeString: "Cancel".tr(),
positiveClick: () async {

View File

@@ -14,7 +14,7 @@ import 'package:firebase_auth/firebase_auth.dart' as auth;
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/cupertino.dart';
import 'package:geocoding/geocoding.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import 'package:intl/intl.dart';
import 'package:uuid/uuid.dart';
import 'package:video_compress/video_compress.dart';
@@ -85,7 +85,7 @@ class FireStoreUtils {
static String getCurrentUid() {
final user = auth.FirebaseAuth.instance.currentUser;
if(user != null){
if (user != null) {
return user.uid;
}
return "hello";

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import '../lang/app_en.dart';
class LocalizationService extends Translations {