restartApp static method
Restart the application by passing context
.
Reload all widgets and states.
You can describe the process at restart by passing onRestart
.
context
を渡すことでアプリをリスタートします。
すべてのウィジェットや状態をリロードします。
onRestart
を渡すことでリスタート時の処理を記述することができます。
Implementation
static Future<void> restartApp(
BuildContext context, {
FutureOr<void> Function()? onRestart,
}) async {
final state = context.findAncestorStateOfType<_MasamuneAppState>();
await state?._restart(onRestart);
}