refactor providers e basi per spedizioni
This commit is contained in:
28
lib/features/master_data/providers/models/provider_role.dart
Normal file
28
lib/features/master_data/providers/models/provider_role.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum ProviderRole {
|
||||
landline('Fisso', Colors.blue),
|
||||
mobile('Mobile', Colors.green),
|
||||
energy('Energia', Colors.orange),
|
||||
insurance('Assicurazioni', Colors.purple),
|
||||
financing('Finanziamenti', Colors.teal),
|
||||
entertainment('Intrattenimento', Colors.red),
|
||||
telepass('Telepass', Colors.amber),
|
||||
repairCenter('Centro Riparazioni', Colors.cyan),
|
||||
partsSupplier('Fornitore Ricambi', Colors.indigo),
|
||||
merchandiseSupplier('Fornitore Merce', Colors.brown);
|
||||
|
||||
final String displayValue;
|
||||
final Color color; // <-- Il nostro tocco magico
|
||||
|
||||
const ProviderRole(this.displayValue, this.color);
|
||||
|
||||
static ProviderRole? fromString(String? value) {
|
||||
if (value == null) return null;
|
||||
try {
|
||||
return ProviderRole.values.firstWhere((e) => e.name == value);
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user