import 'package:flutter/material.dart';

import 'view_state_model.dart';

abstract class ViewStateLifecycle<T extends StatefulWidget, VM extends ViewStateModel> extends State<T> {
  VM model;

  @override
  void initState() {
    super.initState();
    model = createModel();
  }

  @override
  void dispose() {
    super.dispose();
    model?.dispose();
  }

  VM createModel();
}
