Jonatas

fix widget extensions

@@ -37,7 +37,7 @@ Worker everAll(List<RxInterface> listener, Function(dynamic) callback, @@ -37,7 +37,7 @@ Worker everAll(List<RxInterface> listener, Function(dynamic) callback,
37 return Worker(cancel, '[everAll]'); 37 return Worker(cancel, '[everAll]');
38 } 38 }
39 39
40 -Worker once(RxInterface listener, Function(dynamic) callback, 40 +Worker once<T>(RxInterface<T> listener, Function(T) callback,
41 {bool condition = true}) { 41 {bool condition = true}) {
42 StreamSubscription sub; 42 StreamSubscription sub;
43 int times = 0; 43 int times = 0;
@@ -59,7 +59,7 @@ Worker once(RxInterface listener, Function(dynamic) callback, @@ -59,7 +59,7 @@ Worker once(RxInterface listener, Function(dynamic) callback,
59 return Worker(cancel, '[once]'); 59 return Worker(cancel, '[once]');
60 } 60 }
61 61
62 -Worker interval(RxInterface listener, Function(dynamic) callback, 62 +Worker interval<T>(RxInterface<T> listener, Function(T) callback,
63 {Duration time, bool condition = true}) { 63 {Duration time, bool condition = true}) {
64 bool debounceActive = false; 64 bool debounceActive = false;
65 StreamSubscription sub = listener.subject.stream.listen((event) async { 65 StreamSubscription sub = listener.subject.stream.listen((event) async {
@@ -77,7 +77,7 @@ Worker interval(RxInterface listener, Function(dynamic) callback, @@ -77,7 +77,7 @@ Worker interval(RxInterface listener, Function(dynamic) callback,
77 return Worker(cancel, '[interval]'); 77 return Worker(cancel, '[interval]');
78 } 78 }
79 79
80 -Worker debounce(RxInterface listener, Function(dynamic) callback, 80 +Worker debounce<T>(RxInterface<T> listener, Function(T) callback,
81 {Duration time}) { 81 {Duration time}) {
82 final _debouncer = Debouncer(delay: time ?? Duration(milliseconds: 800)); 82 final _debouncer = Debouncer(delay: time ?? Duration(milliseconds: 800));
83 StreamSubscription sub = listener.subject.stream.listen((event) { 83 StreamSubscription sub = listener.subject.stream.listen((event) {
@@ -35,14 +35,14 @@ extension WidgetMarginX on Widget { @@ -35,14 +35,14 @@ extension WidgetMarginX on Widget {
35 margin: 35 margin:
36 EdgeInsets.symmetric(horizontal: horizontal, vertical: vertical), 36 EdgeInsets.symmetric(horizontal: horizontal, vertical: vertical),
37 child: this); 37 child: this);
38 - 38 +
39 Widget marginOnly({ 39 Widget marginOnly({
40 double left = 0.0, 40 double left = 0.0,
41 double top = 0.0, 41 double top = 0.0,
42 double right = 0.0, 42 double right = 0.0,
43 double bottom = 0.0, 43 double bottom = 0.0,
44 }) => 44 }) =>
45 - Padding( 45 + Container(
46 margin: EdgeInsets.only( 46 margin: EdgeInsets.only(
47 top: top, left: left, right: right, bottom: bottom), 47 top: top, left: left, right: right, bottom: bottom),
48 child: this); 48 child: this);