草庐IT

route-provider

全部标签

ios - XCode 4.2 story builder 的 "Defines Context"和 "Provide Context"是什么意思?

在ViewController部分下的导航Controller属性检查器中有“定义上下文”和“提供上下文”复选框。我找不到关于此功能的任何文档。如何使用它,它有什么作用? 最佳答案 “定义上下文”复选框设置ViewController的definesPresentationContext属性。“提供上下文”复选框设置providesPresentationContextTransitionStyle属性。如果您想了解有关这些属性的更多信息,请观看WWDC2011Session102:ImplementingUIViewControl

flutter - 如何访问 showModalBottomSheet 中提供的 (Provider.of()) 值?

我在小部件树中有一个FloatingActionButton,它有一个BlocProvider来自flutter_bloc.像这样:BlocProvider(builder:(context){SomeBlocsomeBloc=SomeBloc();someBloc.dispatch(SomeEvent());returnsomeBloc;},child:Scaffold(body:...floatingActionButton:FloatingActionButton(onPressed:_openFilterSchedule,child:Icon(Icons.filter_list

Flutter Provider - ChangeNotifierProxyProvider 设置依赖

我在设置与Provider包的依赖关系时遇到了问题和困境。我的代码:providers:[ChangeNotifierProvider(builder:(context)=>AuthModel(userRepository:UserRepository())),ChangeNotifierProxyProvider(initialBuilder:(_)=>AppModel(),builder:(_,auth,app)=>app..authModel=auth,),],使用ChangeNotifierProxyProvider,对authModel的更改使ChangeNotifierPr

Flutter SharedPreferences 值在应用程序启动时提供给 Provider

我正在尝试在应用程序启动时将sharedpreferences的值设置为provider。这是我目前所拥有的,小部件的共享首选项正在运行:https://gist.github.com/andraskende/a19c806aeef0ce88e9a9cafa49660ab4#file-main-dart-L211-L223 最佳答案 最后我通过反复试验弄明白了......它可以在构造函数中完成:classBarcodeProviderwithChangeNotifier{BarcodeProvider(){setup();}void

routes - Action 后生成 flutter 路线?

我试图在成功登录后自动返回到我的菜单屏幕,但我在生成Widget构建和/或上下文时遇到了问题。我在无状态小部件中执行此操作。这是我的代码。我想在最后一个打印语句之后调用路由...Future_handleSignIn()async{try{await_googleSignIn.disconnect();GoogleSignInAccountgoogleUser=await_googleSignIn.signIn();GoogleSignInAuthenticationgoogleAuth=awaitgoogleUser.authentication;print(googleAuth.i

flutter - 错误 : The argument type 'MaterialPageRoute' can't be assigned to the parameter type 'Route<Map>'

我正在学习flutter,这段代码直接来自老师。我知道flutter一直在变化,这可能就是它没有运行的原因。不管怎样,它是:classKlimaticextendsStatefulWidget{@override_KlimaticStatecreateState()=>new_KlimaticState();}class_KlimaticStateextendsState{String_cityEntered;Future_goToNextScreen(BuildContextcontext)async{Mapresults=awaitNavigator.of(context).pus

flutter - 如果类没有上下文,如何从 Provider 访问数据?

我正在使用Provider作为状态管理器。我几乎没有收集数据的小部件。我的小部件之一是应该完成所有数据保存的按钮。它有onPressed(){...}事件。我想在保存之前对数据进行一些计算。我想在单独的类里面做:classResultProcessing{//hereIneedaccesstodatafromprovider}按钮:Flexible(child:Container(child:RaisedButton(child:Text("Save"),onPressed:(){//IneedtopassdatatoResultProcessing},)),),但是我无法访问Prov

flutter - Provider 与 InheritedWidget

我是不是错了,或者如果我们只是想将一个值传递到Widget树下,Provider只是一个带有dispose方法的InheritedWidget吗? 最佳答案 是的。Provider确实主要是基于Inheritedwidgets的特性。如果你想自己做,那很好。但是您很快就会意识到,如果没有提供者,您将拥有数百条无用的重复行。Provider基本上采用了InheritedWidgets的逻辑,但将样板文件减少到严格的最低限度。 关于flutter-Provider与InheritedWidg

android - 包含 path_provider 时出错

我在尝试编译path_provider时遇到错误:/home/user/projects/flutterframework/TestApp/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java:15:error:cannotfindsymbolpath_provider=PathProviderPlugin.register(activity);symbol:methodregister(FlutterActivity)location:classPathProviderPlugin1errorFAILURE:

dart - 参数类型 '_PostCreateRoute' 无法分配给参数类型 'Route<Map>

我正在尝试使用flutter制作一个社交网站。这是一个与提要相关的页面,它存储是否有可供用户使用的提要,如果有提要则显示它。我在提要更新期间使用异步方法进行操作,因此在创建按下时它在创建PostCreateRoute对象时显示错误,即参数类型“_PostCreateRoute”无法分配给参数类型“Route”。我是新手,如果有人能帮助我,那就太好了。class_FeedActionButtonStateextendsState{BuildContext_context;@overrideWidgetbuild(BuildContextcontext){_context=context;