flutter_screwdriver library
Classes
- AsyncLoadingBuilder
- A widget that builds itself based on the state of an asynchronous operation. It uses a FutureBuilder to manage the state of the asynchronous operation and provides a builder function that can be used to create the UI based on the current state (loading, error, or success).
- AsyncLoadingBuilderState
- State for the AsyncLoadingBuilder widget.
- Clears current focus when navigation happens.
- DirectionalAffinity
- Represents a widget that allows to place a widget before and after the child widget which is controlled by affinity in either horizontal or vertical direction.
-
FadeScalePageRoute<
T> - Provides page route with fade-scale material transition from animations package.
-
FadeThroughPageRoute<
T> - Provides page route with fade-through material transition from animations package.
- Gap
- A widget that adds some space between widgets inside Flex widgets such as Columns and Rows or scrolling views. This is alternative to SizedBox inside row/column such that you don't have to know the main direction of the parent widget.
- HideKeyboard
- Hides keyboard on tap outside tap-able widgets. This should be used as the parent of your MaterialApp. This way, it will detect any touches outside text fields and other touchable areas and will close the soft keyboard if open. Flag hide can be used to toggle this behavior. e.g.
- HorizontalAffinity
- Represents a widget that allows to place a widget before and after the child widget in horizontal direction which is controlled by affinity.
- Hoverable
- A widget that detects mouse hover events and notifies its child. This widget is useful when you want to change the appearance of a widget when the mouse hovers over it.
- LinkSpan
- A WidgetSpan that represents a link with hover effects and tap handling.
- PostFrame
- Provides a widget that runs a callback after the first frame is rendered.
-
Provides page route with shared axis material transition
from animations package.
User
SharedAxisTransitionType.verticalfor (y-axis) page transition. UserSharedAxisTransitionType.horizontalfor (x-axis) page transition. UserSharedAxisTransitionType.scaledfor (z-axis) page transition. - TickingInterface
- A ticking interface that provides methods to control the ticking of the widget.
- TickingWidget
- A widget that rebuilds itself at a given interval. This widget is useful for building widgets that need to be updated at a given interval. For example, this widget can be used to build clocks, timers, stopwatches, and countdowns. This widget can be used to build any widget that needs to be updated at a given interval. Example:
- VerticalAffinity
- Represents a widget that allows to place a widget above and below the child widget in vertical direction which is controlled by affinity.
Enums
- Affinity
-
Represents the affinity of the widget's
leadingandtrailingwidgets in affinity widgets (HorizontalAffinity and VerticalAffinity). - TickingMode
- Represents the mode of ticking. It can be millisecond, second, minute, or hour. This is used to determine when to rebuild the widget. For example, if the mode is set to TickingMode.second, the widget will rebuild every second. If the mode is set to TickingMode.minute, the widget will rebuild every minute. If the mode is set to TickingMode.hour, the widget will rebuild every hour. If the mode is set to TickingMode.millisecond, the widget will rebuild every millisecond. The default mode is TickingMode.second. The mode can be changed at runtime using TickingInterface.setMode method.
Mixins
-
AppLifecycleObserver<
T extends StatefulWidget> - Allows to observe app lifecycle without any boilerplate code. It registers a listener to receive lifecycle events and auto disposes it when the widget is disposed.
-
PostFrameCallbackMixin<
T extends StatefulWidget> - Provides a mixin that runs a callback after the first frame is rendered.
-
StreamSubscriptionStateMixin<
W extends StatefulWidget> - A mixin that manages stream subscriptions in a StatefulWidgets state and automatically cancels them when the state is disposed.
-
TickingStateMixin<
T extends StatefulWidget> - A mixin class that provides the ticking functionality to the widget. This mixin class can be used with the State class to provide the ticking functionality to the widget.
Extensions
- BrightnessFS on Brightness
- provides extensions for Widget
- ColorFS on Color
- Provides extensions for Color
- ContextExtension on BuildContext
- provides extension to get a dependency from provider
- DoubleFS on double
- provides extensions for double
-
GlobalKeyExtension
on GlobalKey<
State< StatefulWidget> > - provides extensions for Widget
- IntFS on int
- provides extensions for int
-
RouteFS
on Route<
T> - provides extensions for Route
-
StateFS
on State<
T> - provides extensions for State
- StringFS on String
- provides extensions for String
- TextEditingControllerFS on TextEditingController
- provides extensions on TextEditingController
- WidgetFS on Widget
- provides extensions for Widget
Functions
-
closeApp(
{bool animated = true}) → Future< void> - Alias for closing the app by invoking SystemNavigator.pop
-
hideKeyboard(
BuildContext context) → void - hides soft keyboard using platform channel
Typedefs
- AsyncLoadingBuilderBuilder = Widget Function(BuildContext context, bool loading, SetFutureFunction setFuture)
- A builder function type for AsyncLoadingBuilder that takes the current BuildContext, a boolean indicating whether the widget is currently loading, and a function to set a new future. The builder should return a widget that represents the current state of the asynchronous operation.
- Disposable = void Function()
- Represents a function that is responsible for disposing listeners.
- HoverWidgetBuilder = Widget Function(BuildContext context, bool hovering, Widget? child)
-
Builder function type for Hoverable where
hoveringis a boolean indicating whether the widget is currently being hovered or not.childis the child widget of Hoverable which won't be rebuilt whenhoveringchanges. -
SetFutureFunction
= Future<
R> Function<R>(Future< R> future) - Type definition for a function that returns a future.
- Space = Gap
- An alias name for the Gap widget.
- TickingWidgetBuilder = Widget Function(BuildContext context, DateTime currentTime, Widget? child)
- A builder function type that is used to build the ticking widget.