Files
checker/lib/registration.dart

54 lines
1.5 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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))) ;
}
}