Skip to content

Commit

Permalink
753: renamed prop, adjusted verification icon, added checkBox theme t…
Browse files Browse the repository at this point in the history
…o themes
  • Loading branch information
f1sh1918 committed Feb 21, 2023
1 parent b3205a6 commit 27b04d9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ class PositiveVerificationResultDialog extends StatefulWidget {
const PositiveVerificationResultDialog({
super.key,
required this.cardInfo,
required this.hasStaticVerificationCode,
required this.isStaticVerificationCode,
});

static Future<void> show({
required BuildContext context,
required CardInfo cardInfo,
required bool hasStaticVerificationCode,
required bool isStaticVerificationCode,
}) =>
showDialog(
context: context,
builder: (_) => PositiveVerificationResultDialog(
cardInfo: cardInfo,
hasStaticVerificationCode: hasStaticVerificationCode,
isStaticVerificationCode: isStaticVerificationCode,
),
);

Expand All @@ -53,10 +53,10 @@ class PositiveVerificationResultDialogState extends State<PositiveVerificationRe
builder: (result, {refetch, fetchMore}) {
final data = result.data;
final region = result.isConcrete && data != null ? regionsQuery.parse(data).regionsByIdInProject[0] : null;
final bool isUncheckedStaticQrCode = !isChecked && widget.hasStaticVerificationCode;
final bool isUncheckedStaticQrCode = !isChecked && widget.isStaticVerificationCode;
return InfoDialog(
title: isUncheckedStaticQrCode ? "Prüfung nötig" : localization.positiveVerificationDialogTitle,
icon: isUncheckedStaticQrCode ? Icons.info : Icons.verified_user,
icon: isUncheckedStaticQrCode ? Icons.report : Icons.verified_user,
iconColor: isUncheckedStaticQrCode ? Theme.of(context).colorScheme.onBackground : Colors.green,
child: Column(
mainAxisSize: MainAxisSize.min,
Expand All @@ -67,13 +67,12 @@ class PositiveVerificationResultDialogState extends State<PositiveVerificationRe
region: region != null ? Region(region.prefix, region.name) : null,
),
),
if (widget.hasStaticVerificationCode)
if (widget.isStaticVerificationCode)
Flexible(
child: Padding(
padding: const EdgeInsets.only(top: 16.0),
child: CheckboxListTile(
title: const Text('Ich habe die Daten mit einem amtlichen Lichtbildausweis abgeglichen.'),
checkColor: Theme.of(context).primaryColor,
controlAffinity: ListTileControlAffinity.leading,
value: isChecked,
onChanged: (bool? value) {
Expand All @@ -84,8 +83,6 @@ class PositiveVerificationResultDialogState extends State<PositiveVerificationRe
),
),
)
else
Container()
],
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class VerificationQrScannerPage extends StatelessWidget {
await PositiveVerificationResultDialog.show(
context: context,
cardInfo: cardInfo,
hasStaticVerificationCode: hasStaticVerificationCode,
isStaticVerificationCode: isStaticVerificationCode,
);
}

Expand Down
8 changes: 8 additions & 0 deletions frontend/lib/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ ThemeData get lightTheme {
outlinedButtonTheme: OutlinedButtonThemeData(
style: ButtonStyle(side: MaterialStatePropertyAll(BorderSide(color: primaryColor, width: 1))),
),
checkboxTheme: CheckboxThemeData(
checkColor: const MaterialStatePropertyAll(Colors.black),
fillColor: MaterialStatePropertyAll(primaryColor),
),
);
}

Expand Down Expand Up @@ -66,5 +70,9 @@ ThemeData get darkTheme {
outlinedButtonTheme: OutlinedButtonThemeData(
style: ButtonStyle(side: MaterialStatePropertyAll(BorderSide(color: primaryColor, width: 1))),
),
checkboxTheme: CheckboxThemeData(
checkColor: const MaterialStatePropertyAll(Colors.white),
fillColor: MaterialStatePropertyAll(primaryColor),
),
);
}

0 comments on commit 27b04d9

Please sign in to comment.