Skip to content

Instantly share code, notes, and snippets.

@nmaruy27
Created December 19, 2019 09:47
Show Gist options
  • Save nmaruy27/57523fc2a94ca5a3a528c7e9fc388228 to your computer and use it in GitHub Desktop.
Save nmaruy27/57523fc2a94ca5a3a528c7e9fc388228 to your computer and use it in GitHub Desktop.
HogeInfoBefore.dart
class HogeInfo extends StatefulWidget {
final String _hogeId;
const HogeInfo(this._hogeId);
@override
_HogeInfoState createState() => _HogeInfoState();
}
class _HogeInfoState extends State<HogeInfo> {
HogeData _hogeData;
@override
void initState() {
super.initState();
_loadData();
}
Future<void> _loadData() async {
final HogeData data = await fetchHogeData(widget._hogeId);
setState(() => _hogeData = data);
}
@override Widget build(BuildContext context) {
// 省略
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment