/// <inheritdoc cref="IOrbwalker" /> public OrbwalkerMode DuplicateMode(OrbwalkerMode mode, string newName, GlobalKey key) { var newMode = new OrbwalkerMode(newName, key, mode.GetTargetImplementation, mode.ModeBehaviour); AddMode(newMode); return(newMode); }
public MaterialApp( Key key = null, GlobalKey <NavigatorState> navigatorKey = null, Widget home = null, Dictionary <string, WidgetBuilder> routes = null, string initialRoute = null, RouteFactory onGenerateRoute = null, InitialRouteListFactory onGenerateInitialRoutes = null, RouteFactory onUnknownRoute = null, List <NavigatorObserver> navigatorObservers = null, TransitionBuilder builder = null, string title = "", GenerateAppTitle onGenerateTitle = null, Color color = null, ThemeData theme = null, ThemeData darkTheme = null, ThemeMode themeMode = ThemeMode.system, Locale locale = null, List <LocalizationsDelegate> localizationsDelegates = null, LocaleListResolutionCallback localeListResolutionCallback = null, LocaleResolutionCallback localeResolutionCallback = null, List <Locale> supportedLocales = null, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool debugShowCheckedModeBanner = true, Dictionary <LogicalKeySet, Intent> shortcuts = null, Dictionary <LocalKey, ActionFactory> actions = null ) : base(key: key) { supportedLocales = supportedLocales ?? new List <Locale> { new Locale("en", "US") }; this.navigatorKey = navigatorKey; this.home = home; this.routes = routes ?? new Dictionary <string, WidgetBuilder>(); this.onGenerateInitialRoutes = onGenerateInitialRoutes; this.initialRoute = initialRoute; this.onGenerateRoute = onGenerateRoute; this.onUnknownRoute = onUnknownRoute; this.navigatorObservers = navigatorObservers ?? new List <NavigatorObserver>(); this.builder = builder; this.title = title; this.onGenerateTitle = onGenerateTitle; this.color = color; this.theme = theme; this.darkTheme = darkTheme; this.themeMode = themeMode; this.locale = locale; this.localizationsDelegates = localizationsDelegates; this.localeListResolutionCallback = localeListResolutionCallback; this.localeResolutionCallback = localeResolutionCallback; this.supportedLocales = supportedLocales; this.showPerformanceOverlay = showPerformanceOverlay; this.checkerboardRasterCacheImages = checkerboardRasterCacheImages; this.checkerboardOffscreenLayers = checkerboardOffscreenLayers; this.debugShowCheckedModeBanner = debugShowCheckedModeBanner; this.shortcuts = shortcuts; this.actions = actions; }
public override void didUpdateWidget(StatefulWidget oldWidget) { base.didUpdateWidget(oldWidget); TabBar _oldWidget = (TabBar)oldWidget; if (this.widget.controller != _oldWidget.controller) { this._updateTabController(); this._initIndicatorPainter(); } else if (this.widget.indicatorColor != _oldWidget.indicatorColor || this.widget.indicatorWeight != _oldWidget.indicatorWeight || this.widget.indicatorSize != _oldWidget.indicatorSize || this.widget.indicator != _oldWidget.indicator) { this._initIndicatorPainter(); } if (this.widget.tabs.Count > _oldWidget.tabs.Count) { int delta = this.widget.tabs.Count - _oldWidget.tabs.Count; for (int i = 0; i < delta; i++) { this._tabKeys.Add(GlobalKey.key()); } } else if (this.widget.tabs.Count < _oldWidget.tabs.Count) { int delta = _oldWidget.tabs.Count - this.widget.tabs.Count; this._tabKeys.RemoveRange(this.widget.tabs.Count, delta); } }
float _getPosition(GlobalKey key) { var renderBoxRed = (RenderBox)key.currentContext.findRenderObject(); var position = renderBoxRed.localToGlobal(Offset.zero); return(position.dy); }
public MaterialApp( Key key = null, GlobalKey <NavigatorState> navigatorKey = null, Widget home = null, Dictionary <string, WidgetBuilder> routes = null, string initialRoute = null, RouteFactory onGenerateRoute = null, RouteFactory onUnknownRoute = null, List <NavigatorObserver> navigatorObservers = null, TransitionBuilder builder = null, string title = "", Color color = null, ThemeData theme = null, bool showPerformanceOverlay = false, Window window = null) : base(key: key) { D.assert(window != null); this.window = window; this.navigatorKey = navigatorKey; this.home = home; this.routes = routes ?? new Dictionary <string, WidgetBuilder>(); this.initialRoute = initialRoute; this.onGenerateRoute = onGenerateRoute; this.onUnknownRoute = onUnknownRoute; this.navigatorObservers = navigatorObservers ?? new List <NavigatorObserver>(); this.builder = builder; this.title = title; this.color = color; this.theme = theme; this.showPerformanceOverlay = showPerformanceOverlay; }
public WidgetsApp( Key key = null, GlobalKey <NavigatorState> navigatorKey = null, RouteFactory onGenerateRoute = null, RouteFactory onUnknownRoute = null, PageRouteFactory pageRouteBuilder = null, List <NavigatorObserver> navigatorObservers = null, string initialRoute = null, Dictionary <string, WidgetBuilder> routes = null, TransitionBuilder builder = null, Window window = null, TextStyle textStyle = null, Widget home = null ) : base(key) { D.assert(window != null); routes = routes ?? new Dictionary <string, WidgetBuilder>(); this.window = window; this.home = home; this.navigatorKey = navigatorKey; this.onGenerateRoute = onGenerateRoute; this.onUnknownRoute = onUnknownRoute; this.pageRouteBuilder = pageRouteBuilder; this.routes = routes; this.navigatorObservers = navigatorObservers ?? new List <NavigatorObserver>(); this.initialRoute = initialRoute; this.builder = builder; this.textStyle = textStyle; D.assert( home == null || !this.routes.ContainsKey(Navigator.defaultRouteName), "If the home property is specified, the routes table " + "cannot include an entry for \" / \", since it would be redundant." ); D.assert( builder != null || home != null || this.routes.ContainsKey(Navigator.defaultRouteName) || onGenerateRoute != null || onUnknownRoute != null, "Either the home property must be specified, " + "or the routes table must include an entry for \"/\", " + "or there must be on onGenerateRoute callback specified, " + "or there must be an onUnknownRoute callback specified, " + "or the builder property must be specified, " + "because otherwise there is nothing to fall back on if the " + "app is started with an intent that specifies an unknown route." ); D.assert( builder != null || onGenerateRoute != null || pageRouteBuilder != null, "If neither builder nor onGenerateRoute are provided, the " + "pageRouteBuilder must be specified so that the default handler " + "will know what kind of PageRoute transition to build." ); }
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); }
public override void initState() { base.initState(); this._tabKeys = new List <GlobalKey>(); foreach (Widget tab in this.widget.tabs) { this._tabKeys.Add(GlobalKey.key()); } }
public static Rect _getRect(GlobalKey globalKey) { D.assert(globalKey.currentContext != null); RenderBox renderBoxContainer = globalKey.currentContext.findRenderObject() as RenderBox; Offset containerOffset = renderBoxContainer.localToGlobal( renderBoxContainer.paintBounds.topLeft ); return(containerOffset & renderBoxContainer.paintBounds.size); }
public override void initState() { base.initState(); _keys = new List <GlobalKey>(); for (int i = 0; i < widget.steps.Count; i++) { _keys.Add(GlobalKey.key()); _oldStates[i] = widget.steps[i].state; } }
public static Rect _getScaledRect(GlobalKey globalKey, float scale) { Rect childRect = CupertinoContextMenuUtils._getRect(globalKey); Size sizeScaled = childRect.size * scale; Offset offsetScaled = new Offset( childRect.left + (childRect.size.width - sizeScaled.width) / 2, childRect.top + (childRect.size.height - sizeScaled.height) / 2 ); return(offsetScaled & sizeScaled); }
public DrawerController( GlobalKey key = null, Widget child = null, DrawerAlignment?alignment = null, DrawerCallback drawerCallback = null) : base(key: key) { D.assert(child != null); D.assert(alignment != null); this.child = child; this.alignment = alignment ?? DrawerAlignment.start; this.drawerCallback = drawerCallback; }
void _attachRootWidget(Widget widget) { this.windowAdapter.attachRootWidget(() => new WidgetsApp( home: widget, navigatorKey: GlobalKey <NavigatorState> .key(), pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) => new PageRouteBuilder( settings: settings, pageBuilder: (BuildContext context, Animation <float> animation, Animation <float> secondaryAnimation) => builder(context) ))); }
public _ListModel( GlobalKey <AnimatedListState> listKey, RemovedItemBuilder removedItemBuilder, IEnumerable <int> initialItems = null ) { D.assert(listKey != null); D.assert(removedItemBuilder != null); _items = initialItems?.ToList() ?? new List <int>(); this.listKey = listKey; this.removedItemBuilder = removedItemBuilder; }
public static string GetName(this GlobalKey key) { return(key switch { GlobalKey.Eikthyr => "defeated_eikthyr", GlobalKey.Elder => "defeated_gdking", GlobalKey.Bonemass => "defeated_bonemass", GlobalKey.Moder => "defeated_dragon", GlobalKey.Yagluth => "defeated_goblinking", GlobalKey.Troll => "KilledTroll", GlobalKey.Surtling => "killed_surtling", _ => "" });
public static bool _hitTestInteractive(GlobalKey customPaintKey, Offset offset) { if (customPaintKey.currentContext == null) { return(false); } CustomPaint customPaint = customPaintKey.currentContext.widget as CustomPaint; ScrollbarPainter painter = customPaint.foregroundPainter as ScrollbarPainter; RenderBox renderBox = customPaintKey.currentContext.findRenderObject() as RenderBox; Offset localOffset = renderBox.globalToLocal(offset); return(painter.hitTestInteractive(localOffset)); }
public override void initState() { base.initState(); StatusBarManager.statusBarStyle(false); this._scrollController = new ScrollController(); this._contentFocusNodeKey = GlobalKey.key("_contentFocusNodeKey"); this._nameFocusNodeKey = GlobalKey.key("_nameFocusNodeKey"); this._contactFocusNodeKey = GlobalKey.key("_contactFocusNodeKey"); this._contentFocusNode.addListener(this._contentFocusNodeListener); this._nameFocusNode.addListener(this._nameFocusNodeListener); this._contactFocusNode.addListener(this._contactFocusNodeListener); }
public NestedNavigator( GlobalKey <NavigatorState> navigatorKey, string initialRoute, Dictionary <string, WidgetBuilder> routes, RouteCallback onGenerateRoute = null, PopCallback onWillPop = null ) { _navigatorKey = navigatorKey; _initialRoute = initialRoute; _routes = routes; _onGenerateRoute = onGenerateRoute; _onWillPop = onWillPop; }
/// <summary> /// Creates a new instance of an OrbwalkerMode using a Global Key /// </summary> public OrbwalkerMode(string name, GlobalKey key, TargetDelegate targetDelegate, OrbwalkModeDelegate orbwalkBehaviour) { if (name == null || key == null) { throw new Exception("There was an error creating the Orbwalker Mode"); } this.Name = name; this.ModeBehaviour = orbwalkBehaviour; this.GetTargetImplementation = targetDelegate; this.MenuItem = key.KeyBindItem; key.Activate(); this.UsingGlobalKey = true; }
public _ThumbPressGestureRecognizer( float?postAcceptSlopTolerance = null, PointerDeviceKind kind = default, object debugOwner = null, GlobalKey customPaintKey = null ) : base( postAcceptSlopTolerance: postAcceptSlopTolerance, kind: kind, debugOwner: debugOwner, duration: TimeSpan.FromMilliseconds(100) ) { _customPaintKey = customPaintKey; }
private void Hook() { Unhook(); if (process != null) { globalKey = new GlobalKey(); globalKey.KeyEvent += GlobalKey_KeyEvent; globalMouse = new GlobalMouse(); globalMouse.ButtonEvent += GlobalMouse_ButtonEvent; globalWindow = new GlobalWindow(process); globalWindow.MoveEvent += GlobalWindow_MoveEvent; } }
public ShrinePage( Key key = null, GlobalKey <ScaffoldState> scaffoldKey = null, Widget body = null, Widget floatingActionButton = null, List <Product> products = null, Dictionary <Product, Order> shoppingCart = null ) : base(key: key) { D.assert(body != null); D.assert(scaffoldKey != null); this.scaffoldKey = scaffoldKey; this.body = body; this.floatingActionButton = floatingActionButton; this.products = products; this.shoppingCart = shoppingCart; }
public CupertinoApp( Key key = null, GlobalKey <NavigatorState> navigatorKey = null, Widget home = null, CupertinoThemeData theme = null, Dictionary <string, WidgetBuilder> routes = null, string initialRoute = null, RouteFactory onGenerateRoute = null, RouteFactory onUnknownRoute = null, List <NavigatorObserver> navigatorObservers = null, TransitionBuilder builder = null, string title = "", GenerateAppTitle onGenerateTitle = null, Color color = null, Locale locale = null, List <LocalizationsDelegate <CupertinoLocalizations> > localizationsDelegates = null, LocaleListResolutionCallback localeListResolutionCallback = null, LocaleResolutionCallback localeResolutionCallback = null, List <Locale> supportedLocales = null, bool showPerformanceOverlay = false ) : base(key: key) { D.assert(title != null); supportedLocales = supportedLocales ?? new List <Locale> { new Locale("en", "US") }; this.navigatorKey = navigatorKey; this.home = home; this.theme = theme; this.routes = routes ?? new Dictionary <string, WidgetBuilder>(); this.initialRoute = initialRoute; this.onGenerateRoute = onGenerateRoute; this.onUnknownRoute = onUnknownRoute; this.navigatorObservers = navigatorObservers ?? new List <NavigatorObserver>(); this.builder = builder; this.title = title; this.onGenerateTitle = onGenerateTitle; this.color = color; this.locale = locale; this.localizationsDelegates = localizationsDelegates; this.localeListResolutionCallback = localeListResolutionCallback; this.localeResolutionCallback = localeResolutionCallback; this.supportedLocales = supportedLocales; this.showPerformanceOverlay = showPerformanceOverlay; }
public CupertinoTabView( Key key = null, WidgetBuilder builder = null, GlobalKey <NavigatorState> navigatorKey = null, string defaultTitle = null, Dictionary <string, WidgetBuilder> routes = null, RouteFactory onGenerateRoute = null, RouteFactory onUnknownRoute = null, List <NavigatorObserver> navigatorObservers = null ) : base(key: key) { this.builder = builder; this.navigatorKey = navigatorKey; this.defaultTitle = defaultTitle; this.routes = routes; this.onGenerateRoute = onGenerateRoute; this.onUnknownRoute = onUnknownRoute; this.navigatorObservers = navigatorObservers ?? new List <NavigatorObserver>(); }
public _ContextMenuRouteStatic( Key key = null, List <Widget> actions = null, Widget child = null, GlobalKey childGlobalKey = null, _ContextMenuLocation contextMenuLocation = default, _DismissCallback onDismiss = default, Orientation orientation = default, GlobalKey sheetGlobalKey = null ) : base(key: key) { D.assert(contextMenuLocation != default); D.assert(orientation != default); this.actions = actions; this.child = child; this.childGlobalKey = childGlobalKey; this.contextMenuLocation = contextMenuLocation; this.onDismiss = onDismiss; this.orientation = orientation; this.sheetGlobalKey = sheetGlobalKey; }
public DrawerController( GlobalKey key = null, Widget child = null, DrawerAlignment?alignment = null, DrawerCallback drawerCallback = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Color scrimColor = null, bool?enableOpenDragGesture = true, float?edgeDragWidth = null ) : base(key: key) { D.assert(child != null); D.assert(alignment != null); this.child = child; this.alignment = alignment ?? DrawerAlignment.start; this.drawerCallback = drawerCallback; this.dragStartBehavior = dragStartBehavior; this.scrimColor = scrimColor; this.enableOpenDragGesture = enableOpenDragGesture; this.edgeDragWidth = edgeDragWidth; }
private void Unhook() { if (globalKey != null) { globalKey.KeyEvent -= GlobalKey_KeyEvent; globalKey.Dispose(); globalKey = null; } if (globalMouse != null) { globalMouse.ButtonEvent -= GlobalMouse_ButtonEvent; globalMouse.Dispose(); globalMouse = null; } if (globalWindow != null) { globalWindow.MoveEvent -= GlobalWindow_MoveEvent; globalWindow.Dispose(); globalWindow = null; } }
/// <summary> /// Creates a new instance of an OrbwalkerMode using a Global Key /// </summary> public OrbwalkerMode( string name, GlobalKey key, TargetDelegate targetDelegate, OrbwalkModeDelegate orbwalkBehaviour) { if (name == null || key == null) { throw new Exception("There was an error creating the Orbwalker Mode"); } this.Name = name; this.ModeBehaviour = orbwalkBehaviour; this.GetTargetImplementation = targetDelegate; this.MenuItem = key.KeyBindItem; key.Activate(); this.UsingGlobalKey = true; this.ModeMenu = new Menu($"orbmode.{name}", name) { new MenuBool($"orbmode.{name}.move", "Movement"), new MenuBool($"orbmode.{name}.attack", "Attacking") }; }
public static void ChangeKey(GlobalKey newKey) { ClearKeys(); newKey.KeyBindItem.Value = true; }
void _updateNavigator() { this._navigator = this.widget.navigatorKey ?? new GlobalObjectKey <NavigatorState>(this); }
public static void Set(this HttpSessionStateBase Session, GlobalKey Key, object Value) { Set(Session, Key.ToString(), Value); }
//HttpSessionStateBase public static object Get(this HttpSessionStateBase Session, GlobalKey Key) { return Get(Session, Key.ToString()); }
public static bool Exists(this HttpSessionStateBase Session, GlobalKey Key) { return Exists(Session, Key.ToString()); }