This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Provides a functionality for capture the widget as image. | |
class WidgetToImage { | |
WidgetToImage._(); | |
/// Captures the widget. | |
/// | |
/// The [pixelRatio] describes the scale between the logical pixels and the | |
/// size of the output image. It is independent of the | |
/// [dart:ui.FlutterView.devicePixelRatio] for the device, so specifying 1.0 | |
/// (the default) will give you a 1:1 mapping between logical pixels and the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DebouncedScrollController extends ScrollController { | |
DebouncedScrollController({ | |
super.initialScrollOffset, | |
super.keepScrollOffset, | |
super.debugLabel, | |
super.onAttach, | |
super.onDetach, | |
this.debounceTime = const Duration(milliseconds: 150), | |
}) { | |
_streamSubscription = _streamController.stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// {@template web_hydrated_storage} | |
/// Implementation of [Storage] which uses session storage of web browser | |
/// to persist and retrieve state changes. | |
/// {@endtemplate} | |
class WebHydratedStorage implements Storage { | |
const WebHydratedStorage() | |
: assert(kIsWeb, 'WebHydratedStorage is only available on web platform'); | |
/// Returns instance of [WebStorage]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Base hydrated [Bloc] which saves its state apart for authenticated user. | |
abstract class BaseHydratedBloc<TEvent, TState> | |
extends HydratedBloc<TEvent, TState> with StreamSubscriptionMixin<TState> { | |
/// Abstract constructor. This constructor provides an initial [state] and | |
/// optional [id] (usually user identifier) which is used to change a | |
/// [storagePrefix]. | |
BaseHydratedBloc(super.state, {int? id}) { | |
authenticatedUserId ??= id; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScrollableDebounce extends StatefulWidget { | |
const ScrollableDebounce({ | |
Key? key, | |
required this.controller, | |
required this.onScroll, | |
this.debounceTime = const Duration(milliseconds: 200), | |
required this.child, | |
}) : super(key: key); | |
/// An object that can be used to control the position to which this scroll |