mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-15 14:32:48 +00:00
Some improvements
This commit is contained in:
parent
d57572cc56
commit
c3690902c8
7 changed files with 355 additions and 393 deletions
60
lib/screens/settings/encryption/custom_text_field.dart
Normal file
60
lib/screens/settings/encryption/custom_text_field.dart
Normal file
|
@ -0,0 +1,60 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class EncryptionTextField extends StatelessWidget {
|
||||
final bool enabled;
|
||||
final TextEditingController controller;
|
||||
final IconData icon;
|
||||
final void Function(String) onChanged;
|
||||
final String? errorText;
|
||||
final String label;
|
||||
final TextInputType? keyboardType;
|
||||
final bool? multiline;
|
||||
final String? helperText;
|
||||
|
||||
const EncryptionTextField({
|
||||
Key? key,
|
||||
required this.enabled,
|
||||
required this.controller,
|
||||
required this.icon,
|
||||
required this.onChanged,
|
||||
this.errorText,
|
||||
required this.label,
|
||||
this.keyboardType,
|
||||
this.multiline,
|
||||
this.helperText,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 200
|
||||
),
|
||||
child: TextFormField(
|
||||
enabled: enabled,
|
||||
controller: controller,
|
||||
onChanged: onChanged,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(icon),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
errorText: errorText,
|
||||
labelText: label,
|
||||
helperText: helperText,
|
||||
helperMaxLines: 10,
|
||||
helperStyle: TextStyle(
|
||||
color: Theme.of(context).listTileTheme.iconColor
|
||||
)
|
||||
),
|
||||
keyboardType: TextInputType.multiline,
|
||||
maxLines: multiline == true ? null : 1,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue