INNER CODE UNIT · Dart

_RestartWidgetState

kaina404/FlutterDouBan · lib/main.dart:52

class _RestartWidgetState extends State<RestartWidget> {
  Key key = UniqueKey();

  void restartApp() {
    setState(() {
      key = UniqueKey();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      key: key,
      child: widget.child,
    );
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…