import 'package:chat/photo/entity/options.dart';
import 'package:chat/photo/provider/asset_provider.dart';
import 'package:flutter/material.dart';

class PhotoPickerProvider extends InheritedWidget {
  final Options options;
  final AssetProvider assetProvider = AssetProvider();

  PhotoPickerProvider({
    @required this.options,
    @required Widget child,
    Key key,
  }) : super(key: key, child: child);

  @override
  bool updateShouldNotify(InheritedWidget oldWidget) {
    return true;
  }

  static PhotoPickerProvider of(BuildContext context) =>
      context.dependOnInheritedWidgetOfExactType<PhotoPickerProvider>();

  static AssetProvider assetProviderOf(BuildContext context) =>
      of(context).assetProvider;
}
