import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/controllers/balance_mask/wallets.dart';
import 'package:pshared/provider/ledger.dart';

import 'package:pweb/controllers/dashboard/balance/carousel.dart';


class BalanceWidgetProviders extends StatelessWidget {
  final Widget child;

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

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProxyProvider2<
      WalletsController,
      LedgerAccountsProvider,
      BalanceCarouselController
    >(
      create: (_) => BalanceCarouselController(),
      update: (_, walletsController, ledgerProvider, controller) => controller!
        ..update(
          walletsController: walletsController,
          ledgerProvider: ledgerProvider,
        ),
      child: child,
    );
  }
}
