Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample EditableText 报错 #18

Closed
CaiJingLong opened this issue Mar 6, 2019 · 3 comments
Closed

Sample EditableText 报错 #18

CaiJingLong opened this issue Mar 6, 2019 · 3 comments

Comments

@CaiJingLong
Copy link

运行sample项目的时候会报错

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building _ComponentWidget<TodoEditState>(dirty, state:
flutter: _ComponentState<TodoEditState>#33858):
flutter: 'package:flutter/src/widgets/editable_text.dart': Failed assertion: line 241 pos 15:
flutter: 'backgroundCursorColor != null': is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2      new EditableText (package:flutter/src/widgets/editable_text.dart:241:15)
flutter: #3      buildView (package:sample/todo_edit_page/view.dart:31:26)
flutter: #4      _ViewUpdater.buildView (package:fish_redux/src/redux_component/component.dart:143:22)
flutter: #5      _ComponentState.build (package:fish_redux/src/redux_component/component.dart:197:20)
flutter: #6      StatefulElement.build (package:flutter/src/widgets/framework.dart:3825:27)
flutter: #7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3736:15)

flutter --version

~ flutter --version
Flutter 1.2.1 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (3 weeks ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

EditableText 中的backgroundCursorColor是必填项

@Yacumima
Copy link

Yacumima commented Mar 6, 2019

嗯,是的,我们在1.0.0环境下开发的,1.2.1环境下会有这个问题

@nicetu
Copy link

nicetu commented Mar 6, 2019

backgroundCursorColor 这个去掉就可以了可以参考EditableText的定义没有这个属性了:
EditableText({ Key key, @required this.controller, @required this.focusNode, this.obscureText = false, this.autocorrect = true, @required this.style, @required this.cursorColor, this.textAlign = TextAlign.start, this.textDirection, this.locale, this.textScaleFactor, this.maxLines = 1, this.autofocus = false, this.selectionColor, this.selectionControls, TextInputType keyboardType, this.textInputAction, this.textCapitalization = TextCapitalization.none, this.onChanged, this.onEditingComplete, this.onSubmitted, this.onSelectionChanged, List<TextInputFormatter> inputFormatters, this.rendererIgnoresPointer = false, this.cursorWidth = 2.0, this.cursorRadius, this.scrollPadding = const EdgeInsets.all(20.0), this.keyboardAppearance = Brightness.light, this.enableInteractiveSelection = true, })

@CaiJingLong
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants