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,23 @@
import 'package:flutter/material.dart';
import '../services/invoice_service.dart';
import '../services/dio_client.dart';
class InvoiceProvider extends ChangeNotifier {
bool loading = false;
List invoices = [];
Future<void> loadInvoices(BuildContext context) async {
loading = true;
notifyListeners();
final service = InvoiceService(DioClient.getInstance(context));
final res = await service.getAllInvoices();
if (res['success'] == true) {
invoices = res['invoices'] ?? [];
}
loading = false;
notifyListeners();
}
}