Beispiel #1
0
 public InputField(
     Key key = null,
     TextEditingController controller = null,
     FocusNode focusNode                       = null,
     bool obscureText                          = false,
     bool autocorrect                          = true,
     bool enabled                              = true,
     TextStyle style                           = null,
     TextAlign textAlign                       = TextAlign.left,
     int maxLines                              = 1,
     bool autofocus                            = false,
     string hintText                           = null,
     TextStyle hintStyle                       = null,
     string labelText                          = null,
     TextStyle labelStyle                      = null,
     Color cursorColor                         = null,
     float cursorWidth                         = 2,
     Radius cursorRadius                       = null,
     TextInputAction textInputAction           = TextInputAction.none,
     TextInputType keyboardType                = null,
     float height                              = 44.0f,
     InputFieldClearButtonMode clearButtonMode = InputFieldClearButtonMode.never,
     bool enableInteractiveSelection           = true,
     Color selectionColor                      = null,
     ValueChanged <string> onChanged           = null,
     ValueChanged <string> onSubmitted         = null,
     EdgeInsets scrollPadding                  = null
     ) : base(key)
 {
     this.controller                 = controller;
     this.textAlign                  = textAlign;
     this.focusNode                  = focusNode;
     this.obscureText                = obscureText;
     this.autocorrect                = autocorrect;
     this.enabled                    = enabled;
     this.style                      = style;
     this.textAlign                  = textAlign;
     this.maxLines                   = maxLines;
     this.autofocus                  = autofocus;
     this.hintText                   = hintText;
     this.hintStyle                  = hintStyle;
     this.labelText                  = labelText;
     this.labelStyle                 = labelStyle;
     this.height                     = height;
     this.clearButtonMode            = clearButtonMode;
     this.enableInteractiveSelection = enableInteractiveSelection;
     this.selectionColor             = selectionColor ?? new Color(0x667FAACF);
     this.cursorColor                = cursorColor;
     this.cursorWidth                = cursorWidth;
     this.cursorRadius               = cursorRadius ?? Radius.circular(1.0f);
     this.textInputAction            = textInputAction;
     this.keyboardType               = keyboardType;
     this.onChanged                  = onChanged;
     this.onSubmitted                = onSubmitted;
     this.scrollPadding              = scrollPadding;
 }
Beispiel #2
0
 public InputField(
     Key key = null,
     TextEditingController controller = null,
     FocusNode focusNode    = null,
     bool obscureText       = false,
     bool autocorrect       = true,
     bool enabled           = true,
     Decoration decoration  = null,
     TextStyle style        = null,
     TextAlign textAlign    = TextAlign.left,
     Alignment alignment    = null,
     int?maxLines           = 1,
     int?minLines           = null,
     int?maxLength          = null,
     bool maxLengthEnforced = true,
     bool autofocus         = false,
     List <TextInputFormatter> inputFormatters = null,
     Widget prefix                   = null,
     Widget suffix                   = null,
     string hintText                 = null,
     float?hintTextWidth             = null,
     TextStyle hintStyle             = null,
     string labelText                = null,
     TextStyle labelStyle            = null,
     Color cursorColor               = null,
     float cursorWidth               = 2,
     Radius cursorRadius             = null,
     TextInputAction textInputAction = TextInputAction.none,
     TextInputType keyboardType      = null,
     float?height = 44.0f,
     InputFieldClearButtonMode clearButtonMode = InputFieldClearButtonMode.never,
     bool enableInteractiveSelection           = true,
     Color selectionColor              = null,
     ValueChanged <string> onChanged   = null,
     ValueChanged <string> onSubmitted = null,
     EdgeInsets scrollPadding          = null
     ) : base(key: key)
 {
     D.assert(maxLines == null || minLines == null || maxLines >= minLines);
     this.controller                 = controller;
     this.textAlign                  = textAlign;
     this.focusNode                  = focusNode;
     this.obscureText                = obscureText;
     this.autocorrect                = autocorrect;
     this.enabled                    = enabled;
     this.decoration                 = decoration;
     this.style                      = style;
     this.textAlign                  = textAlign;
     this.alignment                  = alignment ?? Alignment.center;
     this.maxLines                   = maxLines;
     this.minLines                   = minLines;
     this.maxLength                  = maxLength;
     this.maxLengthEnforced          = maxLengthEnforced;
     this.autofocus                  = autofocus;
     this.inputFormatters            = inputFormatters;
     this.prefix                     = prefix;
     this.suffix                     = suffix;
     this.hintText                   = hintText;
     this.hintTextWidth              = hintTextWidth;
     this.hintStyle                  = hintStyle;
     this.labelText                  = labelText;
     this.labelStyle                 = labelStyle;
     this.height                     = height;
     this.clearButtonMode            = clearButtonMode;
     this.enableInteractiveSelection = enableInteractiveSelection;
     this.selectionColor             = selectionColor ?? new Color(0x667FAACF);
     this.cursorColor                = cursorColor;
     this.cursorWidth                = cursorWidth;
     this.cursorRadius               = cursorRadius ?? Radius.circular(1.0f);
     this.textInputAction            = textInputAction;
     this.keyboardType               = keyboardType;
     this.onChanged                  = onChanged;
     this.onSubmitted                = onSubmitted;
     this.scrollPadding              = scrollPadding;
 }