CWA-212 | applied new design to exchange page; reworked exchange card; added new properties to address_text_field, base_text_form_field and top_panel

This commit is contained in:
Oleksandr Sobol
2020-05-12 20:46:42 +03:00
parent 38d7dbcb33
commit 16dfb3a2d5
5 changed files with 484 additions and 199 deletions
+10 -4
View File
@@ -19,6 +19,7 @@ class AddressTextField extends StatelessWidget {
],
this.onURIScanned,
this.focusNode,
this.isBorderExist = true,
this.validator});
static const prefixIconWidth = 34.0;
@@ -31,6 +32,7 @@ class AddressTextField extends StatelessWidget {
final Function(Uri) onURIScanned;
final List<AddressTextFieldOption> options;
final FormFieldValidator<String> validator;
final bool isBorderExist;
FocusNode focusNode;
@override
@@ -114,13 +116,17 @@ class AddressTextField extends StatelessWidget {
color: PaletteDark.walletCardText
),
hintText: placeholder ?? S.current.widgets_address,
focusedBorder: UnderlineInputBorder(
focusedBorder: isBorderExist
? UnderlineInputBorder(
borderSide: BorderSide(
color: PaletteDark.walletCardSubAddressField,
width: 1.0)),
enabledBorder: UnderlineInputBorder(
width: 1.0))
: InputBorder.none,
enabledBorder: isBorderExist
? UnderlineInputBorder(
borderSide:
BorderSide(color: PaletteDark.walletCardSubAddressField, width: 1.0)),
BorderSide(color: PaletteDark.walletCardSubAddressField, width: 1.0))
: InputBorder.none,
),
validator: validator,
);
@@ -15,6 +15,9 @@ class BaseTextFormField extends StatelessWidget {
this.textColor = Colors.white,
this.hintColor = PaletteDark.walletCardText,
this.borderColor = PaletteDark.menuList,
this.prefix,
this.suffix,
this.enabled = true,
this.validator
});
@@ -29,6 +32,9 @@ class BaseTextFormField extends StatelessWidget {
final Color textColor;
final Color hintColor;
final Color borderColor;
final Widget prefix;
final Widget suffix;
final bool enabled;
final FormFieldValidator<String> validator;
@override
@@ -41,11 +47,14 @@ class BaseTextFormField extends StatelessWidget {
autovalidate: autovalidate,
maxLines: maxLines,
inputFormatters: inputFormatters,
enabled: enabled,
style: TextStyle(
fontSize: 16.0,
color: textColor
),
decoration: InputDecoration(
prefix: prefix,
suffix: suffix,
hintStyle: TextStyle(
color: hintColor,
fontSize: 16
+21 -5
View File
@@ -1,24 +1,40 @@
import 'package:flutter/material.dart';
class TopPanel extends StatelessWidget {
TopPanel({@required this.color, @required this.widget});
class TopPanel extends StatefulWidget {
TopPanel({
@required this.color,
@required this.widget,
this.edgeInsets = const EdgeInsets.all(24)
});
final Color color;
final Widget widget;
final EdgeInsets edgeInsets;
@override
TopPanelState createState() => TopPanelState(color, widget, edgeInsets);
}
class TopPanelState extends State<TopPanel> {
TopPanelState(this._color, this._widget, this._edgeInsets);
final Color _color;
final Widget _widget;
final EdgeInsets _edgeInsets;
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: EdgeInsets.all(24),
padding: _edgeInsets,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24)
),
color: color
color: _color
),
child: widget,
child: _widget,
);
}
}