草庐IT

assignment-operator

全部标签

flutter : Navigator operation requested with a context that does not include a Navigator

我有一个场景,其中我根据将用户重定向到HomePage或LandingPage的值检查SharePreferences的值。我不确定我哪里错了?但我在下面收到此错误:我想它没有正确获取上下文,不知道如何获取它?UnhandledException:NavigatoroperationrequestedwithacontextthatdoesnotincludeaNavigator.E/flutter(11533):ThecontextusedtopushorpoproutesfromtheNavigatormustbethatofawidgetthatisadescendantofaN

flutter - 错误 : A value of type 'Widget' can't be assigned to a variable of type 'File'

'File_image'在类State中声明,编码意味着在Widget主体中声明'null->image'(同步?)。但这种编码不合适。我该怎么办?我什么也做不了。import'dart:io';import'package:flutter/material.dart';import'package:image_picker/image_picker.dart';classCreatePageextendsStatefulWidget{..@override...._CreatePageStatecreateState()=>_CreatePageState();}class_Crea

list - flutter : Unsupported operation: Cannot add to an unmodifiable list

我在StatelessWidget中有一个ListView。它有项目,每个项目都包含一个复选框。当有人检查一个项目时,我希望ListView将其作为参数发送到另一个页面。但是当我这样做时,它给了我这个错误:I/flutter(7067):ThefollowingUnsupportedErrorwasthrownwhilehandlingagesture:I/flutter(7067):Unsupportedoperation:CannotaddtoanunmodifiablelistI/flutter(7067):Whentheexceptionwasthrown,thiswasthe

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 - 覆盖 operator== 是否有助于避免重建?

我有一个无状态的小部件classFooextendsStatelessWidget{finalStringtext;A(this.text);Widgetbuild(BuildContext_)=>Text(text);}假设我在小部件树中的某处创建了一个“Foo”实例(很少)更改“文本”。当然,每当我创建一个新的“Foo”实例时,即使它具有相同的“文本”,它的“构建”也会被调用。是否会引入一个检查“文本”的“operator==”来避免重建?编辑:小部件树中只有一个“Foo”实例,但它始终是每个父构建的新实例。编辑:我想我在‘framework.dart’中找到了Flutter代码库

dart - flutter 错误 :The argument type 'Future<Image>' can't be assigned to the parameter type 'Widget'

我在使用flutterflame库时遇到了这个错误Theargumenttype'Future'can'tbeassignedtotheparametertype'Widget'.我的代码是:import'package:flutter/material.dart';import'package:flame/flame.dart';classTileMapextendsStatefulWidget{@override_TileMapStatecreateState()=>_TileMapState();}class_TileMapStateextendsState{@overrideW

dart - 错误 : The argument type '() → Null' can't be assigned to the parameter type '(Null) → FutureOr<dynamic>'

import'package:flutter/material.dart';import'package:camera/camera.dart';classRegisterextendsStatefulWidget{Listcameras;@override_RegistercreateState(){return_Register();}Register(this.cameras);}class_RegisterextendsState{CameraControllercontroller;@overrideWidgetbuild(BuildContextcontext){retur

dart - 错误 : The argument type '(File) → Future<dynamic>' can't be assigned to the parameter type '(dynamic) → FutureOr<dynamic>'

我正在尝试编译示例:https://github.com/dart-lang/googleapis_examples/blob/master/drive_upload_download_console/bin/main.dart我得到以下Dart编译错误error:Theargumenttype'(File)→Future'can'tbeassignedtotheparametertype'(dynamic)→FutureOr'.(argument_type_not_assignableatlib/google_api_rest/main.dart:49)来自以下代码://Downlo

ruby-on-rails-3 - 错误 : operator does not exist: character varying = integer

我遇到了一个常见问题。我的Rails应用程序在我的本地机器上运行,但在部署到heroku后它崩溃了:这是来自heroku日志:ActionView::Template::Error(PGError:ERROR:operatordoesnotexist:charactervarying=integerLINE1:SELECT"hotels".*FROM"hotels"WHERE("hotels".user_id=1)^HINT:Nooperatormatchesthegivennameandargumenttype(s).Youmightneedtoaddexplicittypecast

python - "Operation not Permitted"用于 Redis

我在已经安装了redis的mac上开发。默认情况下它没有redis.conf所以当我$redis-server时使用默认设置#Warning:noconfigfilespecified,usingthedefaultconfig.Inordertospecifyaconfigfileuse'redis-server/path/to/redis.conf'我正在尝试使用redis-py并具有以下内容importredisr=redis.Redis('localhost')r.set('foo','bar')r.get('foo')但出现如下错误redis.exceptions.Respo