Пример #1
0
 public Radio(
     Key key      = null,
     T value      = default,
     T groupValue = default,
     ValueChanged <T> onChanged = null,
     bool toggleable            = false,
     Color activeColor          = null,
     Color focusColor           = null,
     Color hoverColor           = null,
     MaterialTapTargetSize?materialTapTargetSize = null,
     VisualDensity visualDensity = null,
     FocusNode focusNode         = null,
     bool autofocus = false
     ) : base(key: key)
 {
     D.assert(value != null);
     D.assert(groupValue != null);
     this.value                 = value;
     this.groupValue            = groupValue;
     this.onChanged             = onChanged;
     this.toggleable            = toggleable;
     this.activeColor           = activeColor;
     this.focusColor            = focusColor;
     this.hoverColor            = hoverColor;
     this.materialTapTargetSize = materialTapTargetSize;
     this.visualDensity         = visualDensity;
     this.focusNode             = focusNode;
     this.autofocus             = autofocus;
 }
Пример #2
0
 public Checkbox(
     Key key       = null,
     bool?value    = false,
     bool tristate = false,
     ValueChanged <bool?> onChanged = null,
     Color activeColor = null,
     Color checkColor  = null,
     Color focusColor  = null,
     Color hoverColor  = null,
     MaterialTapTargetSize?materialTapTargetSize = null,
     VisualDensity visualDensity = null,
     FocusNode focusNode         = null,
     bool autofocus = false
     ) : base(key: key)
 {
     D.assert(tristate || value != null);
     this.value                 = value;
     this.onChanged             = onChanged;
     this.activeColor           = activeColor;
     this.checkColor            = checkColor;
     this.focusColor            = focusColor;
     this.hoverColor            = hoverColor;
     this.tristate              = tristate;
     this.materialTapTargetSize = materialTapTargetSize;
     this.visualDensity         = visualDensity;
     this.focusNode             = focusNode;
     this.autofocus             = autofocus;
 }
Пример #3
0
 public CustomTextField(
     EdgeInsets padding                = null,
     Decoration decoration             = null,
     Key textFieldKey                  = null,
     string hintText                   = null,
     TextEditingController controller  = null,
     FocusNode focusNode               = null,
     ValueChanged <string> onSubmitted = null,
     bool autofocus                  = false,
     int?maxLines                    = null,
     int?minLines                    = null,
     bool loading                    = false,
     bool showEmojiBoard             = false,
     bool isShowImageButton          = false,
     GestureTapCallback onPressImage = null,
     GestureTapCallback onPressEmoji = null,
     Key key = null
     ) : base(key: key)
 {
     this.padding           = padding;
     this.decoration        = decoration;
     this.textFieldKey      = textFieldKey;
     this.hintText          = hintText;
     this.controller        = controller;
     this.focusNode         = focusNode;
     this.onSubmitted       = onSubmitted;
     this.autofocus         = autofocus;
     this.maxLines          = maxLines;
     this.minLines          = minLines;
     this.loading           = loading;
     this.showEmojiBoard    = showEmojiBoard;
     this.isShowImageButton = isShowImageButton;
     this.onPressImage      = onPressImage;
     this.onPressEmoji      = onPressEmoji;
 }
Пример #4
0
        SelectableText(
            string data,
            TextSpan textSpan,
            Key key                             = null,
            FocusNode focusNode                 = null,
            TextStyle style                     = null,
            StrutStyle strutStyle               = null,
            TextAlign?textAlign                 = null,
            TextDirection?textDirection         = null,
            float?textScaleFactor               = null,
            bool showCursor                     = false,
            bool autofocus                      = false,
            ToolbarOptions toolbarOptions       = null,
            int?minLines                        = null,
            int?maxLines                        = null,
            float cursorWidth                   = 2.0f,
            Radius cursorRadius                 = null,
            Color cursorColor                   = null,
            DragStartBehavior dragStartBehavior = DragStartBehavior.start,
            bool enableInteractiveSelection     = true,
            GestureTapCallback onTap            = null,
            ScrollPhysics scrollPhysics         = null,
            TextWidthBasis?textWidthBasis       = null
            ) : base(key: key)
        {
            D.assert(maxLines == null || maxLines > 0);
            D.assert(minLines == null || minLines > 0);
            D.assert(
                (maxLines == null) || (minLines == null) || (maxLines >= minLines),
                () => "minLines can\'t be greater than maxLines"
                );
            toolbarOptions = toolbarOptions ??
                             new ToolbarOptions(
                selectAll: true,
                copy: true
                );

            this.data                       = data;
            this.textSpan                   = textSpan;
            this.focusNode                  = focusNode;
            this.style                      = style;
            this.strutStyle                 = strutStyle;
            this.textAlign                  = textAlign;
            this.textDirection              = textDirection;
            this.textScaleFactor            = textScaleFactor;
            this.showCursor                 = showCursor;
            this.autofocus                  = autofocus;
            this.toolbarOptions             = toolbarOptions;
            this.minLines                   = minLines;
            this.maxLines                   = maxLines;
            this.cursorWidth                = cursorWidth;
            this.cursorRadius               = cursorRadius;
            this.cursorColor                = cursorColor;
            this.dragStartBehavior          = dragStartBehavior;
            this.enableInteractiveSelection = enableInteractiveSelection;
            this.onTap                      = onTap;
            this.scrollPhysics              = scrollPhysics;
            this.textWidthBasis             = textWidthBasis;
        }
Пример #5
0
 public Sender(
     FocusNode focusNode,
     Dictionary <string, User> users
     ) : base(key: Key)
 {
     this.focusNode = focusNode;
     this.users     = users;
 }
Пример #6
0
 void _actionHandler(FocusNode node, Intent intent)
 {
     if (widget.onChanged != null)
     {
         widget.onChanged(widget.value);
     }
     RenderObject renderObject = node.context.findRenderObject();
 }
Пример #7
0
 public override void initState()
 {
     base.initState();
     this._textFieldKey = (GlobalKey)this.widget.textFieldKey ?? GlobalKey.key("textFieldKey");
     this._controller   = this.widget.controller ?? new TextEditingController("");
     this._focusNode    = this.widget.focusNode ?? new FocusNode();
     this._controller.addListener(this._onTextChanged);
 }
Пример #8
0
 public override void initState()
 {
     base.initState();
     _focusNode       = new FocusNode();
     _rightClickFocus = new FocusNode();
     _rightClickFocus.addListener(RightClickFocusListener);
     _fetchingUrl = false;
 }
Пример #9
0
 public FloatingActionButton(
     Key key                  = null,
     Widget child             = null,
     string tooltip           = null,
     Color foregroundColor    = null,
     Color backgroundColor    = null,
     Color focusColor         = null,
     Color hoverColor         = null,
     Color splashColor        = null,
     object heroTag           = null,
     float?elevation          = null,
     float?focusElevation     = null,
     float?hoverElevation     = null,
     float?highlightElevation = null,
     float?disabledElevation  = null,
     VoidCallback onPressed   = null,
     bool mini                = false,
     ShapeBorder shape        = null,
     Clip clipBehavior        = Clip.none,
     FocusNode focusNode      = null,
     bool autofocus           = false,
     MaterialTapTargetSize?materialTapTargetSize = null,
     bool isExtended = false,
     BoxConstraints _sizeConstraints = null
     ) : base(key: key)
 {
     D.assert(elevation == null || elevation >= 0.0f);
     D.assert(focusElevation == null || focusElevation >= 0.0);
     D.assert(hoverElevation == null || hoverElevation >= 0.0);
     D.assert(highlightElevation == null || highlightElevation >= 0.0f);
     D.assert(disabledElevation == null || disabledElevation >= 0.0f);
     heroTag                    = heroTag ?? new _DefaultHeroTag();
     this.child                 = child;
     this.tooltip               = tooltip;
     this.foregroundColor       = foregroundColor;
     this.backgroundColor       = backgroundColor;
     this.focusColor            = focusColor;
     this.hoverColor            = hoverColor;
     this.splashColor           = splashColor;
     this.heroTag               = heroTag;
     this.elevation             = elevation;
     this.focusElevation        = focusElevation;
     this.hoverElevation        = hoverElevation;
     this.highlightElevation    = highlightElevation;
     this.onPressed             = onPressed;
     this.mini                  = mini;
     this.shape                 = shape;
     this.clipBehavior          = clipBehavior;
     this.focusNode             = focusNode;
     this.autofocus             = autofocus;
     this.materialTapTargetSize = materialTapTargetSize;
     this.isExtended            = isExtended;
     this.disabledElevation     = disabledElevation;
     this._sizeConstraints      = _sizeConstraints ?? (mini
         ? material_._kMiniSizeConstraints
         : material_._kSizeConstraints);
 }
Пример #10
0
        public DropdownButton(
            Key key = null,
            List <DropdownMenuItem <T> > items = null,
            material_.DropdownButtonBuilder selectedItemBuilder = null,
            T value                    = default,
            Widget hint                = null,
            Widget disabledHint        = null,
            ValueChanged <T> onChanged = null,
            VoidCallback onTap         = null,
            int elevation              = 8,
            TextStyle style            = null,
            Widget underline           = null,
            Widget icon                = null,
            Color iconDisabledColor    = null,
            Color iconEnabledColor     = null,
            float iconSize             = 24.0f,
            bool isDense               = false,
            bool isExpanded            = false,
            float?itemHeight           = material_.kMinInteractiveDimension,
            Color focusColor           = null,
            FocusNode focusNode        = null,
            bool autofocus             = false,
            Color dropdownColor        = null
            ) :
            base(key: key)
        {
            D.assert(items == null || items.isEmpty() || value == null ||
                     LinqUtils <DropdownMenuItem <T> > .WhereList(items, ((DropdownMenuItem <T> item) => { return(item.value.Equals(value)); })).Count() == 1,
                     () => "There should be exactly one item with [DropdownButton]'s value: " +
                     $"{value}. \n" +
                     "Either zero or 2 or more [DropdownMenuItem]s were detected " +
                     "with the same value"
                     );
            D.assert(itemHeight == null || itemHeight >= material_.kMinInteractiveDimension);

            this.items = items;
            this.selectedItemBuilder = selectedItemBuilder;
            this.value             = value;
            this.hint              = hint;
            this.disabledHint      = disabledHint;
            this.onChanged         = onChanged;
            this.onTap             = onTap;
            this.elevation         = elevation;
            this.style             = style;
            this.underline         = underline;
            this.icon              = icon;
            this.iconDisabledColor = iconDisabledColor;
            this.iconEnabledColor  = iconEnabledColor;
            this.iconSize          = iconSize;
            this.isDense           = isDense;
            this.isExpanded        = isExpanded;
            this.itemHeight        = itemHeight;
            this.focusColor        = focusColor;
            this.focusNode         = focusNode;
            this.autofocus         = autofocus;
            this.dropdownColor     = dropdownColor;
        }
Пример #11
0
 public override void initState()
 {
     base.initState();
     _filterType            = FilterType.manual;
     _textEditingController = new TextEditingController();
     _focusNode             = new FocusNode();
     _screenOverlayState    = ScreenOverlay.of(context);
     _screenOverlayState.AddOnTapListener(LoseFocus);
 }
Пример #12
0
 public void _markDetached(FocusNode node)
 {
     D.assert(FocusManagerUtils._focusDebug($"Node was detached: {node}"));
     if (_primaryFocus == node)
     {
         _primaryFocus = null;
     }
     _dirtyNodes?.Remove(node);
 }
Пример #13
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;
 }
Пример #14
0
 public _FlatButtonWithIcon(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     VoidCallback onLongPress  = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                = null,
     Color disabledColor        = null,
     Color focusColor           = null,
     Color hoverColor           = null,
     Color highlightColor       = null,
     Color splashColor          = null,
     Brightness?colorBrightness = null,
     EdgeInsetsGeometry padding = null,
     ShapeBorder shape          = null,
     Clip clipBehavior          = Clip.none,
     FocusNode focusNode        = null,
     bool autofocus             = false,
     MaterialTapTargetSize?materialTapTargetSize = null,
     Widget icon  = null,
     Widget label = null) : base(
         key: key,
         onPressed: onPressed,
         onLongPress: onLongPress,
         onHighlightChanged: onHighlightChanged,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         color: color,
         disabledColor: disabledColor,
         focusColor: focusColor,
         hoverColor: hoverColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         colorBrightness: colorBrightness,
         padding: padding,
         shape: shape,
         clipBehavior: clipBehavior,
         focusNode: focusNode,
         autofocus: autofocus,
         materialTapTargetSize: materialTapTargetSize,
         child: new Row(
             mainAxisSize: MainAxisSize.min,
             children: new List <Widget> {
     icon,
     new SizedBox(width: 8.0f),
     label
 }
             ))
 {
     D.assert(icon != null);
     D.assert(label != null);
 }
Пример #15
0
 public InkWell(
     Key key                                    = null,
     Widget child                               = null,
     GestureTapCallback onTap                   = null,
     GestureTapCallback onDoubleTap             = null,
     GestureLongPressCallback onLongPress       = null,
     GestureTapDownCallback onTapDown           = null,
     GestureTapCancelCallback onTapCancel       = null,
     ValueChanged <bool> onHighlightChanged     = null,
     ValueChanged <bool> onHover                = null,
     Color focusColor                           = null,
     Color hoverColor                           = null,
     Color highlightColor                       = null,
     Color splashColor                          = null,
     InteractiveInkFeatureFactory splashFactory = null,
     float?radius                               = null,
     BorderRadius borderRadius                  = null,
     ShapeBorder customBorder                   = null,
     bool enableFeedback                        = true,
     FocusNode focusNode                        = null,
     bool canRequestFocus                       = true,
     ValueChanged <bool> onFocusChange          = null,
     bool autofocus                             = false
     ) : base(
         key: key,
         child: child,
         onTap: onTap,
         onDoubleTap: onDoubleTap,
         onLongPress: onLongPress,
         onTapDown: onTapDown,
         onTapCancel: () => {
     if (onTapCancel != null)
     {
         onTapCancel();
     }
 },
         onHighlightChanged: onHighlightChanged,
         onHover: onHover,
         containedInkWell: true,
         highlightShape: BoxShape.rectangle,
         focusColor: focusColor,
         hoverColor: hoverColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         splashFactory: splashFactory,
         radius: radius,
         borderRadius: borderRadius,
         customBorder: customBorder,
         enableFeedback: enableFeedback,
         focusNode: focusNode,
         canRequestFocus: canRequestFocus,
         onFocusChange: onFocusChange,
         autofocus: autofocus) {
 }
Пример #16
0
 public CompositionElement(CompositionVariants variant, SObjectLink olink)
 {
     this.Variant    = variant;
     this.ObjectLink = olink;
     FocusNode       = variant == CompositionVariants.DirectSystem ? olink.Target : olink.Source;
     if (variant == CompositionVariants.BinaryRelation)
     {
         pair_link = FocusNode.DirectObjectLinks()
                     .FirstOrDefault(lnk => lnk != olink && lnk.Definition.IsEssential);
     }
 }
Пример #17
0
        public static SelectableText rich(
            TextSpan textSpan,
            Key key                             = null,
            FocusNode focusNode                 = null,
            TextStyle style                     = null,
            StrutStyle strutStyle               = null,
            TextAlign?textAlign                 = null,
            TextDirection?textDirection         = null,
            float?textScaleFactor               = null,
            bool showCursor                     = false,
            bool autofocus                      = false,
            ToolbarOptions toolbarOptions       = null,
            int?minLines                        = null,
            int?maxLines                        = null,
            float cursorWidth                   = 2.0f,
            Radius cursorRadius                 = null,
            Color cursorColor                   = null,
            DragStartBehavior dragStartBehavior = DragStartBehavior.start,
            bool enableInteractiveSelection     = true,
            GestureTapCallback onTap            = null,
            ScrollPhysics scrollPhysics         = null,
            TextWidthBasis?textWidthBasis       = null
            )
        {
            D.assert(
                textSpan != null,
                () => "A non-null TextSpan must be provided to a SelectableText.rich widget."
                );

            return(new SelectableText(
                       data: null,
                       textSpan: textSpan,
                       key: key,
                       focusNode: focusNode,
                       style: style,
                       strutStyle: strutStyle,
                       textAlign: textAlign,
                       textDirection: textDirection,
                       textScaleFactor: textScaleFactor,
                       showCursor: showCursor,
                       autofocus: autofocus,
                       toolbarOptions: toolbarOptions,
                       minLines: minLines,
                       maxLines: maxLines,
                       cursorWidth: cursorWidth,
                       cursorRadius: cursorRadius,
                       cursorColor: cursorColor,
                       dragStartBehavior: dragStartBehavior,
                       enableInteractiveSelection: enableInteractiveSelection,
                       onTap: onTap,
                       scrollPhysics: scrollPhysics,
                       textWidthBasis: textWidthBasis
                       ));
        }
Пример #18
0
 public override void initState()
 {
     base.initState();
     this._textEditingController =
         this.widget.controller != null ? this.widget.controller : new TextEditingController("");
     this._focusNode        = this.widget.focusNode != null ? this.widget.focusNode : new FocusNode();
     this._isHintTextHidden = false;
     this._isFocus          = this.widget.autofocus;
     this._textEditingController.addListener(this._controllerListener);
     this._focusNode.addListener(this._focusNodeListener);
 }
Пример #19
0
        public override void initState()
        {
            base.initState();
            this._controller = new TextEditingController("");
            this._focusNode  = new FocusNode();
            if (this.widget.doSearch != null)
            {
                Window.instance.scheduleMicrotask(() => this.widget.doSearch(""));
            }

            this._controller.addListener(this.textChange);
        }
Пример #20
0
 private void MoveNext()
 {
     if (m_currentItem.MoveNext())
     {
         FocusNode.Execute(m_currentItem.Current.Node, m_currentItem.Current.File);
     }
     else
     {
         MessageBox.Show("Find reached the starting point of the search");
         m_currentItem = null;
     }
 }
Пример #21
0
 private void OnWorldUpdated(IAmEventMessage message)
 {
     if (message.Obj <ISceneNode>().ItemRemoved(x => x.ChildNodes, out var remMessage))
     {
         var parent      = remMessage.Object;
         var removedRoot = remMessage.Item;
         if (FocusNode.IsDescendantOf(removedRoot))
         {
             FocusOn(parent.PresentationInfra().ClosestFocusNode.GetComponent <IFocusNodeComponent>());
         }
     }
 }
Пример #22
0
 public void _markNextFocus(FocusNode node)
 {
     if (_primaryFocus == node)
     {
         _markedForFocus = null;
     }
     else
     {
         _markedForFocus = node;
         _markNeedsUpdate();
     }
 }
Пример #23
0
    void Update()
    {
        if (!isActive)
        {
            return;
        }
        if (!AcceptsInput)
        {
            return;
        }

        if (input.GetButtonDown(ButtonCode.Left))
        {
            if (focused.Left != null)
            {
                focused.UnFocus();
                focused = focused.Left;
                focused.Focus();
                _OnNodeFocused.OnNext(focused);
            }
        }
        if (input.GetButtonDown(ButtonCode.Right))
        {
            if (focused.Right != null)
            {
                focused.UnFocus();
                focused = focused.Right;
                focused.Focus();
                _OnNodeFocused.OnNext(focused);
            }
        }
        if (input.GetButtonDown(ButtonCode.Up))
        {
            if (focused.Up != null)
            {
                focused.UnFocus();
                focused = focused.Up;
                focused.Focus();
                _OnNodeFocused.OnNext(focused);
            }
        }
        if (input.GetButtonDown(ButtonCode.Down))
        {
            if (focused.Down != null)
            {
                focused.UnFocus();
                focused = focused.Down;
                focused.Focus();
                _OnNodeFocused.OnNext(focused);
            }
        }
    }
Пример #24
0
        public static FlatButton icon(
            Key key = null,
            VoidCallback onPressed = null,
            ValueChanged <bool> onHighlightChanged = null,
            VoidCallback onLongPress  = null,
            ButtonTextTheme?textTheme = null,
            Color textColor           = null,
            Color disabledTextColor   = null,
            Color color                = null,
            Color disabledColor        = null,
            Color focusColor           = null,
            Color hoverColor           = null,
            Color highlightColor       = null,
            Color splashColor          = null,
            Brightness?colorBrightness = null,
            EdgeInsetsGeometry padding = null,
            ShapeBorder shape          = null,
            Clip clipBehavior          = Clip.none,
            FocusNode focusNode        = null,
            bool autofocus             = false,
            MaterialTapTargetSize?materialTapTargetSize = null,
            Widget icon  = null,
            Widget label = null)
        {
            D.assert(icon != null);
            D.assert(label != null);

            return(new _FlatButtonWithIcon(
                       key: key,
                       onPressed: onPressed,
                       onLongPress: onLongPress,
                       onHighlightChanged: onHighlightChanged,
                       textTheme: textTheme,
                       textColor: textColor,
                       disabledTextColor: disabledTextColor,
                       color: color,
                       disabledColor: disabledColor,
                       focusColor: focusColor,
                       hoverColor: hoverColor,
                       highlightColor: highlightColor,
                       splashColor: splashColor,
                       colorBrightness: colorBrightness,
                       padding: padding,
                       shape: shape,
                       clipBehavior: clipBehavior,
                       focusNode: focusNode,
                       autofocus: autofocus,
                       materialTapTargetSize: materialTapTargetSize,
                       icon: icon,
                       label: label
                       ));
        }
Пример #25
0
 public static OutlineButton icon(
     Key key = null,
     VoidCallback onPressed    = null,
     VoidCallback onLongPress  = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                  = null,
     Color focusColor             = null,
     Color hoverColor             = null,
     Color highlightColor         = null,
     Color splashColor            = null,
     float?highlightElevation     = null,
     Color highlightedBorderColor = null,
     Color disabledBorderColor    = null,
     BorderSide borderSide        = null,
     EdgeInsetsGeometry padding   = null,
     VisualDensity visualDensity  = null,
     ShapeBorder shape            = null,
     Clip clipBehavior            = Clip.none,
     Widget icon                  = null,
     FocusNode focusNode          = null,
     bool autofocus               = false,
     Widget label                 = null
     )
 {
     return(new _OutlineButtonWithIcon(
                key: key,
                onPressed: onPressed,
                onLongPress: onLongPress,
                textTheme: textTheme,
                textColor: textColor,
                disabledTextColor: disabledTextColor,
                color: color,
                focusColor: focusColor,
                hoverColor: hoverColor,
                highlightColor: highlightColor,
                splashColor: splashColor,
                highlightElevation: highlightElevation,
                highlightedBorderColor: highlightedBorderColor,
                disabledBorderColor: disabledBorderColor,
                borderSide: borderSide,
                padding: padding,
                visualDensity: visualDensity,
                shape: shape,
                clipBehavior: clipBehavior,
                focusNode: focusNode,
                autofocus: autofocus,
                icon: icon,
                label: label
                ));
 }
Пример #26
0
 public void autofocus(FocusNode node)
 {
     D.assert(FocusManagerUtils._focusDebug($"Node autofocusing: {node}"));
     if (focusedChild == null)
     {
         if (node._parent == null)
         {
             _reparent(node);
         }
         D.assert(node.ancestors.Contains(this), () => "Autofocus was requested for a node that is not a descendant of the scope from which it was requested.");
         node._doRequestFocus(findFirstFocus: true);
     }
 }
Пример #27
0
 public OutlineButton(
     Key key = null,
     VoidCallback onPressed    = null,
     VoidCallback onLongPress  = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                  = null,
     Color focusColor             = null,
     Color hoverColor             = null,
     Color highlightColor         = null,
     Color splashColor            = null,
     float?highlightElevation     = null,
     BorderSide borderSide        = null,
     Color disabledBorderColor    = null,
     Color highlightedBorderColor = null,
     EdgeInsetsGeometry padding   = null,
     VisualDensity visualDensity  = null,
     ShapeBorder shape            = null,
     Clip clipBehavior            = Clip.none,
     FocusNode focusNode          = null,
     bool autofocus               = false,
     Widget child                 = null
     ) :
     base(
         key: key,
         onPressed: onPressed,
         onLongPress: onLongPress,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         color: color,
         focusColor: focusColor,
         hoverColor: hoverColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         highlightElevation: highlightElevation,
         padding: padding,
         visualDensity: visualDensity,
         shape: shape,
         clipBehavior: clipBehavior,
         focusNode: focusNode,
         autofocus: autofocus,
         child: child
         )
 {
     D.assert(highlightElevation == null || highlightElevation >= 0.0f);
     this.highlightedBorderColor = highlightedBorderColor;
     this.disabledBorderColor    = disabledBorderColor;
     this.borderSide             = borderSide;
 }
Пример #28
0
 public _OutlineButton(
     Key key = null,
     VoidCallback onPressed    = null,
     VoidCallback onLongPress  = null,
     Brightness?brightness     = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                  = null,
     Color focusColor             = null,
     Color hoverColor             = null,
     Color highlightColor         = null,
     Color splashColor            = null,
     float?highlightElevation     = null,
     BorderSide borderSide        = null,
     Color disabledBorderColor    = null,
     Color highlightedBorderColor = null,
     EdgeInsetsGeometry padding   = null,
     VisualDensity visualDensity  = null,
     ShapeBorder shape            = null,
     Clip?clipBehavior            = Clip.none,
     FocusNode focusNode          = null,
     bool autofocus               = false,
     Widget child                 = null
     ) : base(key: key)
 {
     D.assert(highlightElevation != null && highlightElevation >= 0.0f);
     D.assert(highlightedBorderColor != null);
     this.onPressed              = onPressed;
     this.onLongPress            = onLongPress;
     this.brightness             = brightness;
     this.textTheme              = textTheme;
     this.textColor              = textColor;
     this.disabledTextColor      = disabledTextColor;
     this.color                  = color;
     this.focusColor             = focusColor;
     this.hoverColor             = hoverColor;
     this.highlightColor         = highlightColor;
     this.splashColor            = splashColor;
     this.highlightElevation     = highlightElevation;
     this.borderSide             = borderSide;
     this.disabledBorderColor    = disabledBorderColor;
     this.highlightedBorderColor = highlightedBorderColor;
     this.padding                = padding;
     this.visualDensity          = visualDensity;
     this.shape                  = shape;
     this.clipBehavior           = clipBehavior;
     this.focusNode              = focusNode;
     this.autofocus              = autofocus;
     this.child                  = child;
 }
Пример #29
0
 public InkResponse(
     Key key                                    = null,
     Widget child                               = null,
     GestureTapCallback onTap                   = null,
     GestureTapDownCallback onTapDown           = null,
     GestureTapCancelCallback onTapCancel       = null,
     GestureTapCallback onDoubleTap             = null,
     GestureLongPressCallback onLongPress       = null,
     ValueChanged <bool> onHighlightChanged     = null,
     ValueChanged <bool> onHover                = null,
     bool containedInkWell                      = false,
     BoxShape highlightShape                    = BoxShape.circle,
     float?radius                               = null,
     BorderRadius borderRadius                  = null,
     ShapeBorder customBorder                   = null,
     Color focusColor                           = null,
     Color hoverColor                           = null,
     Color highlightColor                       = null,
     Color splashColor                          = null,
     InteractiveInkFeatureFactory splashFactory = null,
     bool enableFeedback                        = true,
     FocusNode focusNode                        = null,
     bool canRequestFocus                       = true,
     ValueChanged <bool> onFocusChange          = null,
     bool autofocus                             = false) : base(key: key)
 {
     this.child              = child;
     this.onTap              = onTap;
     this.onTapDown          = onTapDown;
     this.onTapCancel        = onTapCancel;
     this.onDoubleTap        = onDoubleTap;
     this.onLongPress        = onLongPress;
     this.onHighlightChanged = onHighlightChanged;
     this.onHover            = onHover;
     this.containedInkWell   = containedInkWell;
     this.highlightShape     = highlightShape;
     this.radius             = radius;
     this.borderRadius       = borderRadius;
     this.customBorder       = customBorder;
     this.focusColor         = focusColor;
     this.hoverColor         = hoverColor;
     this.highlightColor     = highlightColor;
     this.splashColor        = splashColor;
     this.splashFactory      = splashFactory;
     this.enableFeedback     = enableFeedback;
     this.focusNode          = focusNode;
     this.canRequestFocus    = canRequestFocus;
     this.onFocusChange      = onFocusChange;
     this.autofocus          = autofocus;
 }
Пример #30
0
        public _ToggleButton(
            Key key                         = null,
            bool selected                   = false,
            TextStyle textStyle             = null,
            BoxConstraints constraints      = null,
            Color color                     = null,
            Color selectedColor             = null,
            Color disabledColor             = null,
            Color fillColor                 = null,
            Color focusColor                = null,
            Color highlightColor            = null,
            Color hoverColor                = null,
            Color splashColor               = null,
            FocusNode focusNode             = null,
            VoidCallback onPressed          = null,
            BorderSide leadingBorderSide    = null,
            BorderSide horizontalBorderSide = null,
            BorderSide trailingBorderSide   = null,
            BorderRadius borderRadius       = null,
            BorderRadius clipRadius         = null,
            bool?isFirstButton              = null,
            bool?isLastButton               = null,
            Widget child                    = null
            ) : base(key: key)
        {
            D.assert(isFirstButton != null);
            D.assert(isLastButton != null);

            this.selected             = selected;
            this.textStyle            = textStyle;
            this.constraints          = constraints;
            this.color                = color;
            this.selectedColor        = selectedColor;
            this.disabledColor        = disabledColor;
            this.fillColor            = fillColor;
            this.focusColor           = focusColor;
            this.highlightColor       = highlightColor;
            this.hoverColor           = hoverColor;
            this.splashColor          = splashColor;
            this.focusNode            = focusNode;
            this.onPressed            = onPressed;
            this.leadingBorderSide    = leadingBorderSide;
            this.horizontalBorderSide = horizontalBorderSide;
            this.trailingBorderSide   = trailingBorderSide;
            this.borderRadius         = borderRadius;
            this.clipRadius           = clipRadius;
            this.isFirstButton        = isFirstButton.Value;
            this.isLastButton         = isLastButton.Value;
            this.child                = child;
        }