I gotta say that I miss some from of let-binding, so I don't have to choose between (a) local variables plus newline-separated statements, including "return", wrapped in {}, and (b) the lovely syntax of `Widget build = (context) => ...`.
E.g. instead of writing
Widget helloWidget(BuildContext context) {
final db = Provider.of<MyDatabase>(context, listen: false);
return Row(
children: <Widget>[
Text("Hello, "),
FutureBuilder<String>(
future: db.username,
builder: (ctx, snapshot) =>
snapshot.hasData ? Text(snapshot.data) : CircularProgressIndicator(),
),
]
);
}
i'd like to write:
Widget helloWidget = (BuildContext context) =>
let db = Provider.of<MyDatabase>(context, listen: false)
in Row(
children: <Widget>[
Text("Hello, "),
FutureBuilder<String>(
future: db.username,
builder: (ctx, snapshot) =>
snapshot.hasData ? Text(snapshot.data) : CircularProgressIndicator(),
),
]
);