- created custom text block, dropdown,
- created extract, goals and block card screen. - generated tests for design system components. - updated restore password and home screens to 17/11 design.
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class CustomTextField extends ConsumerStatefulWidget{
|
||||
class CustomTextField extends StatefulWidget{
|
||||
bool? showPassword;
|
||||
final bool numeric;
|
||||
final String hint;
|
||||
@@ -24,49 +24,60 @@ class CustomTextField extends ConsumerStatefulWidget{
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<CustomTextField> createState() => CustomTextFieldState();
|
||||
State<CustomTextField> createState() => CustomTextFieldState();
|
||||
}
|
||||
|
||||
class CustomTextFieldState extends ConsumerState<CustomTextField>{
|
||||
class CustomTextFieldState extends State<CustomTextField>{
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return TextFormField(
|
||||
keyboardType: widget.numeric? TextInputType.number : TextInputType.text,
|
||||
obscureText: !(widget.showPassword ?? true),
|
||||
enableSuggestions: widget.showPassword ?? true,
|
||||
autocorrect: !(widget.showPassword ?? false),
|
||||
style: TextStyle(color: theme.getColorFor(ThemeCode.buttonSecondary)),
|
||||
inputFormatters: widget.numeric? [
|
||||
FilteringTextInputFormatter.digitsOnly
|
||||
] : [],
|
||||
decoration: InputDecoration(
|
||||
counterText: "",
|
||||
hintText: widget.hint,
|
||||
labelText: widget.label,
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
borderSide: BorderSide(color: theme.getColorFor(ThemeCode.textPrimary)),
|
||||
gapPadding: 16
|
||||
return Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
?widget.label == '' ? null : Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
widget.label,
|
||||
style: TextStyle(fontSize: 14, letterSpacing: 0),
|
||||
)
|
||||
),
|
||||
suffixIcon: widget.showPassword!=null ? IconButton(
|
||||
icon: Icon(widget.showPassword!
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
widget.showPassword = !widget.showPassword!;
|
||||
});
|
||||
},
|
||||
) : null,
|
||||
),
|
||||
minLines: widget.lines ?? 1,
|
||||
maxLines: widget.lines ?? 1,
|
||||
maxLength: widget.length,
|
||||
onChanged: widget.onChanged ?? (_)=>{},
|
||||
TextFormField(
|
||||
keyboardType: widget.numeric? TextInputType.number : TextInputType.text,
|
||||
obscureText: !(widget.showPassword ?? true),
|
||||
enableSuggestions: widget.showPassword ?? true,
|
||||
autocorrect: !(widget.showPassword ?? false),
|
||||
style: TextStyle(color: Color(0xFF4B4B4B)),
|
||||
inputFormatters: widget.numeric? [
|
||||
FilteringTextInputFormatter.digitsOnly
|
||||
] : [],
|
||||
decoration: InputDecoration(
|
||||
counterText: "",
|
||||
hintText: widget.hint,
|
||||
//labelText: widget.label,
|
||||
//floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
borderSide: BorderSide(color: Color(0xFF4B4B4B)),
|
||||
gapPadding: 16
|
||||
),
|
||||
suffixIcon: widget.showPassword!=null ? IconButton(
|
||||
icon: Icon(widget.showPassword!
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
widget.showPassword = !widget.showPassword!;
|
||||
});
|
||||
},
|
||||
) : null,
|
||||
),
|
||||
minLines: widget.lines ?? 1,
|
||||
maxLines: widget.lines ?? 1,
|
||||
maxLength: widget.length,
|
||||
onChanged: widget.onChanged ?? (_)=>{},
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user