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

import 'theme.dart';

class ThemeWrapper extends StatelessWidget {
  final Function(
    CustomColorSet colors,
    AppTheme controller,
  ) builder;

  const ThemeWrapper({Key? key, required this.builder}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Consumer<AppTheme>(builder: (context, theme, _) {
      return builder(theme.colors, theme);
    });
  }
}
