[SYNC]
This commit is contained in:
@@ -124,8 +124,10 @@ class AstromicSheetHelper {
|
|||||||
radius: sheetStyle.radius,
|
radius: sheetStyle.radius,
|
||||||
//
|
//
|
||||||
child: ChangeNotifierProvider<SheetStore>(
|
child: ChangeNotifierProvider<SheetStore>(
|
||||||
create: (BuildContext c) => SheetStore(),
|
create: (BuildContext c) => store,
|
||||||
child: BaseSheetWidget<T?>(
|
child: ListenableBuilder(
|
||||||
|
listenable: store,
|
||||||
|
builder: (_, __) => BaseSheetWidget<T?>(
|
||||||
sheetType: SheetType.form,
|
sheetType: SheetType.form,
|
||||||
//
|
//
|
||||||
sheetConfiguration: sheetConfigs,
|
sheetConfiguration: sheetConfigs,
|
||||||
@@ -136,6 +138,7 @@ class AstromicSheetHelper {
|
|||||||
footerSectionFormBuilder: footerSectionBuilder == null ? null : (AstromicFormController controller) => footerSectionBuilder.call(controller, store),
|
footerSectionFormBuilder: footerSectionBuilder == null ? null : (AstromicFormController controller) => footerSectionBuilder.call(controller, store),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// ignore_for_file: close_sinks
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
@@ -9,6 +12,8 @@ class SheetStore extends ChangeNotifier {
|
|||||||
/// An unmodifiable view of the items in the store.
|
/// An unmodifiable view of the items in the store.
|
||||||
UnmodifiableMapView<String, dynamic> get items => UnmodifiableMapView<String, dynamic>(_items);
|
UnmodifiableMapView<String, dynamic> get items => UnmodifiableMapView<String, dynamic>(_items);
|
||||||
|
|
||||||
|
static final StreamController<UnmodifiableMapView<String, dynamic>> _stateStreamController = StreamController<UnmodifiableMapView<String, dynamic>>.broadcast();
|
||||||
|
final Stream<UnmodifiableMapView<String, dynamic>> stateStream = _stateStreamController.stream;
|
||||||
/// Adds [item] to store.
|
/// Adds [item] to store.
|
||||||
void add(String itemID, dynamic value) {
|
void add(String itemID, dynamic value) {
|
||||||
_items.addEntries(<MapEntry<String, dynamic>>[MapEntry<String, dynamic>(itemID, value)]);
|
_items.addEntries(<MapEntry<String, dynamic>>[MapEntry<String, dynamic>(itemID, value)]);
|
||||||
|
|||||||
Reference in New Issue
Block a user