Initial commit for complete UI

This commit is contained in:
2025-05-29 14:59:31 +05:30
commit 1f0ec17edc
170 changed files with 7211 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
import '../models/serviceboy_model.dart';
class ServiceBoyProvider extends ChangeNotifier {
List<ServiceBoy> _serviceBoys = [
ServiceBoy(name: 'John Doe', phone: '9875643210'),
ServiceBoy(name: 'Amit Raj', phone: '9765432180'),
ServiceBoy(name: 'Manoj Sinha', phone: '9543219876'),
];
ServiceBoy? _selectedBoy;
List<ServiceBoy> get serviceBoys => _serviceBoys;
ServiceBoy? get selectedBoy => _selectedBoy;
// Add a new service boy
void addServiceBoy(ServiceBoy boy) {
_serviceBoys.add(boy);
notifyListeners();
}
// Edit an existing service boy
void editServiceBoy(int index, ServiceBoy updatedBoy) {
if (index >= 0 && index < _serviceBoys.length) {
_serviceBoys[index] = updatedBoy;
notifyListeners();
}
}
// Delete a service boy
void deleteServiceBoy(int index) {
if (index >= 0 && index < _serviceBoys.length) {
_serviceBoys.removeAt(index);
notifyListeners();
}
}
// Assign a selected service boy (for dialogs)
void selectBoy(ServiceBoy boy) {
_selectedBoy = boy;
notifyListeners();
}
void clearSelection() {
_selectedBoy = null;
notifyListeners();
}
}