Заменил иконки, картину загрузки, логотип на экране регистрации, сделал автоматический скролл экрана при вводе id кассы, чтобы поле ввода не перекрывалось клавиатурой
This commit is contained in:
@@ -15,7 +15,7 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
|
||||
AppBar _getAppBar() {
|
||||
return new AppBar(title: new Text("Регистрация магазина"),
|
||||
backgroundColor: const Color(primaryColor), actions: <Widget>[
|
||||
backgroundColor: primaryColor, actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.help_outline),
|
||||
tooltip: 'Air it',
|
||||
@@ -75,8 +75,7 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
|
||||
Decoration _getDecoraionForInputField() {
|
||||
return new BoxDecoration(color: Colors.white,
|
||||
border: new Border.all(
|
||||
color: const Color(0xffcfd8dc), width: 1.0,),
|
||||
border: new Border.all(color: const Color(0xffcfd8dc), width: 1.0),
|
||||
borderRadius: new BorderRadius.all(new Radius.circular(4.0)));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ const String logout_png = 'assets/logout.png';
|
||||
const String activate_token_bg_png = 'assets/activate_token_message_background.png';
|
||||
|
||||
// Colors
|
||||
const int primaryColor = 0xffeb0004;
|
||||
const Color primaryColor = const Color(0xffeb0004);
|
||||
const Color disabledColor = const Color(0xffbfbfbf);
|
||||
|
||||
// HttpClient
|
||||
final httpClient = createHttpClient();
|
||||
|
||||
@@ -19,7 +19,7 @@ class _RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
|
||||
AppBar _getAppBar() {
|
||||
return new AppBar(title: new Text("Регистрация"),
|
||||
backgroundColor: const Color(primaryColor), actions: <Widget>[
|
||||
backgroundColor: primaryColor, actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.help_outline),
|
||||
tooltip: 'Air it',
|
||||
@@ -29,32 +29,31 @@ class _RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
}
|
||||
|
||||
Widget _getScreen(BuildContext context) {
|
||||
return new Center(child: new Column(children: <Widget>[
|
||||
_getLogo(),
|
||||
_getDecoratedInputField(),
|
||||
_getButton(context)
|
||||
]));
|
||||
return new Container(height: 332.0,
|
||||
child: new ListView(reverse: true, children: <Widget>[
|
||||
new Center(child: new Column(children: <Widget>[
|
||||
_getLogo(),
|
||||
_getDecoratedInputField(),
|
||||
_getButton(context)]))
|
||||
].reversed.toList()));
|
||||
}
|
||||
|
||||
Container _getLogo() {
|
||||
return new Container(height: 192.0,
|
||||
Widget _getLogo() {
|
||||
return new Container(height: 192.0, width: 156.0,
|
||||
child: new Image.asset(logo_png, height: 24.0, width: 156.0));
|
||||
}
|
||||
|
||||
Container _getDecoratedInputField() {
|
||||
return new Container(
|
||||
padding: new EdgeInsets.only(left: 28.0, right: 28.0),
|
||||
child: new Container(height: 48.0,
|
||||
padding: new EdgeInsets.only(left: 16.0, right: 16.0),
|
||||
Widget _getDecoratedInputField() {
|
||||
return new Container(margin: new EdgeInsets.only(left: 28.0, right: 28.0),
|
||||
padding: new EdgeInsets.only(top: 12.0, bottom: 12.0, left: 16.0, right: 16.0),
|
||||
decoration: _getDecoraionForInputField(),
|
||||
child: _getInputField())) ;
|
||||
child: _getInputField());
|
||||
}
|
||||
|
||||
TextField _getInputField() {
|
||||
return new TextField(decoration: new InputDecoration(hintText: merchantIDHint,
|
||||
hideDivider: true,
|
||||
hintStyle: new TextStyle(color: const Color(0xffa5a5a5),
|
||||
fontSize: 16.0)), onChanged: (text) => _handleUserInput(text));
|
||||
Widget _getInputField() {
|
||||
return new TextField(decoration: new InputDecoration.collapsed(hintText: merchantIDHint,
|
||||
hintStyle: new TextStyle(color: const Color(0xffa5a5a5), fontSize: 16.0)),
|
||||
onChanged: (text) => _handleUserInput(text));
|
||||
}
|
||||
|
||||
void _handleUserInput(String text) {
|
||||
@@ -67,23 +66,19 @@ class _RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
|
||||
Decoration _getDecoraionForInputField() {
|
||||
return new BoxDecoration(color: Colors.white,
|
||||
border: new Border.all(
|
||||
color: const Color(0xffcfd8dc), width: 1.0,),
|
||||
border: new Border.all(color: const Color(0xffcfd8dc), width: 1.0,),
|
||||
borderRadius: new BorderRadius.all(new Radius.circular(4.0)));
|
||||
}
|
||||
|
||||
Container _getButton(BuildContext context) {
|
||||
return new Container(padding: new EdgeInsets.only(top: 36.0),
|
||||
child: new Container(height: 64.0, padding: new EdgeInsets.all(8.0),
|
||||
Widget _getButton(BuildContext context) {
|
||||
return new Container(margin: new EdgeInsets.only(top: 36.0), height: 42.0, padding: new EdgeInsets.only(left: 40.0, right: 40.0),
|
||||
child: new RaisedButton(child: new Text('ЗАРЕГИСТРИРОВАТЬ',
|
||||
style: new TextStyle(color: Colors.white)),
|
||||
onPressed: _isValidMerchantID() ? () => _registerShop(context, _merchantID) : null,
|
||||
disabledColor: const Color(0xffbfbfbf),
|
||||
color: primaryColor)));
|
||||
color: primaryColor));
|
||||
}
|
||||
|
||||
_isValidMerchantID() {
|
||||
print(_merchantID.length);
|
||||
bool _isValidMerchantID() {
|
||||
return _merchantID.length == 5;
|
||||
}
|
||||
|
||||
@@ -122,6 +117,5 @@ class _RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
}).catchError((error) {
|
||||
print(error.toString());
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user