connect with backend

This commit is contained in:
Abhishek Mali
2025-12-03 11:57:05 +05:30
parent c6b4c66c10
commit 3bf27cc29d
48 changed files with 2618 additions and 126 deletions

View File

@@ -0,0 +1,26 @@
import 'package:flutter/cupertino.dart';
import '../services/order_service.dart';
class OrderProvider extends ChangeNotifier {
final OrderService service;
OrderProvider(this.service);
bool loading = false;
List orders = [];
Future<void> loadOrders() async {
loading = true;
notifyListeners();
final res = await service.getOrders();
if (res['success'] == true) {
orders = res['orders'];
}
loading = false;
notifyListeners();
}
}