Flutter 生成器已被弃用,不应使用';不要使用颤振提供程序

Flutter 生成器已被弃用,不应使用';不要使用颤振提供程序,flutter,dart,flutter-provider,Flutter,Dart,Flutter Provider,如何解决这个问题?我尝试添加create,如何传递这些参数 ProxyProvider<YelloChatDb, UserDao>( builder: (context, yelloChatDb, userdAO) => UserDao(yelloChatDb), ), ProxyProvider<YelloVendorClient, VendorService>( builder: (context, yelloVendorCli

如何解决这个问题?我尝试添加
create
,如何传递这些参数

  ProxyProvider<YelloChatDb, UserDao>(
    builder: (context, yelloChatDb, userdAO) => UserDao(yelloChatDb),
  ),

  ProxyProvider<YelloVendorClient, VendorService>(
      builder: (context, yelloVendorClient, categoryService) =>
          VendorService.create(yelloVendorClient.chopperClient),
      dispose: (context, categoryService) => categoryService.client.dispose()),
ProxyProvider(
生成器:(context,yelloChatDb,userdAO)=>userdAO(yelloChatDb),
),
代理提供者(
生成器:(上下文、yelloVendorClient、categoryService)=>
VendorService.create(yelloVendorClient.chopperClient),
dispose:(上下文,categoryService)=>categoryService.client.dispose()),
Dao类

@UseDao(tables: [Users])
class UserDao extends DatabaseAccessor<YelloChatDb> with _$UserDaoMixin {
  UserDao(YelloChatDb db) : super(db);

...
}
@UseDao(表:[用户])
类UserDao使用$UserDaoMixin扩展DatabaseAccessor{
UserDao(YelloChatDb):超级(db);
...
}
更改日志3.2.0
反对提供商的“构建者”而赞成“创建”
您可以使用
create
而不是
builder

来自
代码片段

Widget build(BuildContext context) {
  return MultiProvider(
    providers: [
      ChangeNotifierProvider(create: (_) => Counter()),
      ProxyProvider<Counter, Translations>(
        create: (_, counter, __) => Translations(counter.value),
      ),
    ],
    child: Foo(),
  );
}
小部件构建(构建上下文){
回程多供应商(
供应商:[
ChangeNotifierProvider(创建:()=>Counter()),
代理提供者(
创建:(u,counter,u)=>翻译(counter.value),
),
],
child:Foo(),
);
}