TF-527 Add presentation layer in add new identity
This commit is contained in:
@@ -42,7 +42,6 @@ export 'presentation/views/button/button_builder.dart';
|
||||
export 'presentation/views/button/icon_button_web.dart';
|
||||
export 'presentation/views/image/avatar_builder.dart';
|
||||
export 'presentation/views/list/sliver_grid_delegate_fixed_height.dart';
|
||||
export 'presentation/views/text/text_form_field_builder.dart';
|
||||
export 'presentation/views/image/icon_builder.dart';
|
||||
export 'presentation/views/context_menu/context_menu_action_builder.dart';
|
||||
export 'presentation/views/context_menu/context_menu_builder.dart';
|
||||
|
||||
@@ -96,6 +96,7 @@ Widget buildTextButton(String text, {
|
||||
double? width,
|
||||
double? height,
|
||||
Color? backgroundColor,
|
||||
EdgeInsets? padding,
|
||||
double? radius,
|
||||
IconWebCallback? onTap,
|
||||
}) {
|
||||
@@ -106,6 +107,8 @@ Widget buildTextButton(String text, {
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) => backgroundColor ?? AppColor.colorTextButton),
|
||||
elevation: MaterialStateProperty.resolveWith((states) => 0),
|
||||
padding: MaterialStateProperty.resolveWith<EdgeInsets>(
|
||||
(Set<MaterialState> states) => padding ?? EdgeInsets.zero),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(radius ?? 0)))),
|
||||
child: Text(text, style: textStyle ?? TextStyle(fontSize: 17, color: Colors.white, fontWeight: FontWeight.w500)),
|
||||
onPressed: () => onTap?.call()
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
typedef OnTapActionClick = void Function();
|
||||
|
||||
class TextFormFieldBuilder {
|
||||
Key? _key;
|
||||
ValueChanged<String>? _onTextChange;
|
||||
InputDecoration? _inputDecoration;
|
||||
TextInputAction? _textInputAction;
|
||||
TextStyle? _textStyle;
|
||||
OnTapActionClick? _onTapActionClick;
|
||||
|
||||
void key(Key key) {
|
||||
_key = key;
|
||||
}
|
||||
|
||||
void onChange(ValueChanged<String> onChange) {
|
||||
_onTextChange = onChange;
|
||||
}
|
||||
|
||||
void textStyle(TextStyle style) {
|
||||
_textStyle = style;
|
||||
}
|
||||
|
||||
void textDecoration(InputDecoration inputDecoration) {
|
||||
_inputDecoration = inputDecoration;
|
||||
}
|
||||
|
||||
void textInputAction(TextInputAction inputAction) {
|
||||
_textInputAction = inputAction;
|
||||
}
|
||||
|
||||
void addOnTapActionClick(OnTapActionClick onTapActionClick) {
|
||||
_onTapActionClick = onTapActionClick;
|
||||
}
|
||||
|
||||
TextFormField build() {
|
||||
return TextFormField(
|
||||
key: _key ?? Key('text_form_field_builder'),
|
||||
keyboardType: TextInputType.multiline,
|
||||
maxLines: null,
|
||||
onChanged: _onTextChange,
|
||||
style: _textStyle,
|
||||
decoration: _inputDecoration,
|
||||
textInputAction: _textInputAction,
|
||||
onTap: () {
|
||||
if (_onTapActionClick != null) {
|
||||
_onTapActionClick!();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user