Created
December 19, 2019 09:47
-
-
Save nmaruy27/57523fc2a94ca5a3a528c7e9fc388228 to your computer and use it in GitHub Desktop.
HogeInfoBefore.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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