SplashScreen + первая стадия экрана регистрации
This commit is contained in:
BIN
assets/logout.png
Normal file
BIN
assets/logout.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/registration_logo.png
Normal file
BIN
assets/registration_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
assets/splash.png
Normal file
BIN
assets/splash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 368 KiB |
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'registration.dart';
|
import 'splash.dart';
|
||||||
|
|
||||||
const String _name = "Ivan Murashov";
|
const String _name = "Ivan Murashov";
|
||||||
|
|
||||||
@@ -9,6 +9,17 @@ void main() {
|
|||||||
|
|
||||||
class Checker extends StatelessWidget {
|
class Checker extends StatelessWidget {
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
return new MaterialApp(title: "DemoApp", home: new RegistrationScreen());
|
return new MaterialApp(title: "DemoApp", home: new SplashScreen());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class BaseState<T> extends State<StatefulWidget> {
|
||||||
|
|
||||||
|
void faq() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void logout() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,41 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'main.dart';
|
||||||
|
|
||||||
/// Экран регистрации магазина и кассы.
|
/// Экран регистрации магазина и кассы.
|
||||||
class RegistrationScreen extends StatefulWidget {
|
class RegistrationScreen extends StatefulWidget {
|
||||||
@override State createState() => new _RegistrationScreenState();
|
@override State createState() => new _RegistrationScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RegistrationScreenState extends State<RegistrationScreen> {
|
class _RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||||
|
|
||||||
static const platform = const MethodChannel('com.dinnect.checker/scanner');
|
static const platform = const MethodChannel('com.dinnect.checker/scanner');
|
||||||
|
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
return new Scaffold(appBar: new AppBar(
|
return new Scaffold(appBar: _getAppBar(), body: _getScreen());
|
||||||
title: new Text("Регистрация магазина")), body: _buildScreen());
|
}
|
||||||
|
|
||||||
|
faq() {}
|
||||||
|
|
||||||
|
AppBar _getAppBar() {
|
||||||
|
return new AppBar(title: new Text("Регистрация магазина"),
|
||||||
|
backgroundColor: const Color(0xff4272e7), actions: <Widget>[
|
||||||
|
new IconButton(
|
||||||
|
icon: new Icon(Icons.help_outline),
|
||||||
|
tooltip: 'Air it',
|
||||||
|
onPressed: faq,
|
||||||
|
),
|
||||||
|
new IconButton(
|
||||||
|
icon: new Image(height: 24.0, width: 24.0, image: new AssetImage('assets/logout.png')),
|
||||||
|
tooltip: 'Restitch it',
|
||||||
|
onPressed: logout,
|
||||||
|
)
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// На экране будет отображаться Column, с отцентрированными виджетами.
|
/// На экране будет отображаться Column, с отцентрированными виджетами.
|
||||||
Widget _buildScreen() {
|
Widget _getScreen() {
|
||||||
return new Center(child: new Column(children: _getChildren()));
|
return new Center(child: new Column(children: _getChildren()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,26 +47,54 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handleSubmitted(String text) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _getChildren() {
|
List<Widget> _getChildren() {
|
||||||
return<Widget>[
|
return<Widget>[
|
||||||
_getLogo(),
|
_getLogo(),
|
||||||
_getInputField("ID кассы"),
|
_getDecoratedInputField("ID магазина", 0.0),
|
||||||
_getInputField("Номер кассы"),
|
_getDecoratedInputField("Номер кассы", 36.0),
|
||||||
|
_getButton()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Row _getLogo() {
|
Container _getLogo() {
|
||||||
return new Row(
|
return new Container(height: 192.0,
|
||||||
// TODO: Два Image() с логотипом
|
child: new Center(
|
||||||
);
|
child: new Image.asset('assets/registration_logo.png',
|
||||||
|
height: 24.0,
|
||||||
|
width: 156.0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Container _getInputField(String hint) {
|
Container _getDecoratedInputField(String hint, double topPadding) {
|
||||||
return new Container(padding: new EdgeInsets.all(8.0),
|
return new Container(
|
||||||
child: new TextField(decoration: new InputDecoration(hintText: hint))) ;
|
padding: new EdgeInsets.only(left: 28.0, right: 28.0, top: topPadding),
|
||||||
|
child: new Container(height: 48.0,
|
||||||
|
padding: new EdgeInsets.only(left: 16.0, right: 16.0),
|
||||||
|
decoration: _getDecoraionForInputField(),
|
||||||
|
child: _getInputField(hint))) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextField _getInputField(String hint) {
|
||||||
|
return new TextField(decoration: new InputDecoration(hintText: hint,
|
||||||
|
hideDivider: true,
|
||||||
|
hintStyle: new TextStyle(color: const Color(0xffa5a5a5),
|
||||||
|
fontSize: 16.0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Decoration _getDecoraionForInputField() {
|
||||||
|
return new BoxDecoration(color: Colors.white,
|
||||||
|
border: new Border.all(
|
||||||
|
color: const Color(0xffcfd8dc), width: 1.0,),
|
||||||
|
borderRadius: new BorderRadius.all(new Radius.circular(4.0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Container _getButton() {
|
||||||
|
return new Container(padding: new EdgeInsets.only(top: 36.0),
|
||||||
|
child: new Container(height: 64.0, padding: new EdgeInsets.all(8.0),
|
||||||
|
child: new RaisedButton(child: new Text('ЗАРЕГИСТРИРОВАТЬ',
|
||||||
|
style: new TextStyle(color: Colors.white)),
|
||||||
|
onPressed: null, disabledColor: const Color(0xffbfbfbf))));
|
||||||
|
}
|
||||||
|
|
||||||
|
doStuff() {}
|
||||||
|
|
||||||
}
|
}
|
||||||
22
lib/splash.dart
Normal file
22
lib/splash.dart
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'registration.dart';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SplashScreen extends StatelessWidget {
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
new Future.delayed(const Duration(milliseconds: 1000), () {
|
||||||
|
_goToNextScreen(context);
|
||||||
|
});
|
||||||
|
return new Image.asset('assets/splash.png', fit: BoxFit.cover);
|
||||||
|
}
|
||||||
|
|
||||||
|
_goToNextScreen(BuildContext context) {
|
||||||
|
Navigator.of(context).push(new MaterialPageRoute<Null>(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return new RegistrationScreen();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,9 +18,10 @@ flutter:
|
|||||||
|
|
||||||
# To add assets to your application, add an assets section here, in
|
# To add assets to your application, add an assets section here, in
|
||||||
# this "flutter" section, as in:
|
# this "flutter" section, as in:
|
||||||
# assets:
|
assets:
|
||||||
# - images/a_dot_burr.jpeg
|
- assets/registration_logo.png
|
||||||
# - images/a_dot_ham.jpeg
|
- assets/splash.png
|
||||||
|
- assets/logout.png
|
||||||
|
|
||||||
# To add assets from package dependencies, first ensure the asset
|
# To add assets from package dependencies, first ensure the asset
|
||||||
# is in the lib/ directory of the dependency. Then,
|
# is in the lib/ directory of the dependency. Then,
|
||||||
|
|||||||
Reference in New Issue
Block a user