Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
609 B
1
Indexable
Never
/* Flutter & Dart */
import 'package:flutter/material.dart';

class CustomInitState extends StatefulWidget {
  final void Function() initState;
  final void Function()? dispose;
  final Widget child;

  CustomInitState({
    required this.initState,
    required this.child,
    this.dispose,
  });

  @override
  _CustomInitStateState createState() => _CustomInitStateState();
}

class _CustomInitStateState extends State<CustomInitState> {
  @override
  void initState() {
    super.initState();
    widget.initState();
  }

  @override
  Widget build(BuildContext context) {
    return widget.child;
  }
}