import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class WatchState<T> extends StatelessWidget {
  final Widget Function(BuildContext context, T state) child;
  const WatchState(this.child, {super.key});

  @override
  Widget build(BuildContext context) {
    return Consumer<T>(builder: (BuildContext context, T value, Widget? child) => this.child(context, value));
  }
}
