fixedlocationhomepage
This commit is contained in:
@@ -992,7 +992,7 @@
|
|||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"generated": "2025-02-14T13:22:19.642868Z",
|
"generated": "2025-02-22T07:04:58.909640Z",
|
||||||
"generator": "pub",
|
"generator": "pub",
|
||||||
"generatorVersion": "3.4.4",
|
"generatorVersion": "3.4.4",
|
||||||
"flutterRoot": "file:///Users/rajeevsingh/Documents/allSoftwares/flutter",
|
"flutterRoot": "file:///Users/rajeevsingh/Documents/allSoftwares/flutter",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -293,7 +293,7 @@ class AddtocartProvider extends ChangeNotifier {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
print("ksdjfkgjlhdfkg ${data}");
|
|
||||||
try {
|
try {
|
||||||
var result = await _homeRepo.paymentOrder(data);
|
var result = await _homeRepo.paymentOrder(data);
|
||||||
return result.fold(
|
return result.fold(
|
||||||
@@ -319,6 +319,15 @@ class AddtocartProvider extends ChangeNotifier {
|
|||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ispaymentLoader = false;
|
ispaymentLoader = false;
|
||||||
|
|
||||||
|
Fluttertoast.showToast(
|
||||||
|
msg: "Internal server error!",
|
||||||
|
toastLength: Toast.LENGTH_SHORT,
|
||||||
|
gravity: ToastGravity.CENTER,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
textColor: Colors.white,
|
||||||
|
fontSize: 14.0,
|
||||||
|
);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
import 'package:geolocator/geolocator.dart';
|
||||||
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:grocery_app/src/core/network_services/service_locator.dart';
|
import 'package:grocery_app/src/core/network_services/service_locator.dart';
|
||||||
import 'package:grocery_app/src/core/routes/routes.dart';
|
import 'package:grocery_app/src/core/routes/routes.dart';
|
||||||
import 'package:grocery_app/src/data/allProduct_model.dart';
|
import 'package:grocery_app/src/data/allProduct_model.dart';
|
||||||
@@ -13,6 +17,10 @@ import 'package:grocery_app/src/logic/repo/product_repo.dart';
|
|||||||
import 'package:grocery_app/utils/constants/shared_pref_utils.dart';
|
import 'package:grocery_app/utils/constants/shared_pref_utils.dart';
|
||||||
import 'package:grocery_app/utils/extensions/extensions.dart';
|
import 'package:grocery_app/utils/extensions/extensions.dart';
|
||||||
|
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class ProductProvider extends ChangeNotifier {
|
class ProductProvider extends ChangeNotifier {
|
||||||
final _homeRepo = getIt<ProductRepo>();
|
final _homeRepo = getIt<ProductRepo>();
|
||||||
|
|
||||||
@@ -95,21 +103,24 @@ class ProductProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
List<Product> homeproducts = [];
|
List<Product> homeproducts = [];
|
||||||
|
|
||||||
|
Future<void> getHomeProduct(BuildContext context, String id, String search,
|
||||||
Future<void> getHomeProduct(BuildContext context,String id, String search) async
|
String minPrice, String maxprice, orderby) async {
|
||||||
{
|
|
||||||
isHomeLoadingg = true;
|
isHomeLoadingg = true;
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
var data = {"minPrice": "", "minPrice": "", "search": search};
|
var data = {
|
||||||
var result = await _homeRepo.getAllProduct(data, context,id);
|
"minPrice": "${minPrice}",
|
||||||
|
"minPrice": "${maxprice}",
|
||||||
|
"search": search,
|
||||||
|
"sortBy": orderby
|
||||||
|
};
|
||||||
|
var result = await _homeRepo.getAllProduct(data, context, id);
|
||||||
return result.fold(
|
return result.fold(
|
||||||
(error) {
|
(error) {
|
||||||
isLoadingg = false;
|
isLoadingg = false;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
},
|
},
|
||||||
(response)
|
(response) {
|
||||||
{
|
|
||||||
homeproducts = response.data!;
|
homeproducts = response.data!;
|
||||||
|
|
||||||
isHomeLoadingg = false;
|
isHomeLoadingg = false;
|
||||||
@@ -147,8 +158,7 @@ class ProductProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
bool isBestdealingloading = true;
|
bool isBestdealingloading = true;
|
||||||
|
|
||||||
Future<void> getBestDealProduct(BuildContext context,String search) async
|
Future<void> getBestDealProduct(BuildContext context, String search) async {
|
||||||
{
|
|
||||||
isBestdealingloading = true;
|
isBestdealingloading = true;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
var data = {"minPrice": "", "minPrice": "", "search": search};
|
var data = {"minPrice": "", "minPrice": "", "search": search};
|
||||||
@@ -166,9 +176,6 @@ class ProductProvider extends ChangeNotifier {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<Datum> categoryList = [];
|
List<Datum> categoryList = [];
|
||||||
|
|
||||||
bool iscategroyloading = true;
|
bool iscategroyloading = true;
|
||||||
@@ -675,4 +682,83 @@ class ProductProvider extends ChangeNotifier {
|
|||||||
_selectedIndex = index;
|
_selectedIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> determinePosition() async {
|
||||||
|
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||||
|
if (!serviceEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LocationPermission permission = await Geolocator.requestPermission();
|
||||||
|
if (permission == LocationPermission.denied) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Position position = await Geolocator.getCurrentPosition(
|
||||||
|
desiredAccuracy: LocationAccuracy.high,
|
||||||
|
);
|
||||||
|
LatLng currentLatLng = LatLng(position.latitude, position.longitude);
|
||||||
|
|
||||||
|
_getAddressFromLatLng(position.latitude, position.longitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
String googleApiKey = "AIzaSyAi3_Dls63iGs7Nccgdm-4FkS0rhT03-4U";
|
||||||
|
|
||||||
|
String getCurrentAdd = '';
|
||||||
|
|
||||||
|
Future<void> _getAddressFromLatLng(double lat, double lng) async {
|
||||||
|
final String url =
|
||||||
|
"https://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$lng&key=$googleApiKey";
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await http.get(Uri.parse(url));
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
final data = json.decode(response.body);
|
||||||
|
if (data["status"] == "OK") {
|
||||||
|
var result = data["results"][0]; // First result is most accurate
|
||||||
|
|
||||||
|
// _RoadController.text = result["formatted_address"];
|
||||||
|
List components = result["address_components"];
|
||||||
|
|
||||||
|
String roadName = "";
|
||||||
|
String colony = "";
|
||||||
|
String buildingName = "";
|
||||||
|
String pincode = "";
|
||||||
|
|
||||||
|
for (var component in components) {
|
||||||
|
List types = component["types"];
|
||||||
|
if (types.contains("route")) {
|
||||||
|
roadName = component["long_name"]; // Road Name
|
||||||
|
} else if (types.contains("sublocality_level_1") ||
|
||||||
|
types.contains("locality")) {
|
||||||
|
colony = component["long_name"]; // Colony Name
|
||||||
|
} else if (types.contains("premise") ||
|
||||||
|
types.contains("street_number")) {
|
||||||
|
buildingName = component["long_name"]; // Building Name
|
||||||
|
} else if (types.contains("postal_code")) {
|
||||||
|
pincode = component["long_name"]; // Extract Pin Code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// setState(() {
|
||||||
|
// // _address = formattedAddress;
|
||||||
|
// _roadName = roadName;
|
||||||
|
// _colony = colony;
|
||||||
|
// _buildingName = buildingName;
|
||||||
|
// });
|
||||||
|
|
||||||
|
getCurrentAdd = result["formatted_address"] + pincode;
|
||||||
|
notifyListeners();
|
||||||
|
|
||||||
|
print(
|
||||||
|
"Full Address: ${result["formatted_address"]} ${response.body} sdfsgd ${pincode}");
|
||||||
|
print("Road Name: $roadName");
|
||||||
|
print("Colony: $colony");
|
||||||
|
print("Building Name: $buildingName");
|
||||||
|
} else {}
|
||||||
|
} else {}
|
||||||
|
} catch (e) {
|
||||||
|
print("Error fetching address: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,6 @@ class OrderProvider extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,13 +122,13 @@ class ProfileProvider extends ChangeNotifier {
|
|||||||
await SharedPrefUtils.saveUser(user: response);
|
await SharedPrefUtils.saveUser(user: response);
|
||||||
allitem = response!;
|
allitem = response!;
|
||||||
|
|
||||||
_profile = response.img;
|
_profile = response.img ?? '';
|
||||||
_name = response.firstName + " " + response.lastName;
|
_name = response.firstName ?? "" + " " + response.lastName ?? '';
|
||||||
_email = response.email;
|
_email = response.email ?? "";
|
||||||
|
|
||||||
APPSTRING.userName = response.firstName;
|
APPSTRING.userName = response.firstName ?? "";
|
||||||
APPSTRING.userLastName = response.lastName;
|
APPSTRING.userLastName = response.lastName ?? "";
|
||||||
APPSTRING.userProfile = response.img;
|
APPSTRING.userProfile = response.img ?? "";
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:grocery_app/src/logic/provider/home_provider.dart';
|
||||||
import 'package:grocery_app/utils/constants/color_constant.dart';
|
import 'package:grocery_app/utils/constants/color_constant.dart';
|
||||||
import 'package:grocery_app/utils/extensions/uicontext.dart';
|
import 'package:grocery_app/utils/extensions/uicontext.dart';
|
||||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class Header extends StatelessWidget {
|
class Header extends StatelessWidget {
|
||||||
const Header({super.key});
|
const Header({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return Consumer<ProductProvider>(builder: (context, provider, child) {
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@@ -41,7 +44,8 @@ class Header extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"639| Elgin St. Celina, Delaware 10299",
|
provider.getCurrentAdd,
|
||||||
|
// "639| Elgin St. Celina, Delaware 10299",
|
||||||
style: context.customMedium(APPCOLOR.grey666666, 14),
|
style: context.customMedium(APPCOLOR.grey666666, 14),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -49,12 +53,13 @@ class Header extends StatelessWidget {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
Icon(
|
// Icon(
|
||||||
MdiIcons.shoppingOutline,
|
// MdiIcons.shoppingOutline,
|
||||||
color: APPCOLOR.balck1A1A1A,
|
// color: APPCOLOR.balck1A1A1A,
|
||||||
size: 30,
|
// size: 30,
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,12 +33,14 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
final productProvider =
|
final productProvider =
|
||||||
Provider.of<ProductProvider>(context, listen: false);
|
Provider.of<ProductProvider>(context, listen: false);
|
||||||
|
productProvider .determinePosition();
|
||||||
|
|
||||||
productProvider.getBanners(context);
|
productProvider.getBanners(context);
|
||||||
productProvider.getHomeProduct(context, "", '');
|
productProvider.getHomeProduct(context, "", '', '', '', '');
|
||||||
productProvider.getBestDealProduct(context,'');
|
productProvider.getBestDealProduct(context, '');
|
||||||
productProvider.getAllcategory(context);
|
productProvider.getAllcategory(context);
|
||||||
|
|
||||||
|
|
||||||
getUserDetails();
|
getUserDetails();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -69,7 +71,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Consumer<ProductProvider>(
|
Consumer<ProductProvider>(
|
||||||
builder: (context, provider, child) {
|
builder: (context, provider, child)
|
||||||
|
{
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 50,
|
height: 50,
|
||||||
@@ -86,8 +89,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
fillColor: Colors.transparent,
|
fillColor: Colors.transparent,
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
provider.getHomeProduct(
|
provider.getHomeProduct(context, "",
|
||||||
context, "", provider.searchValue);
|
provider.searchValue, '', '', '');
|
||||||
},
|
},
|
||||||
child: Icon(MdiIcons.magnify)),
|
child: Icon(MdiIcons.magnify)),
|
||||||
hintText: 'Search',
|
hintText: 'Search',
|
||||||
@@ -659,7 +662,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: provider.homeproducts.isEmpty
|
: provider.homeproducts.isEmpty
|
||||||
? Center(child: Text('No products available'))
|
? Center(child: Text(''))
|
||||||
: GridView.builder(
|
: GridView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: provider.homeproducts.length,
|
itemCount: provider.homeproducts.length,
|
||||||
@@ -735,10 +738,11 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Divider(
|
Divider(
|
||||||
thickness: 0.2,
|
thickness: 0.2,
|
||||||
),
|
),
|
||||||
_buildSortOption(context, sortProvider, 0, "Relevance"),
|
_buildSortOption(context, sortProvider, 0, "All"),
|
||||||
_buildSortOption(context, sortProvider, 1, "Popularity"),
|
_buildSortOption(context, sortProvider, 1, "Relevance"),
|
||||||
|
_buildSortOption(context, sortProvider, 2, "Popularity"),
|
||||||
_buildSortOption(
|
_buildSortOption(
|
||||||
context, sortProvider, 2, "Price: Low to High"),
|
context, sortProvider, 3, "Price: Low to High"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -758,7 +762,24 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
? Icon(Icons.check_circle, color: Colors.green)
|
? Icon(Icons.check_circle, color: Colors.green)
|
||||||
: Icon(Icons.radio_button_unchecked, color: Colors.grey),
|
: Icon(Icons.radio_button_unchecked, color: Colors.grey),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
provider.getHomeProduct(context, '', '');
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
provider.getHomeProduct(context, '', '', "", "", '');
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
provider.getHomeProduct(context, '', '', "", "", "featured");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
provider.getHomeProduct(context, '', '', "", "", "popularity");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
provider.getHomeProduct(context, '', '', "100", "100000000", '');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
provider.getHomeProduct(context, '', '', "", "", '');
|
||||||
|
}
|
||||||
|
|
||||||
|
// provider.getHomeProduct(context, '', '', "100", "100000000");
|
||||||
provider.setSelectedIndex(context, index);
|
provider.setSelectedIndex(context, index);
|
||||||
Navigator.pop(context); // Close the bottom sheet
|
Navigator.pop(context); // Close the bottom sheet
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
padding: context.bodyAllPadding.copyWith(bottom: 20),
|
padding: context.bodyAllPadding.copyWith(bottom: 20),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async
|
||||||
|
{
|
||||||
if (_formKey.currentState?.validate() ?? false) {
|
if (_formKey.currentState?.validate() ?? false) {
|
||||||
final success =
|
final success =
|
||||||
await pageNotifier.sendOtp(phoneController.text, context);
|
await pageNotifier.sendOtp(phoneController.text, context);
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ class _SingnuScreenState extends State<SingnuScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
])),
|
])),
|
||||||
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
"",
|
"",
|
||||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 18),
|
style: context.customMedium(APPCOLOR.balck1A1A1A, 18),
|
||||||
|
|||||||
@@ -120,6 +120,9 @@ class _AddLocationAddressState extends State<AddLocationAddress> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void _onMapTapped(LatLng tappedPoint) {
|
void _onMapTapped(LatLng tappedPoint) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selectedLocation = tappedPoint;
|
_selectedLocation = tappedPoint;
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ class _LoginOtpScreenState extends State<LoginOtpScreen> {
|
|||||||
style: const TextStyle(fontSize: 17),
|
style: const TextStyle(fontSize: 17),
|
||||||
textFieldAlignment: MainAxisAlignment.spaceBetween,
|
textFieldAlignment: MainAxisAlignment.spaceBetween,
|
||||||
fieldStyle: FieldStyle.box,
|
fieldStyle: FieldStyle.box,
|
||||||
onCompleted: (pin) async {
|
onCompleted: (pin) async
|
||||||
|
{
|
||||||
final success = await pageNotifier.loginOtp(pin, context);
|
final success = await pageNotifier.loginOtp(pin, context);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
var top = 0.0;
|
var top = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState()
|
void initState() {
|
||||||
{
|
|
||||||
Provider.of<ProfileProvider>(context, listen: false).getProfile(context);
|
Provider.of<ProfileProvider>(context, listen: false).getProfile(context);
|
||||||
getUserDetails();
|
getUserDetails();
|
||||||
super.initState();
|
super.initState();
|
||||||
@@ -53,8 +52,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
body: NestedScrollView(
|
body: NestedScrollView(
|
||||||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
||||||
return <Widget>[
|
return <Widget>[
|
||||||
Consumer<ProfileProvider>(builder: (context, provider, child)
|
Consumer<ProfileProvider>(builder: (context, provider, child) {
|
||||||
{
|
|
||||||
return SliverAppBar(
|
return SliverAppBar(
|
||||||
expandedHeight: 180.0,
|
expandedHeight: 180.0,
|
||||||
floating: false,
|
floating: false,
|
||||||
@@ -187,18 +185,18 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
title: const Text('Change Password'),
|
title: const Text('Change Password'),
|
||||||
trailing: Icon(MdiIcons.chevronRight),
|
trailing: Icon(MdiIcons.chevronRight),
|
||||||
),
|
),
|
||||||
ListTile(
|
// ListTile(
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
// Navigator.of(context).push(MaterialPageRoute(
|
// // Navigator.of(context).push(MaterialPageRoute(
|
||||||
// builder: (context) {
|
// // builder: (context) {
|
||||||
// return const CardCheckoutScreen();
|
// // return const CardCheckoutScreen();
|
||||||
|
// // },
|
||||||
|
// // ));
|
||||||
// },
|
// },
|
||||||
// ));
|
// leading: Icon(MdiIcons.cardOutline),
|
||||||
},
|
// title: const Text('Payment Method'),
|
||||||
leading: Icon(MdiIcons.cardOutline),
|
// trailing: Icon(MdiIcons.chevronRight),
|
||||||
title: const Text('Payment Method'),
|
// ),
|
||||||
trailing: Icon(MdiIcons.chevronRight),
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.push(MyRoutes.MYORDER);
|
context.push(MyRoutes.MYORDER);
|
||||||
@@ -207,18 +205,18 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
title: const Text('My Order'),
|
title: const Text('My Order'),
|
||||||
trailing: Icon(MdiIcons.chevronRight),
|
trailing: Icon(MdiIcons.chevronRight),
|
||||||
),
|
),
|
||||||
ListTile(
|
// ListTile(
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
Navigator.of(context).push(MaterialPageRoute(
|
// Navigator.of(context).push(MaterialPageRoute(
|
||||||
builder: (context) {
|
// builder: (context) {
|
||||||
return const NotificationScreen();
|
// return const NotificationScreen();
|
||||||
},
|
// },
|
||||||
));
|
// ));
|
||||||
},
|
// },
|
||||||
leading: Icon(MdiIcons.bellOutline),
|
// leading: Icon(MdiIcons.bellOutline),
|
||||||
title: const Text('Notifications'),
|
// title: const Text('Notifications'),
|
||||||
trailing: Icon(MdiIcons.chevronRight),
|
// trailing: Icon(MdiIcons.chevronRight),
|
||||||
),
|
// ),
|
||||||
// ListTile(
|
// ListTile(
|
||||||
// onTap: () {
|
// onTap: () {
|
||||||
// Navigator.of(context).push(MaterialPageRoute(
|
// Navigator.of(context).push(MaterialPageRoute(
|
||||||
@@ -284,7 +282,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
print("fjnghkjfjghj");
|
|
||||||
Provider.of<ProductProvider>(context, listen: false)
|
Provider.of<ProductProvider>(context, listen: false)
|
||||||
.customerLogOut(context);
|
.customerLogOut(context);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,11 +29,12 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
Future.delayed(const Duration(seconds: 2), () async {
|
Future.delayed(const Duration(seconds: 2), () async
|
||||||
|
{
|
||||||
|
|
||||||
Provider.of<BottomNavProvider>(context, listen: false)
|
Provider.of<BottomNavProvider>(context, listen: false) .refreshToken(context);
|
||||||
.refreshToken(context);
|
if (await SharedPrefUtils.isFreshInstall())
|
||||||
if (await SharedPrefUtils.isFreshInstall()) {
|
{
|
||||||
context.clearAndPush(routePath: MyRoutes.ONBOARDING);
|
context.clearAndPush(routePath: MyRoutes.ONBOARDING);
|
||||||
} else {
|
} else {
|
||||||
context.clearAndPush(routePath: MyRoutes.BOTTOMNAV);
|
context.clearAndPush(routePath: MyRoutes.BOTTOMNAV);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class SharedPrefUtils {
|
|||||||
}) async {
|
}) async {
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
print("lkdjglkdfhgkhl ${user.firstName}");
|
print("lkdjglkdfhgkhl ${user.firstName ?? " "}");
|
||||||
await prefs.setString(KEY_FIRSTNAME, user.firstName ?? "");
|
await prefs.setString(KEY_FIRSTNAME, user.firstName ?? "");
|
||||||
await prefs.setString(KEY_LAST_NAME, user.lastName ?? "");
|
await prefs.setString(KEY_LAST_NAME, user.lastName ?? "");
|
||||||
await prefs.setString(KEY_EMAIL, user.email ?? " ");
|
await prefs.setString(KEY_EMAIL, user.email ?? " ");
|
||||||
|
|||||||
Reference in New Issue
Block a user