Flutter StreamBuilder 的用法 异步流操作
/// Flutter code sample for StreamBuilder
// This sample shows a [StreamBuilder] that listens to a Stream that emits bids
// for an auction. Every time the StreamBuilder receives a bid from the Stream,
// it will display the price of the bid below an icon. If the Stream emits an
// error, the error is displayed below an error icon. When the Stream finishes
// emitting bids, the final price is displayed.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
/// This is the main application widget.
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: _title,
home: MyStatefulWidget(),
);
}
}
/// This is the stateful widget that the main application instantiates.
class MyStatefulWidget extends Stat

最低0.47元/天 解锁文章

2099

被折叠的 条评论
为什么被折叠?



