Widget build(BuildContext context) {
return Theme(
data: ThemeData.dark().copyWith(
- colorScheme: ColorScheme.dark().copyWith(
+ colorScheme: const ColorScheme.dark().copyWith(
secondary: ProxmoxColors.orange,
onSecondary: ProxmoxColors.supportGrey)),
child: Scaffold(
elevation: 0.0,
backgroundColor: Colors.transparent,
leading: IconButton(
- icon: Icon(Icons.close),
+ icon: const Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
),
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
- Padding(
- padding: const EdgeInsets.fromLTRB(0, 100.0, 0, 30.0),
+ const Padding(
+ padding: EdgeInsets.fromLTRB(0, 100.0, 0, 30.0),
child: Icon(
Icons.lock,
size: 48,
),
),
- Text(
+ const Text(
'Verify',
style: TextStyle(
fontSize: 36,
color: Colors.white,
fontWeight: FontWeight.bold),
),
- Text(
+ const Text(
'Check your second factor provider',
style: TextStyle(
color: Colors.white38,
child: Column(
children: <Widget>[
DropdownButtonFormField(
- decoration: InputDecoration(
+ decoration: const InputDecoration(
labelText: 'Method',
icon: Icon(Icons.input)),
items: _tfa_kinds
.map((e) => DropdownMenuItem(
- child: ListTile(title: Text(e)),
value: e,
+ child: ListTile(title: Text(e)),
))
.toList(),
onChanged: (String? value) {
TextField(
controller: _codeController,
textAlign: TextAlign.center,
- decoration: InputDecoration(
+ decoration: const InputDecoration(
labelText: 'Code',
icon: Icon(Icons.pin)),
+ keyboardType: _selected_tfa_kind == 'totp'
+ ? TextInputType.number
+ : TextInputType.visiblePassword,
autofocus: true,
onSubmitted: (value) => _submitTfaCode()),
],
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: Colors.white,
- backgroundColor: Color(0xFFE47225),
+ backgroundColor: const Color(0xFFE47225),
disabledBackgroundColor: Colors.grey,
),
onPressed: () => _submitTfaCode(),
- child: Text('Continue'),
+ child: const Text('Continue'),
),
),
),
),
),
if (_isLoading)
- ProxmoxProgressOverlay(
+ const ProxmoxProgressOverlay(
message: 'Verifying second-factor...',
)
],