Simplfy errorBuilder widget with pre-existing localized strings
This commit is contained in:
parent
5ebcfac0f0
commit
6d0ed737dd
1 changed files with 7 additions and 15 deletions
|
|
@ -74,23 +74,15 @@ class _QrCodeScreenState extends State<QrCodeScreen> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.videocam_off_outlined, size: 64),
|
Icon(Icons.videocam_off_outlined, size: 120),
|
||||||
const SizedBox(height: 16),
|
Text(AppLocalizations.of(context)!.disabledValue),
|
||||||
Text(
|
SizedBox(height: 24,),
|
||||||
error.errorCode == MobileScannerErrorCode.permissionDenied
|
FilledButton.tonal(
|
||||||
? "Camera Permission Has Been Denied"
|
|
||||||
: error.errorDetails?.message ?? "Camera Error",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
FilledButton.icon(
|
|
||||||
onPressed:
|
onPressed:
|
||||||
() => AppSettings.openAppSettings(
|
() => AppSettings.openAppSettings(
|
||||||
type: AppSettingsType.settings,
|
type: AppSettingsType.settings,
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.settings),
|
child: Text(AppLocalizations.of(context)!.settingsTitle),
|
||||||
label: Text("Open Settings"),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue