Получить пользовательские данные для пожарного магазина во флаттере? - PullRequest
0 голосов
/ 30 октября 2018

Данные уже находятся в пожарном хранилище, если пользователь введет правильные данные, перейдет следующая страница и, если неверно, выдаст ошибку. как я могу сделать это на флаттер ???

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:cloud_firestore/cloud_firestore.dart';

void main() => runApp(new MaterialApp(
  title: 'Registration ',
  home: new Signup(),
));



class Signup extends StatelessWidget {

    String one;
    String two;

    var user;

    Future onValidate() async {
        //var user;
        DocumentSnapshot snapshot = await

        Firestore.instance.collection("organization").document('').get().then((user));

        String code_A = snapshot['code_A'];
        String code_B = snapshot['code_B'];

    }

    @override
    Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Sign UP"),
      ),
      body: new Container(
          padding: new EdgeInsets.all(20.0),
          child: new Form(
            //key: this._formKey,
            child: new ListView(
              children: <Widget>[
                new TextFormField(
                    keyboardType: TextInputType.number,
                    onSaved: (String value) {
                      one = value;
                    },
                    validator: _validateEmail,
                    decoration: new InputDecoration(
                        labelText: 'one'
                    )
                ),

                new TextFormField(
                    keyboardType: TextInputType.number,
                    onSaved: (String value) {
                      two = value;
                    },
                    validator: _validateEmail,
                    decoration: new InputDecoration(
                        labelText: 'two'
                    )
                ),

                /*new TextFormField(
                    keyboardType: TextInputType.text,
                    // Use email input type for emails.
                    decoration: new InputDecoration(

                        labelText: 'Mobile number'
                    )
                ),*/
                new Container(
                  //width: screenSize.width,
                  child: new RaisedButton(
                    child: new Text(
                      'Sign Up',
                      style: new TextStyle(
                          color: Colors.white
                      ),
                    ),

                    onPressed: (){
                      if
                      }


                    //color: Colors.blue,
                  ),
                  margin: new EdgeInsets.only(
                      top: 20.0
                  ),
                )
              ],
            ),
          )
      ),
    );
  }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...