Jonny Borges

add initialData to futurize

@@ -74,6 +74,7 @@ mixin StateMixin<T> on ListNotifier { @@ -74,6 +74,7 @@ mixin StateMixin<T> on ListNotifier {
74 void futurize(Future<T> Function() body, 74 void futurize(Future<T> Function() body,
75 {T? initialData, String? errorMessage, bool useEmpty = true}) { 75 {T? initialData, String? errorMessage, bool useEmpty = true}) {
76 final compute = body; 76 final compute = body;
  77 + _value ??= initialData;
77 compute().then((newValue) { 78 compute().then((newValue) {
78 if ((newValue == null || newValue._isEmpty()) && useEmpty) { 79 if ((newValue == null || newValue._isEmpty()) && useEmpty) {
79 status = GetStatus<T>.loading(); 80 status = GetStatus<T>.loading();