Example #1
0
        public static FocusOrder of(BuildContext context, bool nullOk = false)
        {
            D.assert(context != null);
            FocusTraversalOrder marker = context.getElementForInheritedWidgetOfExactType <FocusTraversalOrder>()?.widget as FocusTraversalOrder;
            FocusOrder          order  = marker?.order;

            if (order == null && !nullOk)
            {
                throw new UIWidgetsError("FocusTraversalOrder.of() was called with a context that " +
                                         "does not contain a TraversalOrder widget. No TraversalOrder widget " +
                                         "ancestor could be found starting from the context that was passed to " +
                                         "FocusTraversalOrder.of().\n" +
                                         "The context used was:\n" +
                                         $"  {context}");
            }
            return(order);
        }
Example #2
0
        protected override int doCompare(FocusOrder other)
        {
            other = (LexicalFocusOrder)other;

            return(order.CompareTo(((LexicalFocusOrder)other).order));
        }
Example #3
0
 protected override int doCompare(FocusOrder other)
 {
     other = (NumericFocusOrder)other;
     return(order.CompareTo(((NumericFocusOrder)other).order));
 }
Example #4
0
 protected abstract int doCompare(FocusOrder other);
Example #5
0
 public FocusTraversalOrder(Key key = null, FocusOrder order = null, Widget child = null)
     : base(key: key, child: child)
 {
     this.order = order;
 }