MultiBlocProvider class

Merges multiple BlocProvider widgets into one widget tree.

MultiBlocProvider improves the readability and eliminates the need to nest multiple BlocProviders.

By using MultiBlocProvider we can go from:

BlocProvider<BlocA>(
  create: (BuildContext context) => BlocA(),
  child: BlocProvider<BlocB>(
    create: (BuildContext context) => BlocB(),
    child: BlocProvider<BlocC>(
      create: (BuildContext context) => BlocC(),
      child: ChildA(),
    )
  )
)

to:

MultiBlocProvider(
  providers: [
    BlocProvider<BlocA>(
      create: (BuildContext context) => BlocA(),
    ),
    BlocProvider<BlocB>(
      create: (BuildContext context) => BlocB(),
    ),
    BlocProvider<BlocC>(
      create: (BuildContext context) => BlocC(),
    ),
  ],
  child: ChildA(),
)

MultiBlocProvider converts the BlocProvider list into a tree of nested BlocProvider widgets. As a result, the only advantage of using MultiBlocProvider is improved readability due to the reduction in nesting and boilerplate.

Inheritance
Implemented types
Available extensions

Constructors

MultiBlocProvider({required List<SingleChildWidget> providers, required Widget child, Key? key})
Merges multiple BlocProvider widgets into one widget tree.

Properties

hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

align(AlignmentGeometry alignment) → Widget

Available on Widget, provided by the NexoWidgetX extension

Выравнивает виджет внутри родителя.
aspectRatio(double aspectRatio) → Widget

Available on Widget, provided by the NexoWidgetX extension

Соотношение сторон.
build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
inherited
center() → Widget

Available on Widget, provided by the NexoWidgetX extension

Центрирует виджет.
clipRRect(double radius) → Widget

Available on Widget, provided by the NexoWidgetX extension

Скруглённая обрезка с радиусом radius.
createElement() → _NestedElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
decorated(Decoration decoration) → Widget

Available on Widget, provided by the NexoWidgetX extension

Произвольный декор (фон, градиент, рамка, тень) под содержимым.
expanded({int flex = 1}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Растягивает внутри Row/Column; требует предка Flex.
flexible({int flex = 1, FlexFit fit = FlexFit.loose}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Гибкое место внутри Row/Column; требует предка Flex.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTap(VoidCallback? onTap, {HitTestBehavior behavior = HitTestBehavior.opaque}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Обработка тапа; behavior управляет областью приёма касаний.
opacity(double opacity) → Widget

Available on Widget, provided by the NexoWidgetX extension

Полупрозрачность.
pad(double all) → Widget

Available on Widget, provided by the NexoWidgetX extension

Оборачивает в Padding со всеми сторонами all.
padOnly({double left = 0, double top = 0, double right = 0, double bottom = 0}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Отступы по отдельным сторонам (нулевые по умолчанию).
padSymmetric({double horizontal = 0, double vertical = 0}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Симметричные отступы по горизонтали и вертикали.
safeArea({bool top = true, bool bottom = true, bool left = true, bool right = true}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Отступ от системных элементов экрана (чёлка, системные жесты).
sized({double? width, double? height}) → Widget

Available on Widget, provided by the NexoWidgetX extension

Фиксированный размер.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited