arrays - 如何从 Cloud Firestore 获取嵌套数组的数据以进行颤动?
问题描述
我需要从主题数组中获取数据。主题数组包含多个映射,每个映射包含另一个数组。我需要从嵌套数组中获取数据并将其显示到 ListView。在这里我附上我的数据库和我的代码。
Padding(
padding: const EdgeInsets.all(8.0),
child: GetBuilder<DataController>(
init: DataController(),
builder: (value) {
return FutureBuilder(
future: value.getData('englishcategories'),
builder: (context, snapshot) {
if (snapshot.connectionState ==
ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(
backgroundColor: Colors.black,
),
);
} else {
return SingleChildScrollView(
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: snapshot.data.length,
// itemCount: snapshot.data[],
itemBuilder:
(BuildContext context, int index) {
return Container(
height:
MediaQuery.of(context).size.height,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(
left: 15, right: 15),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'',
// Get.arguments['subject']
// [index]['duration'][index],
style: TextStyle(
height: 1.4,
fontSize: 28,
color: Colors.black
.withOpacity(0.9),
fontWeight:
FontWeight.w700,
fontFamily: 'Raleway'),
),
解决方案
推荐阅读
- eigen3 - 将一个块从 Eigen::Matrix 复制到同一矩阵的另一个块时,会出现什么混叠问题?
- flask - Flask-Dance 在重定向时使用 localhost 而不是域
- reactjs - 如何使用 React 为 Bootstrap 启用切换
- php - 奇怪的 MySQL 通配符行为
- kubernetes - k8 Ingress 规则是否应该直接通过 helm 更新
- html - 使用 Angular JS 为 Google 工作表数据创建搜索框?
- python - 为android编译python程序
- vb6 - 有没有VB6函数可以翻转MSChart的Y轴?
- javascript - Reduce Regions, some features dont contains centroid of pixel, in consecuence extracts of min or max obtains null value
- chromecast - Chromecast 接收器 (CAF) 多音频问题