Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit code #940 #959

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void main() {
* Use the "environments.local.json" for running against your local web-api
* For IOS users: change the SERVER_HOST in the environment.local file to "http://localhost:5000"
*/
environment.setFile('assets/environments.dev.json').whenComplete(() {
environment.setFile('assets/environments.local.json').whenComplete(() {
_runApp();
});
}
Expand Down
40 changes: 27 additions & 13 deletions lib/screens/new_citizen_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ import 'package:weekplanner/widgets/giraf_button_widget.dart';
/// Role names for Weekplanner
enum Roles {
/// Guardian role
guardian,

guardian,
/// Trustee role
trustee,
trustee,
/// Citizen role
citizen }

/// Citizen role
citizen
}
/// This map provides translations for different roles used in the application
/// from English to Danish.
final Map<Roles, String> roleText = <Roles, String>{
Roles.guardian: 'Pædagog', // from Guardian to Pædagog
Roles.trustee: 'Værge', // from Trustee to Værge
Roles.citizen: 'Borger', // from Citizen to Borger
};

/// Screen for creating a new citizen
// ignore: must_be_immutable
Expand Down Expand Up @@ -123,7 +128,9 @@ class _NewCitizenScreenState extends State<NewCitizenScreen> {
Expanded(
child: ListTile(
key: const Key('guardianRadioButton'),
title: const Text('Guardian'),
// The title for the radio button,
// translated from 'Guardian' to 'Pædagog'
title: const Text('Pædagog'),
leading: Radio<Roles>(
value: Roles.guardian,
groupValue: _role,
Expand All @@ -140,7 +147,9 @@ class _NewCitizenScreenState extends State<NewCitizenScreen> {
Expanded(
child: ListTile(
key: const Key('trusteeRadioButton'),
title: const Text('Trustee'),
// The title for the radio button,
// translated from 'Trustee' to 'Værge'
title: const Text('Værge'),
leading: Radio<Roles>(
value: Roles.trustee,
groupValue: _role,
Expand All @@ -157,7 +166,9 @@ class _NewCitizenScreenState extends State<NewCitizenScreen> {
Expanded(
child: ListTile(
key: const Key('citizenRadioButton'),
title: const Text('Citizen'),
// The title for the radio button,
// translated from 'Citizen' to 'Borger'
title: const Text('Borger'),
leading: Radio<Roles>(
value: Roles.citizen,
groupValue: _role,
Expand Down Expand Up @@ -282,12 +293,15 @@ class _NewCitizenScreenState extends State<NewCitizenScreen> {
);
}),
),
const Padding(
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 16),
Padding( // edit
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
//child: Text('Profil billede af borger (valgfri):'),
child: AutoSizeText(
'Profil billede af borger (valgfri):',
style: TextStyle(fontSize: GirafFont.small),
// The text for displaying a profile picture based on
// the user's role. It dynamically includes the user's role,
// e.g., 'Pædagog', 'Værge', or 'Borger'
'Profil billede af ${roleText[_role]} (valgfri):',
style: const TextStyle(fontSize: GirafFont.small),
),
),

Expand Down
Loading