jjzjj

ButtonItem_OnPressed

全部标签

android - FloatingActionButton onpressed()无法正常工作

当我点击fab时没有任何反应这是我的代码,也许你们中的一个可以提供帮助:)voidinitSpeechRecognizer(){_speechRecognition=SpeechRecognitionFloatingActionButton(child:Icon(Icons.mic),onPressed:(){if(_isAvailable&&!_isListening)_speechRecognition.listen(locale:"id_ID").then((result)=>print('result:$result'));},heroTag:"mic",),

dart - 在 'Void' Flutter 上调用 'onPressed/onTap' 时出错

在onPressed/onTap中调用void时出现错误我正在尝试在继承的小部件/状态中调用设置状态按照此说明https://medium.com/flutter-community/widget-state-buildcontext-inheritedwidget-898d671b7956在我不专业的眼里看起来他也在做同样的事情,但显然我错过了一些东西;你能帮帮我吗?classInhCoreextendsInheritedWidget{InhCore({Keykey,@requiredWidgetchild,@requiredthis.data}):super(key:key,chi

dart - 在 'Void' Flutter 上调用 'onPressed/onTap' 时出错

在onPressed/onTap中调用void时出现错误我正在尝试在继承的小部件/状态中调用设置状态按照此说明https://medium.com/flutter-community/widget-state-buildcontext-inheritedwidget-898d671b7956在我不专业的眼里看起来他也在做同样的事情,但显然我错过了一些东西;你能帮帮我吗?classInhCoreextendsInheritedWidget{InhCore({Keykey,@requiredWidgetchild,@requiredthis.data}):super(key:key,chi

android - flutter :IconButton onPressed 没有被调用

我在ScaffoldappBar中放置了一个小部件列表作为操作,但是当我按下它们时它们没有响应,我在场景中也有一个floatingButton并且它完美运行。appBar:newAppBar(title:newText(widget.title,style:newTextStyle(fontFamily:'vazir'),),centerTitle:true,actions:[newIconButton(icon:newIcon(Icons.search),highlightColor:Colors.pink,onPressed:_onSearchButtonPressed(),),]

android - flutter :IconButton onPressed 没有被调用

我在ScaffoldappBar中放置了一个小部件列表作为操作,但是当我按下它们时它们没有响应,我在场景中也有一个floatingButton并且它完美运行。appBar:newAppBar(title:newText(widget.title,style:newTextStyle(fontFamily:'vazir'),),centerTitle:true,actions:[newIconButton(icon:newIcon(Icons.search),highlightColor:Colors.pink,onPressed:_onSearchButtonPressed(),),]

dart - 在 SnackBarAction onPressed 上 flutter 小吃吧

我想关闭SnackBarAction的onPressed方法上的SnackBar。我尝试使用Navigator.of(context).pop();但SnackBar并没有让我的屏幕变黑。代码如下:voidshowInSnackBar(Stringvalue){homeScaffoldKey.currentState.showSnackBar(newSnackBar(content:newText(value),action:SnackBarAction(label:'Dissmiss',textColor:Colors.yellow,onPressed:(){//Navigator.

dart - 在 SnackBarAction onPressed 上 flutter 小吃吧

我想关闭SnackBarAction的onPressed方法上的SnackBar。我尝试使用Navigator.of(context).pop();但SnackBar并没有让我的屏幕变黑。代码如下:voidshowInSnackBar(Stringvalue){homeScaffoldKey.currentState.showSnackBar(newSnackBar(content:newText(value),action:SnackBarAction(label:'Dissmiss',textColor:Colors.yellow,onPressed:(){//Navigator.

flutter - 如何在 onPressed 按钮时从 ListView 中删除 TextField?

当用户单击“清除图标”按钮时如何删除TextField?(不仅仅是清除TextField的文本)用户故事用户点击一个按钮来添加玩家。(从技术上讲,这个按钮添加了TextField)用户可以在TextField中写入玩家的名字。用户单击“清除图标”按钮以删除当前的TextField(与添加功能相反)。newListView.builder(padding:EdgeInsets.all(0),shrinkWrap:true,physics:NeverScrollableScrollPhysics(),itemCount:5,itemBuilder:(context,index){print

dart - Navigator.push() 的类型无法签名到 onPressed

我正在查看flutter文档和示例,但我卡在了路由中。这是文档https://docs.flutter.io/flutter/widgets/Navigator-class.html它告诉我可以做一个带有功能的按钮,以使用Navigator进行导航onPressed:(context){Navigator.pop(context);}但我的ide(vs代码)和调试器认为这是不可能的。当我尝试这样做时它向我显示错误。[dart]Theargumenttype'(dynamic)→Null'can'tbeassignedtotheparametertype'()→void'.构建也因异常而

Flutter:如何从单独的 Widget 方法调用 onPressed() 中的 setState()

我是这个Flutter的新手我正在尝试在onPressed时更改FlatButton文本。我的页面设计在单独的Widget方法中,所以无法在onPressed中添加setState()。我搜索了很多。但是,找不到。请帮我解决这个问题。import'package:flutter/material.dart';intnumber=10;classSecondRouteextendsStatelessWidget{Widgetbuild(BuildContextcontext){returnnewScaffold(appBar:newAppBar(title:newText('Lists'