roi peker

Merge remote-tracking branch 'upstream/master'

... ... @@ -160,6 +160,16 @@ class RxBool extends _RxImpl<bool> {
RxBool([bool initial]) {
_value = initial;
}
bool operator &(bool other) => other && value;
bool operator |(bool other) => other || value;
bool operator ^(bool other) => !other == value;
String toString() {
return value ? "true" : "false";
}
}
class RxDouble extends _RxImpl<double> {
... ...
... ... @@ -3,7 +3,7 @@ import 'package:get/get.dart';
import '../rx_core/rx_interface.dart';
import 'utils/debouncer.dart';
Worker ever(RxInterface listener, Function(dynamic) callback,
Worker ever<T>(RxInterface<T> listener, Function(T) callback,
{bool condition = true}) {
StreamSubscription sub = listener.subject.stream.listen((event) {
if (condition) callback(event);
... ... @@ -37,7 +37,7 @@ Worker everAll(List<RxInterface> listener, Function(dynamic) callback,
return Worker(cancel, '[everAll]');
}
Worker once(RxInterface listener, Function(dynamic) callback,
Worker once<T>(RxInterface<T> listener, Function(T) callback,
{bool condition = true}) {
StreamSubscription sub;
int times = 0;
... ... @@ -59,7 +59,7 @@ Worker once(RxInterface listener, Function(dynamic) callback,
return Worker(cancel, '[once]');
}
Worker interval(RxInterface listener, Function(dynamic) callback,
Worker interval<T>(RxInterface<T> listener, Function(T) callback,
{Duration time, bool condition = true}) {
bool debounceActive = false;
StreamSubscription sub = listener.subject.stream.listen((event) async {
... ... @@ -77,7 +77,7 @@ Worker interval(RxInterface listener, Function(dynamic) callback,
return Worker(cancel, '[interval]');
}
Worker debounce(RxInterface listener, Function(dynamic) callback,
Worker debounce<T>(RxInterface<T> listener, Function(T) callback,
{Duration time}) {
final _debouncer = Debouncer(delay: time ?? Duration(milliseconds: 800));
StreamSubscription sub = listener.subject.stream.listen((event) {
... ...
import 'package:flutter/widgets.dart';
/// add Padding Property to widget
extension WidgetPaddingX on Widget {
Widget paddingAll(double padding) =>
Padding(padding: EdgeInsets.all(padding), child: this);
... ... @@ -24,6 +25,7 @@ extension WidgetPaddingX on Widget {
Widget get paddingZero => Padding(padding: EdgeInsets.zero, child: this);
}
/// Add margin property to widget
extension WidgetMarginX on Widget {
Widget marginAll(double margin) =>
Container(margin: EdgeInsets.all(margin), child: this);
... ... @@ -47,3 +49,8 @@ extension WidgetMarginX on Widget {
Widget get marginZero => Container(margin: EdgeInsets.zero, child: this);
}
/// Allows you to insert widgets inside a CustomScrollView
extension WidgetSliverBoxX on Widget {
Widget get sliverBox => SliverToBoxAdapter(child: this);
}
... ...