backup. before shop update

This commit is contained in:
2021-08-31 13:28:33 -04:00
parent c378a6203c
commit 808ffa3211
292 changed files with 51551 additions and 695 deletions

View File

@@ -1,14 +1,25 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/models/user.dart';
import '../../models/located_address.dart';
import '../../models/cart_info.dart';
import '../../models/user.dart';
@immutable
class AppState {
final BuildContext context;
final Locale locale;
final User user;
final String redirectRoute;
final List<CartInfo> cartInfos;
final LocatedAddress locatedAddress;
final String fcmToken;
final List<int> lastVisit;
final String deviceId;
final String tableNumber;
AppState({this.context, this.locale, this.user});
AppState({this.context, this.locale, this.user, this.redirectRoute,
this.cartInfos, this.locatedAddress, this.fcmToken, this.lastVisit,
this.deviceId, this.tableNumber});
factory AppState.init() => AppState();
@@ -19,6 +30,13 @@ class AppState {
context: context ?? this.context,
locale: locale ?? this.locale,
user: user ?? this.user,
redirectRoute: redirectRoute ?? this.redirectRoute,
cartInfos: cartInfos ?? this.cartInfos,
locatedAddress: locatedAddress ?? this.locatedAddress,
fcmToken: fcmToken ?? this.fcmToken,
lastVisit: lastVisit ?? this.lastVisit,
deviceId: deviceId ?? this.deviceId,
tableNumber: tableNumber ?? this.tableNumber
);
}
@@ -26,7 +44,15 @@ class AppState {
int get hashCode =>
context.hashCode ^
locale.hashCode ^
user.hashCode;
user.hashCode ^
redirectRoute.hashCode ^
cartInfos.hashCode ^
locatedAddress.hashCode ^
fcmToken.hashCode ^
lastVisit.hashCode ^
deviceId.hashCode ^
tableNumber.hashCode;
@override
bool operator ==(Object other) =>
@@ -34,9 +60,20 @@ class AppState {
other is AppState &&
context == other.context &&
locale == other.locale &&
user == other.user;
user == other.user &&
redirectRoute == other.redirectRoute &&
cartInfos == other.cartInfos &&
locatedAddress == other.locatedAddress &&
fcmToken == other.fcmToken &&
lastVisit == other.lastVisit &&
deviceId == other.deviceId &&
tableNumber == other.tableNumber;
@override
String toString() =>
'AppState(context: $context, locale: $locale), user: $user';
'AppState(context: $context, locale: $locale), user: $user, '
'redirectRoute: $redirectRoute, cart info: $cartInfos, '
'locate address: $locatedAddress, fcm: $fcmToken, '
'last visit: $lastVisit, deviceId: $deviceId, '
'tableNumber: $tableNumber';
}