小编Kid*_*112的帖子

如何使用flutter从firebase实时检索数据

我在下面有一个屏幕

在此处输入图片说明

当我点击配置文件按钮时,我想从我的 firebase 实时数据库中检索当前配置文件的所有数据并显示在下一页(下图)。

在此处输入图片说明

这些是我想在上面的页面上显示的数据。 在此处输入图片说明

这是我用于编辑配置文件屏幕设计的代码。

Widget _NameTextField(String _name) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Text(
          'Full Name',
          style: kLabelStyle,
        ),
        SizedBox(height: 10.0),
        Container(
          alignment: Alignment.centerLeft,
          decoration: kBoxDecorationStyle,
          height: 60.0,
          child: TextFormField(
            autovalidate: false,
            style: TextStyle(
              color: Colors.white,
              fontFamily: 'OpenSans',
            ),
            decoration: InputDecoration(
              border: InputBorder.none,
              contentPadding: EdgeInsets.only(top: 14.0),
              prefixIcon: Icon(
                Icons.perm_identity,
                color: Colors.white,
              ),
              hintText: 'Enter your Full Name',
              hintStyle: kHintTextStyle,
            ),
            initialValue: _name,
            validator: (String value) {
              if (value.isEmpty) {
                return 'Name is Required.';
              }
              if (value.length < …
Run Code Online (Sandbox Code Playgroud)

dart firebase firebase-realtime-database flutter

2
推荐指数
1
解决办法
4839
查看次数