54 lines
1.5 KiB
Dart
54 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
||
import 'package:flutter/services.dart';
|
||
import 'dart:async';
|
||
|
||
/// Экран регистрации магазина и кассы.
|
||
class RegistrationScreen extends StatefulWidget {
|
||
@override State createState() => new _RegistrationScreenState();
|
||
}
|
||
|
||
class _RegistrationScreenState extends State<RegistrationScreen> {
|
||
|
||
static const platform = const MethodChannel('com.dinnect.checker/scanner');
|
||
|
||
@override Widget build(BuildContext context) {
|
||
return new Scaffold(appBar: new AppBar(
|
||
title: new Text("Регистрация магазина")), body: _buildScreen());
|
||
}
|
||
|
||
/// На экране будет отображаться Column, с отцентрированными виджетами.
|
||
Widget _buildScreen() {
|
||
return new Center(child: new Column(children: _getChildren()));
|
||
}
|
||
|
||
Future<Null> startScanner() async {
|
||
try {
|
||
platform.invokeMethod('startScanner');
|
||
} on PlatformException {
|
||
|
||
}
|
||
}
|
||
|
||
void _handleSubmitted(String text) {
|
||
|
||
}
|
||
|
||
List<Widget> _getChildren() {
|
||
return<Widget>[
|
||
_getLogo(),
|
||
_getInputField("ID кассы"),
|
||
_getInputField("Номер кассы"),
|
||
];
|
||
}
|
||
|
||
Row _getLogo() {
|
||
return new Row(
|
||
// TODO: Два Image() с логотипом
|
||
);
|
||
}
|
||
|
||
Container _getInputField(String hint) {
|
||
return new Container(padding: new EdgeInsets.all(8.0),
|
||
child: new TextField(decoration: new InputDecoration(hintText: hint))) ;
|
||
}
|
||
} |