小编use*_*327的帖子

如何在flutter web上将PaginatedDataTable或数据表上的所有文档字段显示为firestore作为streambuilder?

我能够在 PaginatoredDataTable 上显示普通文本字段。但我想将 PaginatoredDataTable 上的 Firestore 字段显示为流构建器方法。我在互联网上搜索过,但找不到与我的要求相关的内容。如何将 firestore 数据获取到 PaginatedDataTable 源中。或者有什么其他方法请告诉我。寻找解决方案,如果也有可磁带行或可选择行,则非常有用。我只想从 firestore 获取数据,而不是从 firebase auth 获取数据。我将 firestore 集合名称命名为“users”。我也有所不同 需要帮助 如何做到这一点?如果在PaginatedDataTable 中不可能,DataTable 也可以。

以下是我的示例 Firestore 集合和文档结构:

firestore collection name: users

documentID1-
    email: 'email1'
    name : 'name1'
    role : 'role1'
    uid  : 'uid1'

documentID2-
    email: 'email2'
    name : 'name2'
    role : 'role2'
    uid  : 'uid2'   
Run Code Online (Sandbox Code Playgroud)

(20多个文件)

下面是我的示例代码,通常能够以普通文本显示:

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

class AdminDashboard extends StatefulWidget {
  const AdminDashboard({Key? key}) : super(key: key);

  @override
  _AdminDashboardState createState() => _AdminDashboardState();
}

class _AdminDashboardState extends State<AdminDashboard> …
Run Code Online (Sandbox Code Playgroud)

dart firebase flutter google-cloud-firestore flutter-web

6
推荐指数
1
解决办法
756
查看次数

如何在 Windows 10 上安装和使用 python 3.8 和 3.7

如何在 Windows 10 上使用 Python 3.8 和 3.7。我想制作两个应用程序,但一个需要 3.8,另一个需要 3.7。那么如何在一个 Windows 10 中管理两个版本。

python python-install python-3.x

4
推荐指数
1
解决办法
1万
查看次数