You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
882 B
Dart
34 lines
882 B
Dart
import 'package:test_sa/modules/signup/models/company_model.dart';
|
|
import 'package:test_sa/providers/loading_list_notifier.dart';
|
|
|
|
class CompanyProvider extends LoadingListNotifier<Company> {
|
|
@override
|
|
Future getData({int? id}) async {
|
|
if (loading) return -2;
|
|
loading = true;
|
|
notifyListeners();
|
|
|
|
try {
|
|
// TODO: Replace with actual API call when available
|
|
await Future.delayed(const Duration(milliseconds: 500));
|
|
|
|
items = [
|
|
Company(code: 'FM', displayName: 'Flow Medical (FM)'),
|
|
Company(code: 'FMS', displayName: 'Facility Management and Safety (FMS)'),
|
|
Company(code: 'Ajaji', displayName: 'Ajaji'),
|
|
];
|
|
|
|
stateCode = 200;
|
|
loading = false;
|
|
notifyListeners();
|
|
return 200;
|
|
} catch (error) {
|
|
loading = false;
|
|
stateCode = -1;
|
|
notifyListeners();
|
|
return -1;
|
|
}
|
|
}
|
|
}
|
|
|