@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Beacon'),
),
body: _beacons == null
? Center(child: CircularProgressIndicator())
: ListView(
children: ListTile.divideTiles(
context: context,
tiles: _beacons.map((beacon) {
if(beacon.macAddress == "MAC_ADDRESS_FORMAT") {
print(beacon.macAddress);
}
return ListTile(
title: Text(beacon.macAddress),
subtitle: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Flexible(
child: Text(
'Major: ${beacon.major}\nMinor: ${beacon.minor}',
style: TextStyle(fontSize: 13.0)),
flex: 1,
fit: FlexFit.tight),
Flexible(
child: Text(
'Accuracy: ${beacon.accuracy}m\nRSSI: ${beacon.rssi}',
style: TextStyle(fontSize: 13.0)),
flex: 2,
fit: FlexFit.tight)
],
),
);
})).toList(),
),
),
);
}
我需要将流数据显示到小部件列表。有人可以帮我吗?