124 lines
3.9 KiB
Dart
124 lines
3.9 KiB
Dart
// * Widget for selecting BImA (Bundesanstalt für Immobilienaufgaben) property user type
|
|
// * Features:
|
|
// * - Radio button selection for different user categories
|
|
// * - Localized labels for each user type
|
|
// * Available user types:
|
|
// * - Bundeswehr (German Armed Forces)
|
|
// * - Gaststreitkräfte (Foreign Armed Forces)
|
|
// * - NNE Bund (Federal non-civil use)
|
|
// * - Geschäftsliegenschaft/AGV (Commercial property)
|
|
// * - kein (none)
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:fforte/l10n/app_localizations.dart';
|
|
|
|
/// Widget for selecting the type of BImA property user
|
|
/// Used to categorize the property where monitoring takes place
|
|
class BimaNutzer extends StatefulWidget {
|
|
/// Callback function when user type selection changes
|
|
final Function(String) onBimaNutzerChanged;
|
|
/// Initial user type selection ('Bundeswehr' by default)
|
|
final String initialStatus;
|
|
|
|
const BimaNutzer(
|
|
{super.key, required this.onBimaNutzerChanged, this.initialStatus = 'Bundeswehr'});
|
|
|
|
@override
|
|
State<BimaNutzer> createState() => _StatusState();
|
|
}
|
|
|
|
/// State class for the BImA user selection widget
|
|
class _StatusState extends State<BimaNutzer> {
|
|
/// Currently selected user type
|
|
String? _selectedStatus;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_selectedStatus = widget.initialStatus;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
// German Armed Forces option
|
|
ListTile(
|
|
visualDensity: const VisualDensity(vertical: -4),
|
|
title: Text(AppLocalizations.of(context)!.bundeswehr),
|
|
leading: Radio<String>(
|
|
value: 'Bundeswehr',
|
|
groupValue: _selectedStatus,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_selectedStatus = value;
|
|
widget.onBimaNutzerChanged(value!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
// Foreign Armed Forces option
|
|
ListTile(
|
|
visualDensity: const VisualDensity(vertical: -4),
|
|
title: Text(AppLocalizations.of(context)!.gaststreitkraefte),
|
|
leading: Radio<String>(
|
|
value: 'Gaststreitkraefte',
|
|
groupValue: _selectedStatus,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_selectedStatus = value;
|
|
widget.onBimaNutzerChanged(value!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
// Federal non-civil use option
|
|
ListTile(
|
|
visualDensity: const VisualDensity(vertical: -4),
|
|
title: Text(AppLocalizations.of(context)!.nneBund),
|
|
leading: Radio<String>(
|
|
value: 'NNE Bund',
|
|
groupValue: _selectedStatus,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_selectedStatus = value;
|
|
widget.onBimaNutzerChanged(value!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
// Commercial property option
|
|
ListTile(
|
|
visualDensity: const VisualDensity(vertical: -4),
|
|
title: Text(AppLocalizations.of(context)!.geschaeftsliegenschaftAGV),
|
|
leading: Radio<String>(
|
|
value: 'Geschaeftsliegenschaft/AGV',
|
|
groupValue: _selectedStatus,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_selectedStatus = value;
|
|
widget.onBimaNutzerChanged(value!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
// No user option
|
|
ListTile(
|
|
visualDensity: const VisualDensity(vertical: -4),
|
|
title: Text(AppLocalizations.of(context)!.kein),
|
|
leading: Radio<String>(
|
|
value: 'kein',
|
|
groupValue: _selectedStatus,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_selectedStatus = value;
|
|
widget.onBimaNutzerChanged(value!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|