
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
import 'package:twong/providers/address.dart';

import 'package:twong/providers/order_num.dart';
import 'package:twong/providers/setting.dart';
import 'package:twong/providers/user.dart';
import 'package:twong/providers/home.dart';
import 'package:twong/providers/message.dart';

List<SingleChildWidget> providers = [
  ...independentServices,
  ...dependentServices,
  ...uiConsumableProviders
];

/// 独立的model
List<SingleChildWidget> independentServices = [
  ChangeNotifierProvider<UserModel>(
    create: (context) => UserModel(null),
  ),
  ChangeNotifierProvider<HomeModel>(
    create: (context) => HomeModel(),
  ),
  ChangeNotifierProvider<OrderNumModel>(
    create: (context) => OrderNumModel(),
  ),
  ChangeNotifierProvider<MessageModel>(
    create: (context) => MessageModel(),
  ),


  ChangeNotifierProvider<SettingModel>(
    create: (context) => SettingModel(),
  ),
  ChangeNotifierProvider<AddressModel>(
    create: (context) => AddressModel(),
  ),
];

/// 需要依赖的model
List<SingleChildWidget> dependentServices = [
  // ChangeNotifierProxyProvider<GlobalFavouriteStateModel, UserModel>(
  //   create: null,
  //   update: (context, globalFavouriteStateModel, userModel) =>
  //   userModel ??
  //       UserModel(globalFavouriteStateModel: globalFavouriteStateModel),
  // )
];

List<SingleChildWidget> uiConsumableProviders = [
//  StreamProvider<User>(
//    builder: (context) => Provider.of<AuthenticationService>(context, listen: false).user,
//  )
];