我用 2 个这样的小部件创建 Row
Row(
children: [
new Radio(
value: 0,
groupValue: rv0,
onChanged: _handleRadioValueChange1,
),
GestureDetector(
onTap: (){ //trigger radio button },
child: Text('Tap Me')
)
],
)
Run Code Online (Sandbox Code Playgroud)
因此,当我点击文本时,收音机将被触发,例如在带有 jquery 的 javascript 中
$('#radio').click()
Run Code Online (Sandbox Code Playgroud)
在 dart flutter 中如何做到这一点?谢谢
我在 flutter 中创建了新应用程序,运行它时它可以工作,但是当我添加 shared_preferences 包时,运行它时出现此错误
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':shared_preferences:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':shared_preferences:debugCompileClasspath'.
> Could not resolve project :shared_preferences_macos.
Required by:
project :shared_preferences
> Unable to find a matching configuration of project :shared_preferences_macos:
- None of the consumable configurations have attributes.
> Could not resolve project :shared_preferences_web.
Required by:
project :shared_preferences
> Unable to find a matching configuration of project …Run Code Online (Sandbox Code Playgroud) 我尝试了这段代码,但结果只是大写第一个字母(不是每个字母)
String ucwords(String input) {
if (input == null) {
throw new ArgumentError("string: $input");
}
if (input.length == 0) {
return input;
}
return input[0].toUpperCase() + input.substring(1);
}
Run Code Online (Sandbox Code Playgroud)