import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/provider/account.dart';
import 'package:pshared/provider/invitations.dart';
import 'package:pshared/provider/permissions.dart';

import 'package:pweb/controllers/invitations/page.dart';


class InvitationsPageProviders extends StatelessWidget {
  final Widget child;

  const InvitationsPageProviders({
    super.key,
    required this.child,
  });

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProxyProvider3<
      PermissionsProvider,
      InvitationsProvider,
      AccountProvider,
      InvitationsPageController
    >(
      create: (_) => InvitationsPageController(),
      update: (_, permissions, invitations, account, controller) => controller!
        ..update(
          permissions: permissions,
          invitations: invitations,
          account: account,
        ),
      child: child,
    );
  }
}
