### Install VS Code Source: https://pub.dev/documentation/yaru/latest/index.html Installs Visual Studio Code using snap. This is a convenient way to get the editor for development. ```bash sudo snap install code --classic ``` -------------------------------- ### Install Flutter Source: https://pub.dev/documentation/yaru/latest/index.html Installs Flutter using apt and adds it to the PATH. Ensure you have git, curl, cmake, meson, make, clang, and libgtk-3-dev installed. ```bash sudo apt -y install git curl cmake meson make clang libgtk-3-dev pkg-config && mkdir -p ~/development && cd ~/development && git clone https://github.com/flutter/flutter.git -b stable && echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.bashrc && source ~/.bashrc ``` -------------------------------- ### StatefulWidget Build Method Example (Conceptual) Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/build.html Illustrates a conceptual example of how closures in a build method might capture the widget instance, potentially leading to outdated information if the widget is updated. ```dart // (this is not valid Flutter code) class MyButton extends StatefulWidgetX { MyButton({super.key, required this.color}); final Color color; @override Widget build(BuildContext context, State state) { return SpecialWidget( handler: () { print('color: $color'); }, ); } } ``` -------------------------------- ### Implementing debugFillProperties with Various DiagnosticsProperty Subclasses Source: https://pub.dev/documentation/yaru/latest/yaru/YaruCheckbox/debugFillProperties.html This example demonstrates best practices for implementing `debugFillProperties`, showing the use of common `DiagnosticsProperty` subclasses and parameters. It includes examples for strings, doubles, integers, percentages, enums, flags, and lazy properties. ```dart class ExampleObject extends ExampleSuperclass { // ...various members and properties... @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { // Always add properties from the base class first. super.debugFillProperties(properties); // Omit the property name 'message' when displaying this String property // as it would just add visual noise. properties.add(StringProperty('message', message, showName: false)); properties.add(DoubleProperty('stepWidth', stepWidth)); // A scale of 1.0 does nothing so should be hidden. properties.add(DoubleProperty('scale', scale, defaultValue: 1.0)); // If the hitTestExtent matches the paintExtent, it is just set to its // default value so is not relevant. properties.add(DoubleProperty('hitTestExtent', hitTestExtent, defaultValue: paintExtent)); // maxWidth of double.infinity indicates the width is unconstrained and // so maxWidth has no impact. properties.add(DoubleProperty('maxWidth', maxWidth, defaultValue: double.infinity)); // Progress is a value between 0 and 1 or null. Showing it as a // percentage makes the meaning clear enough that the name can be // hidden. properties.add(PercentProperty( 'progress', progress, showName: false, ifNull: '', )); // Most text fields have maxLines set to 1. properties.add(IntProperty('maxLines', maxLines, defaultValue: 1)); // Specify the unit as otherwise it would be unclear that time is in // milliseconds. properties.add(IntProperty('duration', duration.inMilliseconds, unit: 'ms')); // Tooltip is used instead of unit for this case as a unit should be a // terse description appropriate to display directly after a number // without a space. properties.add(DoubleProperty( 'device pixel ratio', devicePixelRatio, tooltip: 'physical pixels per logical pixel', )); // Displaying the depth value would be distracting. Instead only display // if the depth value is missing. properties.add(ObjectFlagProperty('depth', depth, ifNull: 'no depth')); // bool flag that is only shown when the value is true. properties.add(FlagProperty('using primary controller', value: primary)); properties.add(FlagProperty( 'isCurrent', value: isCurrent, ifTrue: 'active', ifFalse: 'inactive', )); properties.add(DiagnosticsProperty('keepAlive', keepAlive)); // FlagProperty could have also been used in this case. // This option results in the text "obscureText: true" // instead of "obscureText" which is a bit more verbose but a bit clearer. properties.add(DiagnosticsProperty('obscureText', obscureText, defaultValue: false)); properties.add(EnumProperty('textAlign', textAlign, defaultValue: null)); properties.add(EnumProperty('repeat', repeat, defaultValue: ImageRepeat.noRepeat)); // Warn users when the widget is missing but do not show the value. properties.add(ObjectFlagProperty('widget', widget, ifNull: 'no widget')); properties.add(IterableProperty( 'boxShadow', boxShadow, defaultValue: null, style: style, )); // Getting the value of size throws an exception unless hasSize is true. properties.add(DiagnosticsProperty.lazy( 'size', () => size, description: '${ hasSize ? size : "MISSING" }', )); // If the `toString` method for the property value does not provide a // good terse description, write a DiagnosticsProperty subclass as in // the case of TransformProperty which displays a nice debugging view ``` -------------------------------- ### YaruTile Constructor Example Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTile/YaruTile.html Demonstrates how to create a YaruTile with title, subtitle, and trailing widgets. ```dart YaruTile( title: Text('title'), subtitle: Text('subtitle'), trailing: Text('trailing'), ) ``` -------------------------------- ### Start Window Dragging Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/drag.html Call this static method to begin dragging the window. It requires a BuildContext. ```dart static Future drag(BuildContext context) { return YaruWindow.of(context).drag(); } ``` -------------------------------- ### Basic YaruMasterDetailPage Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruMasterDetailPage-class.html Demonstrates the basic setup of YaruMasterDetailPage, including required builders for master tiles and detail pages, and an optional AppBar. ```dart YaruMasterDetailPage( length: 8, appBar: AppBar(title: const Text('Master')), tileBuilder: (context, index, selected) => YaruMasterTile( leading: const Icon(YaruIcons.menu), title: Text('Master $index'), ), pageBuilder: (context, index) => YaruDetailPage( appBar: AppBar( title: Text('Detail $index'), ), body: Center(child: Text('Detail $index')), ), ) ``` -------------------------------- ### Install Window Close Handler Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/onClose.html Installs a handler that is called when the window is closed. The handler should return a Future. ```dart Future onClose(FutureOr Function() handler) { return _platform.onClose(_id, handler); } ``` -------------------------------- ### onClose Method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/onClose.html Installs a close handler for the window. The handler function should return a Future. ```APIDOC ## onClose Method ### Description Installs a close handler for the window. The handler function is invoked when the window attempts to close. ### Signature `Future onClose(FutureOr handler())` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **handler** (FutureOr Function()) - A function that will be called when the window is closed. It should return a `Future`. ### Implementation ```dart Future onClose(FutureOr Function() handler) { return _platform.onClose(_id, handler); } ``` ### Example ```dart windowInstance.onClose(() async { print('Window is closing!'); // Return true to allow closing, false to prevent closing return true; }); ``` ``` -------------------------------- ### lookup method Source: https://pub.dev/documentation/yaru/latest/yaru/GSettingsService/lookup.html Retrieves a GnomeSettings object for a given schema ID and an optional path. Returns null if the schema is not installed. ```APIDOC ## lookup method ### Description Retrieves a GnomeSettings object for a given schema ID and an optional path. Returns null if the schema is not installed. ### Signature GnomeSettings? lookup(String schemaId, {String? path}) ### Parameters #### Path Parameters - **schemaId** (String) - Required - The identifier of the GSettings schema. - **path** (String?) - Optional - The path for the GSettings schema. ### Returns - **GnomeSettings?** - The GnomeSettings object if found, otherwise null. ``` -------------------------------- ### drag static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/drag.html Starts dragging the window. This is a static method that takes a BuildContext and initiates the drag operation. ```APIDOC ## drag static method ### Description Starts dragging the window. ### Method Signature `static Future drag(BuildContext context)` ### Parameters #### Path Parameters - **context** (BuildContext) - Required - The build context for the widget. ``` -------------------------------- ### Start Window Dragging Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/drag.html Call this method to begin dragging the window. It relies on the platform's implementation. ```dart Future drag() => _platform.drag(_id); ``` -------------------------------- ### onClose static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/onClose.html Installs a close handler for the window. This method takes a BuildContext and a handler function that returns a Future. ```APIDOC ## onClose static method ### Description Installs a close handler for the window. ### Parameters #### Path Parameters - **context** (BuildContext) - Required - The build context for the widget. - **handler** (FutureOr Function()) - Required - A function that will be called when the window is requested to close. It should return a Future indicating whether the close operation should proceed. ### Implementation ```dart static Future onClose( BuildContext context, FutureOr Function() handler, ) { return YaruWindow.of(context).onClose(handler); } ``` ``` -------------------------------- ### init method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/init.html Initializes the window. This method should be called to set up the window instance before other operations. ```APIDOC ## init method ### Description Initializes the window. ### Signature Future init() ### Implementation ```dart Future init() => _platform.init(_id); ``` ``` -------------------------------- ### Example createState Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruCheckButton/createState.html This is a standard implementation of the createState method for a StatefulWidget. It returns a new instance of the associated State subclass. ```dart @override State createState() => _SomeWidgetState(); ``` ```dart @override State createState() => _YaruCheckButtonState(); ``` -------------------------------- ### YaruDraggable onDragStart Property Declaration Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDraggable/onDragStart.html This snippet shows the declaration of the onDragStart property within the YaruDraggable widget. It's a nullable VoidCallback that gets called when dragging starts. ```dart final VoidCallback? onDragStart; ``` -------------------------------- ### Call Start IconData Constant Source: https://pub.dev/documentation/yaru/latest/yaru/YaruIcons/call_start-constant.html Defines the IconData for the 'call start' icon. Use this constant when you need to display the call start icon in your Flutter application. ```dart static const call_start = IconData( 0xe309, fontFamily: iconFontFamily, fontPackage: iconFontPackage, ); ``` -------------------------------- ### GSettingsService Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/GSettingsService/GSettingsService.html Initializes a new instance of the GSettingsService. ```APIDOC ## GSettingsService() ### Description Constructs a new GSettingsService instance. ### Method constructor ### Endpoint N/A ### Parameters None ### Request Example ``` new GSettingsService() ``` ### Response #### Success Response Returns a new GSettingsService instance. #### Response Example ``` // Returns a GSettingsService instance ``` ``` -------------------------------- ### init() Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSettings/init.html Abstract method to initialize YaruSettings. This method must be implemented by concrete subclasses. ```APIDOC ## init() ### Description Abstract method to initialize YaruSettings. This method must be implemented by concrete subclasses. ### Method void ### Endpoint N/A (Method Signature) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Example createState Override Source: https://pub.dev/documentation/yaru/latest/yaru/YaruAnimatedVectorIcon/createState.html This is a general example of how to override the createState method for a custom widget. ```dart @override State createState() => _SomeWidgetState(); ``` -------------------------------- ### Implement GnomeSettings lookup Source: https://pub.dev/documentation/yaru/latest/yaru/GSettingsService/lookup.html Retrieves a GnomeSettings object for a given schema ID and optional path. Returns null if the schema is not installed. ```dart GnomeSettings? lookup(String schemaId, {String? path}) { try { return _settings[schemaId] ??= GnomeSettings(schemaId, path: path); } on GSettingsSchemaNotInstalledException catch (_) { return null; } } ``` -------------------------------- ### Get All Icons Source: https://pub.dev/documentation/yaru/latest/yaru/YaruFreedesktopIcons/all.html Retrieves all Yaru Freedesktop Icons as a string map. This is a shortcut to get all enum values. ```APIDOC ## GET /all ### Description Retrieves all Yaru Freedesktop Icons as a string map. ### Method GET ### Endpoint /all ### Response #### Success Response (200) - **icons** (Map) - A map where keys are icon names and values are the corresponding YaruFreedesktopIcons enum values. ``` -------------------------------- ### Example createState Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSwitchButton/createState.html Subclasses should override this method to return a newly created instance of their associated State subclass. The framework can call this method multiple times. ```dart @override State createState() => _SomeWidgetState(); ``` ```dart @override State createState() => _YaruSwitchButtonState(); ``` -------------------------------- ### init() Method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruGtkSettings-class.html Initializes the YaruGtkSettings instance. This method overrides the base class method. ```APIDOC ## Methods ### init() → void #### Description Initializes the YaruGtkSettings instance. #### Overrides `init` in `YaruSettings`. ``` -------------------------------- ### Example createState Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDraggable/createState.html Subclasses should override this method to return a newly created instance of their associated State subclass. The framework may call this method multiple times. ```dart @override State createState() => _SomeWidgetState(); ``` ```dart @override State createState() => _YaruDraggableState(); ``` -------------------------------- ### initialProgress Property Declaration Source: https://pub.dev/documentation/yaru/latest/yaru/YaruAnimatedVectorIcon/initialProgress.html Declares the initialProgress property, which is a nullable double. This property determines the starting progress of the animation. If null, the animation plays from the start. ```dart final double? initialProgress; ``` -------------------------------- ### show method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/show.html Shows the window. ```APIDOC ## show method ### Description Shows the window. ### Signature Future show() ### Implementation ```dart Future show() => _platform.show(_id); ``` ``` -------------------------------- ### Start Auto-Scroll Timer - YaruCarouselController Source: https://pub.dev/documentation/yaru/latest/yaru/YaruCarouselController/startTimer.html Starts the auto-scroll timer for the carousel if auto-scroll is enabled and clients are present. The timer advances the carousel to the next page upon completion, looping to the beginning if necessary. ```dart void startTimer() { if (autoScroll && hasClients) { _timer = Timer(autoScrollDuration, () { final carousel = position.context.notificationContext ?.findAncestorWidgetOfExactType(); final pagesLength = carousel?.children.length ?? 0; animateToPage(page!.round() + 1 >= pagesLength ? 0 : page!.round() + 1); }); } } ``` -------------------------------- ### showMenu method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/showMenu.html Shows the window menu. ```APIDOC ## showMenu() ### Description Shows the window menu. ### Method Signature Future showMenu() ### Implementation ```dart Future showMenu() => _platform.showMenu(_id); ``` ``` -------------------------------- ### YaruGtkSettings Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/YaruGtkSettings-class.html Initializes a new instance of the YaruGtkSettings class. The settings and settingsService parameters are visible for testing purposes. ```APIDOC ## YaruGtkSettings Constructor ### Description Initializes a new instance of the YaruGtkSettings class. ### Parameters - **settings** (GtkSettings?) - Optional. Visible for testing. - **settingsService** (GSettingsService?) - Optional. Visible for testing. ``` -------------------------------- ### YaruSegmentedEntryController.length Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSegmentedEntryController-class.html Gets the total number of segments in the entry. ```APIDOC ## YaruSegmentedEntryController.length ### Description Gets the total number of segments. This must correspond to the `YaruSegmentedEntry.segments.length`. ### Property - **length** (int) - The number of segments. ``` -------------------------------- ### ensureInitialized static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/ensureInitialized.html Ensures that the window is initialized and returns the primary instance. ```APIDOC ## ensureInitialized static method ### Description Ensures that the window is initialized and returns the primary instance. ### Signature `Future ensureInitialized()` ### Implementation Example ```dart static Future ensureInitialized() async { WidgetsFlutterBinding.ensureInitialized(); final window = YaruWindow._instance(); await window.init(); return window; } ``` ``` -------------------------------- ### Get TimeOfDay Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTimeEntryController/timeOfDay.html Retrieves the current time of day setting. ```APIDOC ## get timeOfDay ### Description Retrieves the current time of day setting. ### Method GET ### Endpoint /timeOfDay ### Response #### Success Response (200) - **timeOfDay** (TimeOfDay?) - The current time of day setting. ``` -------------------------------- ### showMenu static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/showMenu.html Shows the window menu. This is a static method that requires a BuildContext. ```APIDOC ## showMenu static method ### Description Shows the window menu. ### Method Signature `static Future showMenu(BuildContext context)` ### Parameters #### Path Parameters - **context** (BuildContext) - Required - The build context for the widget. ### Implementation ```dart static Future showMenu(BuildContext context) { return YaruWindow.of(context).showMenu(); } ``` ``` -------------------------------- ### YaruSegmentedEntryController.index Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSegmentedEntryController-class.html Gets or sets the currently selected segment index. ```APIDOC ## YaruSegmentedEntryController.index ### Description Represents the currently selected segment's index. ### Property - **index** (int) - The current index of the selected segment. ``` -------------------------------- ### Show Window Menu Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/showMenu.html Call this static method to display the window menu. It requires a BuildContext. ```dart static Future showMenu(BuildContext context) { return YaruWindow.of(context).showMenu(); } ``` -------------------------------- ### YaruTimeEntryController.now() Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTimeEntryController/YaruTimeEntryController.now.html Creates a YaruTimeEntryController, with the current time as initial value. ```APIDOC ## YaruTimeEntryController.now() ### Description Creates a YaruTimeEntryController, with the current time as initial value. ### Method Constructor ### Endpoint N/A (Constructor) ### Parameters None ### Request Example N/A (Constructor) ### Response #### Success Response - **YaruTimeEntryController** (object) - An instance of YaruTimeEntryController initialized with the current time. ### Response Example N/A (Constructor) ``` -------------------------------- ### Get Value Source: https://pub.dev/documentation/yaru/latest/yaru/YaruNumericSegment/value.html Retrieves the current integer value of the YaruNumericSegment. ```APIDOC ## Get Value ### Description Retrieves the current integer value of the YaruNumericSegment. ### Method Getter ### Return Type int? - The current integer value, or null if not set. ``` -------------------------------- ### fullscreen() Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/fullscreen.html Enters fullscreen mode for the window instance. ```APIDOC ## fullscreen() ### Description Enters fullscreen mode. ### Method Signature Future fullscreen() ### Implementation Details This method internally calls the `fullscreen` method of the `_platform` object, passing the window's ID (`_id`). ``` -------------------------------- ### Get DateTime Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTimeEntryController/dateTime.html Retrieves the current date and time value. ```APIDOC ## Get dateTime ### Description Retrieves the date and time value. ### Method GET ### Endpoint /dateTime ### Response #### Success Response (200) - **dateTime** (DateTime?) - The current date and time value. ``` -------------------------------- ### YaruFocusBorderPadding.new constructor Source: https://pub.dev/documentation/yaru/latest/yaru/YaruFocusBorderPadding/YaruFocusBorderPadding.html Creates a new instance of YaruFocusBorderPadding. ```APIDOC ## YaruFocusBorderPadding() ### Description Initializes a new YaruFocusBorderPadding object. ### Method constructor ### Endpoint N/A (Constructor) ### Parameters This constructor does not accept any parameters. ### Request Example ```dart YaruFocusBorderPadding() ``` ### Response - **YaruFocusBorderPadding** (object) - A new instance of YaruFocusBorderPadding. ``` -------------------------------- ### Get Month Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/month.html Retrieves the current month value from the DateTimeEntryState. ```APIDOC ## Get Month Property ### Description Retrieves the current month value. ### Method Getter ### Signature `int? get month` ### Implementation ```dart int? get month => monthSegment.value; ``` ``` -------------------------------- ### Get DateTime Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryController/dateTime.html Retrieves the current DateTime value from the controller. ```APIDOC ## get dateTime ### Description Retrieves the current DateTime value. ### Method GET ### Endpoint /dateTime ### Response #### Success Response (200) - **dateTime** (DateTime?) - The current date and time value. ``` -------------------------------- ### Get Index Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruPageController/index.html Provides the current value of the index. This is a read-only getter. ```dart int get index => _index; ``` -------------------------------- ### YaruPopupMenuButton Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/YaruPopupMenuButton-class.html Initializes a new instance of the YaruPopupMenuButton class. ```APIDOC ## YaruPopupMenuButton ### Description A generic wrapper around PopupMenuButton that is visually more consistent to buttons and dialogs than DropdownButton. ### Parameters * **key** (Key?) - Optional - Controls how one widget replaces another widget in the tree. * **initialValue** (T?) - Optional - The initial value of the popup menu. * **child** (Widget) - Required - The widget to display as the button. * **itemBuilder** (required Widget Function(BuildContext)) - Required - A function that builds the popup menu entries. * **onSelected** (ValueChanged?) - Optional - Callback for when an item is selected. * **onCanceled** (VoidCallback?) - Optional - Callback for when the menu is canceled. * **tooltip** (String?) - Optional - Text that is displayed when the user long-presses the button. * **position** (PopupMenuPosition) - Optional - The position of the popup menu relative to the button. Defaults to PopupMenuPosition.over. * **padding** (EdgeInsetsGeometry) - Optional - Padding around the button. Defaults to a symmetric horizontal padding of 5. * **childPadding** (EdgeInsetsGeometry) - Optional - Padding around the child widget. Defaults to a symmetric horizontal padding of 5. * **enabled** (bool) - Optional - Whether the button is enabled. Defaults to true. * **offset** (Offset) - Optional - The offset of the popup menu from the button. Defaults to an offset based on kYaruTitleBarItemHeight. * **enableFeedback** (bool?) - Optional - Whether the button provides feedback to the user (e.g. vibration). * **constraints** (BoxConstraints?) - Optional - Constraints for the popup menu. * **elevation** (double?) - Optional - The elevation of the popup menu. * **style** (ButtonStyle?) - Optional - The style for the button. * **mouseCursor** (MouseCursor?) - Optional - The cursor to display when hovering over the button. * **icon** (Widget?) - Optional - An icon to display next to the child. * **semanticLabel** (String?) - Optional - Semantic label for accessibility. * **showArrow** (bool) - Optional - Whether to show an arrow icon. Defaults to true. ``` -------------------------------- ### Get Period Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/period.html Retrieves the current day period from the DateTimeEntry state. ```APIDOC ## Get Period Property ### Description This property returns the current day period. ### Method Getter ### Endpoint N/A (This is an SDK property) ### Parameters None ### Request Example ```dart DayPeriod currentPeriod = dateTimeEntryState.period; ``` ### Response #### Success Response - **period** (DayPeriod) - The current day period (e.g., morning, afternoon, evening, night). ``` -------------------------------- ### fullscreen static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/fullscreen.html Enters fullscreen mode for the application window. This is a static method that requires a BuildContext. ```APIDOC ## fullscreen static method ### Description Enters fullscreen mode. ### Method Signature `static Future fullscreen(BuildContext context)` ### Parameters #### Path Parameters - **context** (BuildContext) - Required - The build context for the application. ### Request Example ```dart // Assuming you have a BuildContext available YaruWindow.fullscreen(context); ``` ### Response #### Success Response (void) This method does not return a value upon successful execution. ``` -------------------------------- ### Get previousIndex - Dart Source: https://pub.dev/documentation/yaru/latest/yaru/YaruPageController/previousIndex.html Returns the index of the previously active page. This is a getter method. ```dart int get previousIndex => _previousIndex; ``` -------------------------------- ### show static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/show.html Shows the window. This is a static method that takes a BuildContext and returns a Future. ```APIDOC ## show static method ### Description Shows the window. ### Method Signature `static Future show(BuildContext context)` ### Parameters #### Path Parameters - **context** (BuildContext) - Required - The build context for the window. ``` -------------------------------- ### String get text Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruEntrySegment/text.html This is the declaration for the 'text' property, which returns a String. It is a getter. ```dart String get text; ``` -------------------------------- ### Example createState Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSegmentedEntry/createState.html Subclasses should override this method to return a newly created instance of their associated State subclass. This is a common pattern for defining the state for a custom widget. ```dart @override State createState() => _SomeWidgetState(); ``` ```dart @override State createState() => _YaruSegmentedEntryState(); ``` -------------------------------- ### Get Length of Entry Segment Source: https://pub.dev/documentation/yaru/latest/yaru/YaruEntrySegment/length.html Retrieves the length of the entry segment. This is a read-only property. ```dart int get length; ``` -------------------------------- ### Implementing debugFillProperties Best Practices Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTitleBarThemeData/debugFillProperties.html This example demonstrates best practices for implementing debugFillProperties, illustrating the use of various common DiagnosticsProperty subclasses and parameters. It covers omitting property names, handling default values, and conditional display. ```dart class ExampleObject extends ExampleSuperclass { // ...various members and properties... @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { // Always add properties from the base class first. super.debugFillProperties(properties); // Omit the property name 'message' when displaying this String property // as it would just add visual noise. properties.add(StringProperty('message', message, showName: false)); properties.add(DoubleProperty('stepWidth', stepWidth)); // A scale of 1.0 does nothing so should be hidden. properties.add(DoubleProperty('scale', scale, defaultValue: 1.0)); // If the hitTestExtent matches the paintExtent, it is just set to its // default value so is not relevant. properties.add(DoubleProperty('hitTestExtent', hitTestExtent, defaultValue: paintExtent)); // maxWidth of double.infinity indicates the width is unconstrained and // so maxWidth has no impact. properties.add(DoubleProperty('maxWidth', maxWidth, defaultValue: double.infinity)); // Progress is a value between 0 and 1 or null. Showing it as a // percentage makes the meaning clear enough that the name can be // hidden. properties.add(PercentProperty( 'progress', progress, showName: false, ifNull: '', )); // Most text fields have maxLines set to 1. properties.add(IntProperty('maxLines', maxLines, defaultValue: 1)); // Specify the unit as otherwise it would be unclear that time is in // milliseconds. properties.add(IntProperty('duration', duration.inMilliseconds, unit: 'ms')); // Tooltip is used instead of unit for this case as a unit should be a // terse description appropriate to display directly after a number // without a space. properties.add(DoubleProperty( 'device pixel ratio', devicePixelRatio, tooltip: 'physical pixels per logical pixel', )); // Displaying the depth value would be distracting. Instead only display // if the depth value is missing. properties.add(ObjectFlagProperty('depth', depth, ifNull: 'no depth')); // bool flag that is only shown when the value is true. properties.add(FlagProperty('using primary controller', value: primary)); properties.add(FlagProperty( 'isCurrent', value: isCurrent, ifTrue: 'active', ifFalse: 'inactive', )); properties.add(DiagnosticsProperty('keepAlive', keepAlive)); // FlagProperty could have also been used in this case. // This option results in the text "obscureText: true" // instead // of "obscureText" which is a bit more verbose but a bit clearer. properties.add(DiagnosticsProperty('obscureText', obscureText, defaultValue: false)); properties.add(EnumProperty('textAlign', textAlign, defaultValue: null)); properties.add(EnumProperty('repeat', repeat, defaultValue: ImageRepeat.noRepeat)); // Warn users when the widget is missing but do not show the value. properties.add(ObjectFlagProperty('widget', widget, ifNull: 'no widget')); properties.add(IterableProperty( 'boxShadow', boxShadow, defaultValue: null, style: style, )); // Getting the value of size throws an exception unless hasSize is true. properties.add(DiagnosticsProperty.lazy( 'size', () => size, description: '${ hasSize ? size : "MISSING" }', )); // If the `toString` method for the property value does not provide a // good terse description, write a DiagnosticsProperty subclass as in // the case of TransformProperty which displays a nice debugging view ``` -------------------------------- ### GSettingsService() Source: https://pub.dev/documentation/yaru/latest/yaru/GSettingsService-class.html Constructor for the GSettingsService class. ```APIDOC ## GSettingsService() ### Description Creates a new instance of the GSettingsService class. ### Method Constructor ``` -------------------------------- ### ensureInitialized static method Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowTitleBar/ensureInitialized.html Initializes the window title bar state and hides the title bar. ```APIDOC ## ensureInitialized static method ### Description Initializes the internal state for window title bars and ensures the underlying window system is initialized. It then proceeds to hide the title bar. ### Signature `Future ensureInitialized()` ### Implementation Details This method clears the internal `_windowStates` map and calls `YaruWindow.ensureInitialized()`. Once the window is initialized, it calls the `hideTitle()` method on the window object. ``` -------------------------------- ### Leading Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruListTile/leading.html The `leading` property accepts a `Widget?` which will be displayed at the start of the list tile, before the title. ```APIDOC ## leading property Widget? leading ### Description A widget to display before the title. ### Implementation ```dart final Widget? leading; ``` ``` -------------------------------- ### YaruGtkSettings Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/YaruGtkSettings/YaruGtkSettings.html The YaruGtkSettings constructor can be initialized with optional GtkSettings and GSettingsService instances. If not provided, default instances will be created. ```APIDOC ## YaruGtkSettings Constructor ### Description Initializes a new instance of the YaruGtkSettings class. ### Parameters - **settings** (GtkSettings?) - Optional. An existing GtkSettings object to use. If null, a new GtkSettings object is created. - **settingsService** (GSettingsService?) - Optional. An existing GSettingsService object to use. If null, a new GSettingsService object is created. ### Implementation Details The constructor assigns the provided or newly created `_gtkSettings` and `_gSettingsService` to the instance. ``` -------------------------------- ### initialProgress Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruAnimatedVectorIcon/initialProgress.html Sets the initial progress of the animation. If this value is null, the animation will start from its beginning. ```APIDOC ## initialProgress Property ### Description Sets the initial progress of the animation. If this value is null, the animation will start from its beginning. ### Type double? ### Implementation ```dart final double? initialProgress; ``` ``` -------------------------------- ### YaruSettings Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSettings-class.html Initializes a new instance of the YaruSettings class. ```APIDOC ## YaruSettings() ### Description Initializes a new instance of the YaruSettings class. ### Constructor YaruSettings() ``` -------------------------------- ### onTap Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSelectableContainer/onTap.html The onTap property is a VoidCallback that gets triggered when the YaruSelectableContainer is clicked. It is an optional property. ```APIDOC ## onTap property VoidCallback? onTap Callback triggered when the YaruSelectableContainer is clicked. ``` -------------------------------- ### GnomeSettings Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/GnomeSettings/GnomeSettings.html Initializes a new instance of the GnomeSettings class. It takes a schema ID and an optional path to a GSettings schema. ```APIDOC ## GnomeSettings constructor ### Description Initializes a new instance of the GnomeSettings class. ### Parameters #### Path Parameters - **schemaId** (String) - Required - The ID of the GSettings schema. - **path** (String?) - Optional - The path to the GSettings schema file. ### Implementation ```dart GnomeSettings(String schemaId, {String? path}) : _settings = GSettings(schemaId, path: path) { _settings.keysChanged.listen((keys) { for (final key in keys) { _updateValue(key); } }); } ``` ``` -------------------------------- ### Declare emptyBuilder Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruMasterDetailPage/emptyBuilder.html This property is a WidgetBuilder that gets called when there are no pages to display. It is declared as nullable. ```dart final WidgetBuilder? emptyBuilder; ``` -------------------------------- ### TooltipTheme wrap implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruBackButtonTheme/wrap.html This is a typical implementation of the wrap method for an inherited theme, demonstrating how to apply data to a child widget. ```dart Widget wrap(BuildContext context, Widget child) { return TooltipTheme(data: data, child: child); } ``` -------------------------------- ### onTap Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruListTile/onTap.html The onTap property is a VoidCallback that gets invoked when the list tile is tapped. It is optional. ```APIDOC ## onTap Property ### Description Called when the user taps this list tile. ### Type `VoidCallback?` ### Example ```dart YaruListTile( title: Text('My List Tile'), onTap: () { print('List tile tapped!'); }, ) ``` ``` -------------------------------- ### State Build Method Example with Closure Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/build.html Demonstrates how closures created within the build method of a State object capture the State instance, ensuring they refer to the current widget's properties even after updates. ```dart class MyButton extends StatefulWidget { const MyButton({super.key, this.color = Colors.teal}); final Color color; // ... } class MyButtonState extends State { // ... @override Widget build(BuildContext context) { return SpecialWidget( handler: () { print('color: ${widget.color}'); }, ); } } ``` -------------------------------- ### YaruInfoType Methods Source: https://pub.dev/documentation/yaru/latest/yaru/YaruInfoType.html The YaruInfoType enum provides a method to get the color associated with each enum value. ```APIDOC ## Methods ### `getColor(BuildContext context) → Color` Returns the `Color` associated with the enum value based on the provided `BuildContext`. ``` -------------------------------- ### Get Year Property Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/year.html Retrieves the current value of the year from the yearSegment. This property is read-only. ```dart int? get year => yearSegment.value; ``` -------------------------------- ### Show Window Menu Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindowInstance/showMenu.html Call this method to display the window menu. It delegates the call to the platform implementation. ```dart Future showMenu() => _platform.showMenu(_id); ``` -------------------------------- ### Get Minute Property Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/minute.html This snippet shows how to access the current minute value from the minuteSegment.value. ```dart int? get minute => minuteSegment.value; ``` -------------------------------- ### Accessing Link Color Source: https://pub.dev/documentation/yaru/latest/yaru/YaruColorSchemeExtension/link.html Demonstrates how to get the link color from the theme's color scheme. ```APIDOC ## Get Link Color A color for presenting links. ### Usage ```dart Theme.of(context).colorScheme.link ``` ### Implementation Details This property is implemented by retrieving the link color from the `YaruColors` class based on the current brightness mode. ```dart Color get link => YaruColors.from(brightness).link; ``` ``` -------------------------------- ### Implementing debugFillProperties with DiagnosticsProperty Subclasses Source: https://pub.dev/documentation/yaru/latest/yaru/YaruCircularProgressIndicator/debugFillProperties.html This example shows best practices for implementing debugFillProperties, illustrating the use of common DiagnosticsProperty subclasses and parameters. It covers various property types and conditional display logic. ```dart class ExampleObject extends ExampleSuperclass { // ...various members and properties... @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { // Always add properties from the base class first. super.debugFillProperties(properties); // Omit the property name 'message' when displaying this String property // as it would just add visual noise. properties.add(StringProperty('message', message, showName: false)); properties.add(DoubleProperty('stepWidth', stepWidth)); // A scale of 1.0 does nothing so should be hidden. properties.add(DoubleProperty('scale', scale, defaultValue: 1.0)); // If the hitTestExtent matches the paintExtent, it is just set to its // default value so is not relevant. properties.add(DoubleProperty('hitTestExtent', hitTestExtent, defaultValue: paintExtent)); // maxWidth of double.infinity indicates the width is unconstrained and // so maxWidth has no impact. properties.add(DoubleProperty('maxWidth', maxWidth, defaultValue: double.infinity)); // Progress is a value between 0 and 1 or null. Showing it as a // percentage makes the meaning clear enough that the name can be // hidden. properties.add(PercentProperty( 'progress', progress, showName: false, ifNull: '', )); // Most text fields have maxLines set to 1. properties.add(IntProperty('maxLines', maxLines, defaultValue: 1)); // Specify the unit as otherwise it would be unclear that time is in // milliseconds. properties.add(IntProperty('duration', duration.inMilliseconds, unit: 'ms')); // Tooltip is used instead of unit for this case as a unit should be a // terse description appropriate to display directly after a number // without a space. properties.add(DoubleProperty( 'device pixel ratio', devicePixelRatio, tooltip: 'physical pixels per logical pixel', )); // Displaying the depth value would be distracting. Instead only display // if the depth value is missing. properties.add(ObjectFlagProperty('depth', depth, ifNull: 'no depth')); // bool flag that is only shown when the value is true. properties.add(FlagProperty('using primary controller', value: primary)); properties.add(FlagProperty( 'isCurrent', value: isCurrent, ifTrue: 'active', ifFalse: 'inactive', )); properties.add(DiagnosticsProperty('keepAlive', keepAlive)); // FlagProperty could have also been used in this case. // This option results in the text "obscureText: true" // of "obscureText" which is a bit more verbose but a bit clearer. properties.add(DiagnosticsProperty('obscureText', obscureText, defaultValue: false)); properties.add(EnumProperty('textAlign', textAlign, defaultValue: null)); properties.add(EnumProperty('repeat', repeat, defaultValue: ImageRepeat.noRepeat)); // Warn users when the widget is missing but do not show the value. properties.add(ObjectFlagProperty('widget', widget, ifNull: 'no widget')); properties.add(IterableProperty( 'boxShadow', boxShadow, defaultValue: null, style: style, )); // Getting the value of size throws an exception unless hasSize is true. properties.add(DiagnosticsProperty.lazy( 'size', () => size, description: '${ hasSize ? size : "MISSING" }', )); // If the `toString` method for the property value does not provide a // good terse description, write a DiagnosticsProperty subclass as in // the case of TransformProperty which displays a nice debugging view ``` -------------------------------- ### Constructors Source: https://pub.dev/documentation/yaru/latest/yaru/YaruMasterDetailThemeData-class.html Provides information on how to instantiate YaruMasterDetailThemeData. ```APIDOC ## Constructors ### YaruMasterDetailThemeData ```dart YaruMasterDetailThemeData({ double? breakpoint, double? tileSpacing, EdgeInsetsGeometry? listPadding, PageTransitionsTheme? portraitTransitions, PageTransitionsTheme? landscapeTransitions, bool? includeSeparator, Color? sideBarColor, }) ``` ### YaruMasterDetailThemeData.fallback ```dart const YaruMasterDetailThemeData.fallback(BuildContext context) ``` ``` -------------------------------- ### Methods Source: https://pub.dev/documentation/yaru/latest/yaru/YaruFreedesktopIcons.html Instance methods available for YaruFreedesktopIcons. ```APIDOC ## Methods ### noSuchMethod - **Signature**: `noSuchMethod(Invocation invocation)` - **Return Type**: `dynamic` - **Description**: Invoked when a nonexistent method or property is accessed. - **Inheritance**: Inherited. ``` ```APIDOC ### toString - **Signature**: `toString()` - **Return Type**: `String` - **Description**: A string representation of this object. - **Inheritance**: Inherited. ``` -------------------------------- ### initialPosition Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDraggable/initialPosition.html The initialPosition property specifies the starting offset for the YaruDraggable element. It is a final Offset value. ```APIDOC ## initialPosition Property ### Description Offset initialPosition Initial position of this element. ### Implementation ```dart final Offset initialPosition; ``` ``` -------------------------------- ### YaruGtkSettings Constructor Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruGtkSettings/YaruGtkSettings.html Initializes YaruGtkSettings with optional GtkSettings and GSettingsService instances. If not provided, default instances are created. ```dart YaruGtkSettings([ @visibleForTesting GtkSettings? settings, @visibleForTesting GSettingsService? settingsService, ]) : _gtkSettings = settings ?? GtkSettings(), _gSettingsService = settingsService ?? GSettingsService(), super._(); ``` -------------------------------- ### Get Yaru Window State Stream Source: https://pub.dev/documentation/yaru/latest/yaru/YaruWindow/states.html Returns a stream of window state changes. Requires a BuildContext. ```dart static Stream states(BuildContext context) { return YaruWindow.of(context).states(); } ``` -------------------------------- ### Get Input Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruNumericSegment/input.html Retrieves the current value of the input property. This is an override of the base class getter. ```dart @override String? get input => _input; ``` -------------------------------- ### Get YaruMasterTileScope Instance Source: https://pub.dev/documentation/yaru/latest/yaru/YaruMasterTileScope/of.html Use this static method to retrieve the nearest YaruMasterTileScope ancestor. It requires a BuildContext. ```dart static YaruMasterTileScope of(BuildContext context) { return maybeOf(context)!; } ``` -------------------------------- ### Get Hour Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruDateTimeEntryState/hour.html Access the current hour value from the hourSegment.value. This getter is used to retrieve the hour. ```dart int? get hour => hourSegment.value; ``` -------------------------------- ### YaruColorDisk Constructor Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruColorDisk/YaruColorDisk.html This is the implementation of the YaruColorDisk constructor. It requires key, onPressed, color, and selected parameters. ```dart const YaruColorDisk({ super.key, required this.onPressed, required this.color, required this.selected, }); ``` -------------------------------- ### ThemeData get theme Source: https://pub.dev/documentation/yaru/latest/yaru/YaruVariant/theme.html Provides the light theme data for the Yaru variant. This is a getter that returns a ThemeData object. ```APIDOC ## theme property ThemeData get theme A light theme for the variant. ### Implementation ```dart ThemeData get theme => _yaruLightThemes[this]!; ``` ``` -------------------------------- ### GnomeSettings Constructor Source: https://pub.dev/documentation/yaru/latest/yaru/GnomeSettings-class.html Initializes a GnomeSettings object for a specific schema ID and an optional path. ```APIDOC ## GnomeSettings(String schemaId, {String? path}) ### Description Initializes a GnomeSettings object. ### Parameters - **schemaId** (String) - Required - The ID of the schema to interact with. - **path** (String?) - Optional - The specific path within the schema. ``` -------------------------------- ### Get DateTime Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTimeEntryController/dateTime.html Retrieves the current date and time value. Ensure the underlying value is convertible to DateTime. ```dart @override @protected DateTime? get dateTime => value?.toDateTime(); ``` -------------------------------- ### lerp Method Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSwitchThemeData/lerp.html The implementation of the lerp method, showing how it interpolates properties like color, borderColor, thumbColor, indicatorColor, and mouseCursor between the current theme data and the provided 'other' theme data. ```APIDOC ThemeExtension lerp( ThemeExtension? other, double t, ) { final o = other as YaruSwitchThemeData?; return YaruSwitchThemeData( color: WidgetStateProperty.lerp(color, o?.color, t, Color.lerp), borderColor: WidgetStateProperty.lerp(borderColor, o?.borderColor, t, Color.lerp), thumbColor: WidgetStateProperty.lerp(thumbColor, o?.thumbColor, t, Color.lerp), indicatorColor: WidgetStateProperty.lerp(indicatorColor, o?.indicatorColor, t, Color.lerp), mouseCursor: WidgetStateProperty.lerp(mouseCursor, o?.mouseCursor, t, (a, b, t) => t < 0.5 ? a : b), ); } ``` -------------------------------- ### Get TimeOfDay Property Source: https://pub.dev/documentation/yaru/latest/yaru/YaruTimeEntryController/timeOfDay.html Retrieves the current timeOfDay value. This getter is used to access the time of day setting. ```dart TimeOfDay? get timeOfDay => value; ``` -------------------------------- ### GnomeSettings Constructor Implementation Source: https://pub.dev/documentation/yaru/latest/yaru/GnomeSettings/GnomeSettings.html Initializes GnomeSettings with a schema ID and an optional path. It also sets up a listener for key changes to update values. ```dart GnomeSettings(String schemaId, {String? path}) : _settings = GSettings(schemaId, path: path) { _settings.keysChanged.listen((keys) { for (final key in keys) { _updateValue(key); } }); } ``` -------------------------------- ### addListener Source: https://pub.dev/documentation/yaru/latest/yaru/GnomeSettings-class.html Registers a listener callback to be invoked when settings change. ```APIDOC ## addListener(VoidCallback listener) ### Description Adds a listener to be called when the object changes. ### Parameters - **listener** (VoidCallback) - Required - The callback function to register. ``` -------------------------------- ### Get statusShapesChanged Stream Source: https://pub.dev/documentation/yaru/latest/yaru/YaruSettings/statusShapesChanged.html Access the Stream to observe changes in status shape settings. This property is read-only. ```dart Stream get statusShapesChanged; ```