方法';[]和#x27;在null上调用了。接收方:null尝试呼叫:[](“状态”) ════════ widgets库捕获到异常═══════════════════════════════════════════════════════ 对null调用了方法“[]”。 收件人:空 已尝试呼叫:[](“状态”) 导致错误的相关小部件是: StreamBuilderfile:///H:/Logos/Flutter-project multi-store master/lib/tiles/stores\u tile.dart:97:12 ════════════════════════════════════════════════════════════════════════════════════════════════════ ════════ widgets库捕获到异常═══════════════════════════════════════════════════════ 对null调用了方法“[]”。 收件人:空 已尝试呼叫:[](“状态”) 导致错误的相关小部件是: StreamBuilderfile:///H:/Logos/Flutter-project multi-store master/lib/tiles/stores\u tile。省道:8:12 ════════════════════════════════════════════════════════════════════════════════════════════════════ ════════ widgets库捕获到异常═══════════════════════════════════════════════════════ 对null调用了方法“[]”。 收件人:空 已尝试呼叫:[](“状态”) 导致错误的相关小部件是: StreamBuilderfile:///H:/Logos/Flutter-project multi-store master/lib/tiles/stores\u tile。省道:52:12
这是路径文件夹代码方法';[]和#x27;在null上调用了。接收方:null尝试呼叫:[](“状态”) ════════ widgets库捕获到异常═══════════════════════════════════════════════════════ 对null调用了方法“[]”。 收件人:空 已尝试呼叫:[](“状态”) 导致错误的相关小部件是: StreamBuilderfile:///H:/Logos/Flutter-project multi-store master/lib/tiles/stores\u tile.dart:97:12 ════════════════════════════════════════════════════════════════════════════════════════════════════ ════════ widgets库捕获到异常═══════════════════════════════════════════════════════ 对null调用了方法“[]”。 收件人:空 已尝试呼叫:[](“状态”) 导致错误的相关小部件是: StreamBuilderfile:///H:/Logos/Flutter-project multi-store master/lib/tiles/stores\u tile。省道:8:12 ════════════════════════════════════════════════════════════════════════════════════════════════════ ════════ widgets库捕获到异常═══════════════════════════════════════════════════════ 对null调用了方法“[]”。 收件人:空 已尝试呼叫:[](“状态”) 导致错误的相关小部件是: StreamBuilderfile:///H:/Logos/Flutter-project multi-store master/lib/tiles/stores\u tile。省道:52:12,flutter,dart,Flutter,Dart,这是路径文件夹代码 ════════ Exception caught by widgets library ═══════════════════════════════════════════════════════ The method '[]' was called on null. Receiver: null Tried calling: []("status") The relevant error-causing widget was: StreamBu
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The method '[]' was called on null.
Receiver: null
Tried calling: []("status")
The relevant error-causing widget was:
StreamBuilder<DocumentSnapshot> file:///H:/Logos/Flutter-project-multi-store-master/lib/tiles/stores_tile.dart:97:12
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The method '[]' was called on null.
Receiver: null
Tried calling: []("status")
The relevant error-causing widget was:
StreamBuilder<DocumentSnapshot> file:///H:/Logos/Flutter-project-multi-store-master/lib/tiles/stores_tile.dart:8:12
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The method '[]' was called on null.
Receiver: null
Tried calling: []("status")
The relevant error-causing widget was:
StreamBuilder<DocumentSnapshot> file:///H:/Logos/Flutter-project-multi-store-master/lib/tiles/stores_tile.dart:52:12
import'包:cloud_firestore/cloud_firestore.dart';
导入“包裹:送货单/标签/商店标签”;
进口“包装:颤振/材料.省道”;
类ApalLocatile扩展了无状态小部件{
@凌驾
小部件生成(BuildContext上下文){
返回流生成器(
流:Firestore.instance
.collection('statusStore')
.文件('statusLoja01')
.snapshots(),
生成器:(上下文,快照){
如果(!snapshot.hasData){
返回中心(
子对象:CircularProgressIndicator(),
);
}否则{
返回列(
儿童:[
填充物(
填充:仅限边设置(左:10,顶:4,右:10),
孩子:InkWell(
onTap:snapshot.data['status']==false
无效的
: () {
导航器.of(上下文).push(MaterialPageRoute(
生成器:(context)=>StorePalhocaTab());
},
孩子:_buildItens(上下文“images/lojaA.jpg”,
“比萨餐厅”、“O PalhoçãO”),
),
正文(
snapshot.data['status']==true
“阿伯托庄园”
:“费查多庄园”,
样式:TextStyle(
颜色:快照。数据['status']==true
?颜色。绿色口音[700]
:颜色。红色),
)
],
);
}
});
}
}
类DeliciaTile扩展了无状态小部件{
@凌驾
小部件构建(构建上下文){
返回流生成器(
流:Firestore.instance
.collection('statusStore')
.文件('statusLoja02')
.snapshots(),
生成器:(上下文,快照){
如果(!snapshot.hasData){
返回中心(
子对象:CircularProgressIndicator(),
);
}否则{
返回列(
儿童:[
填充物(
填充:仅限边设置(左:10,顶:4,右:10),
孩子:InkWell(
onTap:snapshot.data['status']==false
无效的
: () {
导航器.of(上下文).push(MaterialPageRoute(
生成器:(context)=>StoreDeliciaTab());
},
孩子:_buildItens(上下文“images/lojaB.jpg”,
‘比萨餐厅’、‘美味比萨’,
),
),
正文(
snapshot.data['status']==true
“阿伯托庄园”
:“费查多庄园”,
样式:TextStyle(
颜色:快照。数据['status']==true
?颜色。绿色口音[700]
:颜色。红色),
)
],
);
}
});
}
}
类OboticarioTile扩展了无状态小部件{
@凌驾
小部件构建(构建上下文){
返回流生成器(
流:Firestore.instance
.collection('statusStore')
.文件(“statusLoja03”)
.snapshots(),
生成器:(上下文,快照){
如果(!snapshot.hasData){
返回中心(子项:CircularProgressIndicator());
}否则{
返回列(
儿童:[
填充物(
填充:仅限边设置(左:10,顶:4,右:10),
孩子:InkWell(
onTap:snapshot.data['status']
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:delivery_morenope/tabs/stores_tab.dart';
import 'package:flutter/material.dart';
class ApalhocaTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja01')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StorePalhocaTab()));
},
child: _buildItens(context, 'images/lojaA.jpg',
'Restaurante e Pizzaria', 'O Palhoção')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class DeliciaTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja02')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreDeliciaTab()));
},
child: _buildItens(context, 'images/lojaB.jpg',
'Restaurante e Pizzaria', 'Pizzaria Deliciosa'),
),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class OboticarioTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja03')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(child: CircularProgressIndicator());
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreBoticarioTab()));
},
child: _buildItens(context, 'images/lojaC.jpg',
'Perfumaria', 'O Boticário')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class MinhaCoxinhaFavoritaTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja04')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(child: CircularProgressIndicator());
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
StoreMinhaCoxinhaFavoritaTab()));
},
child: _buildItens(context, 'images/lojaD.jpg',
'Lanchonete', 'Minha\nEmpada Favorita')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class MagoEspetionhoTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja05')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(child: CircularProgressIndicator());
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
StoreMagoEspetinhoTab()));
},
child: _buildItens(context, 'images/lojaE.jpg',
'Espetinho', 'Magão do Espetinho')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class DaLenaTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja06')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreDalenaTab()));
},
child: _buildItens(context, 'images/lojaF.jpg',
'Hamburgueria', 'Helena\nHamburgueria')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class DindinTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja07')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreDindinTab()));
},
child: _buildItens(context, 'images/lojaG.jpg',
'Lanchonete', 'Gourmet')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class PizzaMaitaTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja09')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StorePizzaMaitaTab()));
},
child: _buildItens(context, 'images/lojaI.jpg',
'Pizzaria Delivery', 'Pizza Oxente')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class LeChefTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja08')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLeChefTab()));
},
child: _buildItens(
context, 'images/lojaH.jpg', 'Pizzaria', 'Chef')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class LojaJ extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja10')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLojaJTab()));
},
child: _buildItens(context, 'images/lojaJ.jpg', 'Doceria',
'Sabores Delícia')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class LojaL extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja11')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLojaLTab()));
},
child: _buildItens(context, 'images/lojaL.jpg',
'Farmácia', 'Pague Pouco')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class LojaM extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja12')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLojaMTab()));
},
child: _buildItens(context, 'images/lojaM.jpg', 'Padaria',
'Sabores do Pão')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class LojaN extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja13')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {}
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLojaNTab()));
},
child: _buildItens(context, 'images/lojaN.jpg', 'Armazém',
'João Ferragens')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
});
}
}
class LojaO extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja14')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(child: CircularProgressIndicator());
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLojaOTab()));
},
child: _buildItens(context, 'images/lojaO.jpg', 'Bar',
'Tô Perto de Casa')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
class LojaP extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<DocumentSnapshot>(
stream: Firestore.instance
.collection('statusStore')
.document('statusLoja15')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
} else {
return Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 10, top: 4, right: 10),
child: InkWell(
onTap: snapshot.data['status'] == false
? null
: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => StoreLojaPTab()));
},
child: _buildItens(context, 'images/lojaP.jpg',
'Papelaria', 'Happylândia')),
),
Text(
snapshot.data['status'] == true
? 'Estabelecimento ABERTO'
: 'Estabelecimento FECHADO',
style: TextStyle(
color: snapshot.data['status'] == true
? Colors.greenAccent[700]
: Colors.red),
)
],
);
}
});
}
}
Widget _buildItens(context, imgStore, preName, storeName) {
return //Card(
//margin: EdgeInsets.symmetric(horizontal: 2, vertical: 1),
//elevation: 1,
/*child:*/ Padding(
padding: EdgeInsets.all(4),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: Row(children: [
Container(
height: 70,
width: 70,
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(imgStore)),
border: Border.all(
color: Colors.grey[400],
style: BorderStyle.solid,
width: 1),
borderRadius: BorderRadius.circular(4),
),
),
SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(preName,
style:
TextStyle(fontSize: 14, color: Colors.grey[600])),
Text(
storeName,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.grey[800]),
),
],
),
])),
//Icon(Icons.store, color: Colors.grey[500], size: 18),
],
),
)); //);
}