小部件 nameField() {
if (widget.isSignUpPage == true) {
return Column(
children: \[
AppTextFormField(
hint: 'Name',
validator: (value) {
if (value == null || value.isEmpty || value.startsWith(' ')) {
return 'Please enter a valid name';
}
},
controller: nameController,
),
Gap(18.h),
\],
);
}
return const SizedBox.shrink();
}
您可以从这里获取完整代码
FAILURE:构建失败并出现异常。
* 出了什么问题:
配置项目“:rive_common”时出现问题。
\> 无法调用“String.startsWith(String)”,因为“versionOutput”为空
* 尝试:
\> 使用 --stacktrace 选项运行以获取堆栈跟踪。
\> 使用 --info 或 --debug 选项运行以获得更多日志输出。
\> 使用 --scan 运行以获得完整的见解。
\> 在 https://help.gradle.org 获取更多帮助。
4秒内构建失败
运行 Gradle 任务“assembleDebug”... 6.0s
错误:Gradle 任务 assembleDebug 失败,退出代码为 1
即使我没有添加rive的包。
您正在代码中某处的空字符串上调用startsWith()