Showing
14 changed files
with
203 additions
and
227 deletions
| @@ -4,8 +4,8 @@ part of rx_types; | @@ -4,8 +4,8 @@ part of rx_types; | ||
| 4 | /// reactivity | 4 | /// reactivity |
| 5 | /// of those `Widgets` and Rx values. | 5 | /// of those `Widgets` and Rx values. |
| 6 | 6 | ||
| 7 | -mixin RxObjectMixin<T> on NotifyManager<T?> { | ||
| 8 | - T? _value; | 7 | +mixin RxObjectMixin<T> on NotifyManager<T> { |
| 8 | + late T _value; | ||
| 9 | 9 | ||
| 10 | /// Makes a direct update of [value] adding it to the Stream | 10 | /// Makes a direct update of [value] adding it to the Stream |
| 11 | /// useful when you make use of Rx for custom Types to referesh your UI. | 11 | /// useful when you make use of Rx for custom Types to referesh your UI. |
| @@ -39,9 +39,9 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | @@ -39,9 +39,9 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | ||
| 39 | /// final inputError = ''.obs..nil(); | 39 | /// final inputError = ''.obs..nil(); |
| 40 | /// print('${inputError.runtimeType}: $inputError'); // outputs > RxString: null | 40 | /// print('${inputError.runtimeType}: $inputError'); // outputs > RxString: null |
| 41 | /// ``` | 41 | /// ``` |
| 42 | - void nil() { | ||
| 43 | - subject.add(_value = null); | ||
| 44 | - } | 42 | + // void nil() { |
| 43 | + // subject.add(_value = null); | ||
| 44 | + // } | ||
| 45 | 45 | ||
| 46 | /// Makes this Rx looks like a function so you can update a new | 46 | /// Makes this Rx looks like a function so you can update a new |
| 47 | /// value using [rx(someOtherValue)]. Practical to assign the Rx directly | 47 | /// value using [rx(someOtherValue)]. Practical to assign the Rx directly |
| @@ -59,7 +59,7 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | @@ -59,7 +59,7 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | ||
| 59 | /// onChanged: myText, | 59 | /// onChanged: myText, |
| 60 | /// ), | 60 | /// ), |
| 61 | ///``` | 61 | ///``` |
| 62 | - T? call([T? v]) { | 62 | + T call([T? v]) { |
| 63 | if (v != null) { | 63 | if (v != null) { |
| 64 | value = v; | 64 | value = v; |
| 65 | } | 65 | } |
| @@ -94,7 +94,7 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | @@ -94,7 +94,7 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | ||
| 94 | 94 | ||
| 95 | /// Updates the [value] and adds it to the stream, updating the observer | 95 | /// Updates the [value] and adds it to the stream, updating the observer |
| 96 | /// Widget, only if it's different from the previous value. | 96 | /// Widget, only if it's different from the previous value. |
| 97 | - set value(T? val) { | 97 | + set value(T val) { |
| 98 | if (_value == val && !firstRebuild) return; | 98 | if (_value == val && !firstRebuild) return; |
| 99 | firstRebuild = false; | 99 | firstRebuild = false; |
| 100 | _value = val; | 100 | _value = val; |
| @@ -102,7 +102,7 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | @@ -102,7 +102,7 @@ mixin RxObjectMixin<T> on NotifyManager<T?> { | ||
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | /// Returns the current [value] | 104 | /// Returns the current [value] |
| 105 | - T? get value { | 105 | + T get value { |
| 106 | if (RxInterface.proxy != null) { | 106 | if (RxInterface.proxy != null) { |
| 107 | RxInterface.proxy!.addListener(subject); | 107 | RxInterface.proxy!.addListener(subject); |
| 108 | } | 108 | } |
| @@ -145,7 +145,7 @@ mixin NotifyManager<T> { | @@ -145,7 +145,7 @@ mixin NotifyManager<T> { | ||
| 145 | void Function(T) onData, { | 145 | void Function(T) onData, { |
| 146 | Function? onError, | 146 | Function? onError, |
| 147 | void Function()? onDone, | 147 | void Function()? onDone, |
| 148 | - bool cancelOnError = false, | 148 | + bool? cancelOnError, |
| 149 | }) => | 149 | }) => |
| 150 | subject.listen(onData, | 150 | subject.listen(onData, |
| 151 | onError: onError, onDone: onDone, cancelOnError: cancelOnError); | 151 | onError: onError, onDone: onDone, cancelOnError: cancelOnError); |
| @@ -154,7 +154,7 @@ mixin NotifyManager<T> { | @@ -154,7 +154,7 @@ mixin NotifyManager<T> { | ||
| 154 | void close() { | 154 | void close() { |
| 155 | _subscriptions.forEach((getStream, _subscriptions) { | 155 | _subscriptions.forEach((getStream, _subscriptions) { |
| 156 | for (final subscription in _subscriptions) { | 156 | for (final subscription in _subscriptions) { |
| 157 | - subscription?.cancel(); | 157 | + subscription.cancel(); |
| 158 | } | 158 | } |
| 159 | }); | 159 | }); |
| 160 | 160 | ||
| @@ -164,7 +164,7 @@ mixin NotifyManager<T> { | @@ -164,7 +164,7 @@ mixin NotifyManager<T> { | ||
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | /// Base Rx class that manages all the stream logic for any Type. | 166 | /// Base Rx class that manages all the stream logic for any Type. |
| 167 | -abstract class _RxImpl<T> extends RxNotifier<T?> with RxObjectMixin<T> { | 167 | +abstract class _RxImpl<T> extends RxNotifier<T> with RxObjectMixin<T> { |
| 168 | _RxImpl(T initial) { | 168 | _RxImpl(T initial) { |
| 169 | _value = initial; | 169 | _value = initial; |
| 170 | } | 170 | } |
| @@ -5,8 +5,6 @@ part of rx_types; | @@ -5,8 +5,6 @@ part of rx_types; | ||
| 5 | /// This interface is the contract that [_RxImpl]<[T]> uses in all it's | 5 | /// This interface is the contract that [_RxImpl]<[T]> uses in all it's |
| 6 | /// subclass. | 6 | /// subclass. |
| 7 | abstract class RxInterface<T> { | 7 | abstract class RxInterface<T> { |
| 8 | - RxInterface([T? initial]); | ||
| 9 | - | ||
| 10 | bool get canUpdate; | 8 | bool get canUpdate; |
| 11 | 9 | ||
| 12 | /// Adds a listener to stream | 10 | /// Adds a listener to stream |
| @@ -288,13 +288,13 @@ class RxDouble extends _BaseRxNum<double?> { | @@ -288,13 +288,13 @@ class RxDouble extends _BaseRxNum<double?> { | ||
| 288 | 288 | ||
| 289 | /// Addition operator. | 289 | /// Addition operator. |
| 290 | RxDouble operator +(num other) { | 290 | RxDouble operator +(num other) { |
| 291 | - value += other; | 291 | + value = value! + other; |
| 292 | return this; | 292 | return this; |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | /// Subtraction operator. | 295 | /// Subtraction operator. |
| 296 | RxDouble operator -(num other) { | 296 | RxDouble operator -(num other) { |
| 297 | - value -= other; | 297 | + value = value! - other; |
| 298 | return this; | 298 | return this; |
| 299 | } | 299 | } |
| 300 | 300 | ||
| @@ -413,13 +413,13 @@ class RxInt extends _BaseRxNum<int?> { | @@ -413,13 +413,13 @@ class RxInt extends _BaseRxNum<int?> { | ||
| 413 | 413 | ||
| 414 | /// Addition operator. | 414 | /// Addition operator. |
| 415 | RxInt operator +(int other) { | 415 | RxInt operator +(int other) { |
| 416 | - value += other; | 416 | + value = value! + other; |
| 417 | return this; | 417 | return this; |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | /// Subtraction operator. | 420 | /// Subtraction operator. |
| 421 | RxInt operator -(int other) { | 421 | RxInt operator -(int other) { |
| 422 | - value -= other; | 422 | + value = value! - other; |
| 423 | return this; | 423 | return this; |
| 424 | } | 424 | } |
| 425 | 425 |
| @@ -75,11 +75,11 @@ class RxList<E> extends ListMixin<E> | @@ -75,11 +75,11 @@ class RxList<E> extends ListMixin<E> | ||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | @override | 77 | @override |
| 78 | - int get length => value!.length; | 78 | + int get length => value.length; |
| 79 | 79 | ||
| 80 | @override | 80 | @override |
| 81 | @protected | 81 | @protected |
| 82 | - List<E>? get value { | 82 | + List<E> get value { |
| 83 | if (RxInterface.proxy != null) { | 83 | if (RxInterface.proxy != null) { |
| 84 | RxInterface.proxy!.addListener(subject); | 84 | RxInterface.proxy!.addListener(subject); |
| 85 | } | 85 | } |
| @@ -87,28 +87,19 @@ class RxList<E> extends ListMixin<E> | @@ -87,28 +87,19 @@ class RxList<E> extends ListMixin<E> | ||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | @override | 89 | @override |
| 90 | - @protected | ||
| 91 | - @Deprecated('List.value is deprecated. use [yourList.assignAll(newList)]') | ||
| 92 | - set value(List<E>? val) { | ||
| 93 | - if (_value == val) return; | ||
| 94 | - _value = val; | ||
| 95 | - refresh(); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - @override | ||
| 99 | set length(int newLength) { | 90 | set length(int newLength) { |
| 100 | - _value!.length = newLength; | 91 | + _value.length = newLength; |
| 101 | refresh(); | 92 | refresh(); |
| 102 | } | 93 | } |
| 103 | 94 | ||
| 104 | @override | 95 | @override |
| 105 | void insertAll(int index, Iterable<E> iterable) { | 96 | void insertAll(int index, Iterable<E> iterable) { |
| 106 | - _value!.insertAll(index, iterable); | 97 | + _value.insertAll(index, iterable); |
| 107 | refresh(); | 98 | refresh(); |
| 108 | } | 99 | } |
| 109 | 100 | ||
| 110 | @override | 101 | @override |
| 111 | - Iterable<E> get reversed => value!.reversed; | 102 | + Iterable<E> get reversed => value.reversed; |
| 112 | 103 | ||
| 113 | @override | 104 | @override |
| 114 | Iterable<E> where(bool Function(E) test) { | 105 | Iterable<E> where(bool Function(E) test) { |
| @@ -57,21 +57,12 @@ class RxMap<K, V> extends MapMixin<K, V> | @@ -57,21 +57,12 @@ class RxMap<K, V> extends MapMixin<K, V> | ||
| 57 | 57 | ||
| 58 | @override | 58 | @override |
| 59 | @protected | 59 | @protected |
| 60 | - Map<K, V>? get value { | 60 | + Map<K, V> get value { |
| 61 | if (RxInterface.proxy != null) { | 61 | if (RxInterface.proxy != null) { |
| 62 | RxInterface.proxy!.addListener(subject); | 62 | RxInterface.proxy!.addListener(subject); |
| 63 | } | 63 | } |
| 64 | return _value; | 64 | return _value; |
| 65 | } | 65 | } |
| 66 | - | ||
| 67 | - @override | ||
| 68 | - @protected | ||
| 69 | - @Deprecated('Map.value is deprecated. use [yourMap.assignAll(newMap)]') | ||
| 70 | - set value(Map<K, V>? val) { | ||
| 71 | - if (_value == val) return; | ||
| 72 | - _value = val; | ||
| 73 | - refresh(); | ||
| 74 | - } | ||
| 75 | } | 66 | } |
| 76 | 67 | ||
| 77 | extension MapExtension<K, V> on Map<K, V> { | 68 | extension MapExtension<K, V> on Map<K, V> { |
| @@ -24,7 +24,7 @@ class RxSet<E> extends SetMixin<E> | @@ -24,7 +24,7 @@ class RxSet<E> extends SetMixin<E> | ||
| 24 | 24 | ||
| 25 | @override | 25 | @override |
| 26 | @protected | 26 | @protected |
| 27 | - Set<E>? get value { | 27 | + Set<E> get value { |
| 28 | if (RxInterface.proxy != null) { | 28 | if (RxInterface.proxy != null) { |
| 29 | RxInterface.proxy!.addListener(subject); | 29 | RxInterface.proxy!.addListener(subject); |
| 30 | } | 30 | } |
| @@ -33,7 +33,7 @@ class RxSet<E> extends SetMixin<E> | @@ -33,7 +33,7 @@ class RxSet<E> extends SetMixin<E> | ||
| 33 | 33 | ||
| 34 | @override | 34 | @override |
| 35 | @protected | 35 | @protected |
| 36 | - set value(Set<E>? val) { | 36 | + set value(Set<E> val) { |
| 37 | if (_value == val) return; | 37 | if (_value == val) return; |
| 38 | _value = val; | 38 | _value = val; |
| 39 | refresh(); | 39 | refresh(); |
| @@ -109,22 +109,18 @@ class RxSet<E> extends SetMixin<E> | @@ -109,22 +109,18 @@ class RxSet<E> extends SetMixin<E> | ||
| 109 | 109 | ||
| 110 | extension SetExtension<E> on Set<E> { | 110 | extension SetExtension<E> on Set<E> { |
| 111 | RxSet<E> get obs { | 111 | RxSet<E> get obs { |
| 112 | - if (this != null) { | ||
| 113 | - return RxSet<E>(<E>{})..addAllNonNull(this); | ||
| 114 | - } else { | ||
| 115 | - return RxSet<E>(null); | ||
| 116 | - } | 112 | + return RxSet<E>(<E>{})..addAll(this); |
| 117 | } | 113 | } |
| 118 | 114 | ||
| 119 | - /// Add [item] to [List<E>] only if [item] is not null. | ||
| 120 | - void addNonNull(E item) { | ||
| 121 | - if (item != null) add(item); | ||
| 122 | - } | 115 | + // /// Add [item] to [List<E>] only if [item] is not null. |
| 116 | + // void addNonNull(E item) { | ||
| 117 | + // if (item != null) add(item); | ||
| 118 | + // } | ||
| 123 | 119 | ||
| 124 | - /// Add [Iterable<E>] to [List<E>] only if [Iterable<E>] is not null. | ||
| 125 | - void addAllNonNull(Iterable<E> item) { | ||
| 126 | - if (item != null) addAll(item); | ||
| 127 | - } | 120 | + // /// Add [Iterable<E>] to [List<E>] only if [Iterable<E>] is not null. |
| 121 | + // void addAllNonNull(Iterable<E> item) { | ||
| 122 | + // if (item != null) addAll(item); | ||
| 123 | + // } | ||
| 128 | 124 | ||
| 129 | /// Add [item] to [List<E>] only if [condition] is true. | 125 | /// Add [item] to [List<E>] only if [condition] is true. |
| 130 | void addIf(dynamic condition, E item) { | 126 | void addIf(dynamic condition, E item) { |
| @@ -10,8 +10,8 @@ import '../../get_state_manager.dart'; | @@ -10,8 +10,8 @@ import '../../get_state_manager.dart'; | ||
| 10 | typedef GetXControllerBuilder<T extends DisposableInterface> = Widget Function( | 10 | typedef GetXControllerBuilder<T extends DisposableInterface> = Widget Function( |
| 11 | T controller); | 11 | T controller); |
| 12 | 12 | ||
| 13 | -class GetX<T extends DisposableInterface?> extends StatefulWidget { | ||
| 14 | - final GetXControllerBuilder<T>? builder; | 13 | +class GetX<T extends DisposableInterface> extends StatefulWidget { |
| 14 | + final GetXControllerBuilder<T> builder; | ||
| 15 | final bool global; | 15 | final bool global; |
| 16 | 16 | ||
| 17 | // final Stream Function(T) stream; | 17 | // final Stream Function(T) stream; |
| @@ -25,7 +25,7 @@ class GetX<T extends DisposableInterface?> extends StatefulWidget { | @@ -25,7 +25,7 @@ class GetX<T extends DisposableInterface?> extends StatefulWidget { | ||
| 25 | 25 | ||
| 26 | const GetX({ | 26 | const GetX({ |
| 27 | this.tag, | 27 | this.tag, |
| 28 | - this.builder, | 28 | + required this.builder, |
| 29 | this.global = true, | 29 | this.global = true, |
| 30 | this.autoRemove = true, | 30 | this.autoRemove = true, |
| 31 | this.initState, | 31 | this.initState, |
| @@ -42,7 +42,7 @@ class GetX<T extends DisposableInterface?> extends StatefulWidget { | @@ -42,7 +42,7 @@ class GetX<T extends DisposableInterface?> extends StatefulWidget { | ||
| 42 | GetXState<T> createState() => GetXState<T>(); | 42 | GetXState<T> createState() => GetXState<T>(); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | -class GetXState<T extends DisposableInterface?> extends State<GetX<T?>> { | 45 | +class GetXState<T extends DisposableInterface> extends State<GetX<T>> { |
| 46 | GetXState() { | 46 | GetXState() { |
| 47 | _observer = RxNotifier(); | 47 | _observer = RxNotifier(); |
| 48 | } | 48 | } |
| @@ -92,8 +92,8 @@ class GetXState<T extends DisposableInterface?> extends State<GetX<T?>> { | @@ -92,8 +92,8 @@ class GetXState<T extends DisposableInterface?> extends State<GetX<T?>> { | ||
| 92 | 92 | ||
| 93 | @override | 93 | @override |
| 94 | void didUpdateWidget(GetX oldWidget) { | 94 | void didUpdateWidget(GetX oldWidget) { |
| 95 | - super.didUpdateWidget(oldWidget as GetX<T?>); | ||
| 96 | - if (widget.didUpdateWidget != null) widget.didUpdateWidget!(oldWidget, this); | 95 | + super.didUpdateWidget(oldWidget as GetX<T>); |
| 96 | + widget.didUpdateWidget?.call(oldWidget, this); | ||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | @override | 99 | @override |
| @@ -114,7 +114,7 @@ class GetXState<T extends DisposableInterface?> extends State<GetX<T?>> { | @@ -114,7 +114,7 @@ class GetXState<T extends DisposableInterface?> extends State<GetX<T?>> { | ||
| 114 | Widget get notifyChildren { | 114 | Widget get notifyChildren { |
| 115 | final observer = RxInterface.proxy; | 115 | final observer = RxInterface.proxy; |
| 116 | RxInterface.proxy = _observer; | 116 | RxInterface.proxy = _observer; |
| 117 | - final result = widget.builder!(controller); | 117 | + final result = widget.builder(controller!); |
| 118 | if (!_observer!.canUpdate) { | 118 | if (!_observer!.canUpdate) { |
| 119 | throw """ | 119 | throw """ |
| 120 | [Get] the improper use of a GetX has been detected. | 120 | [Get] the improper use of a GetX has been detected. |
| @@ -534,7 +534,7 @@ class GetUtils { | @@ -534,7 +534,7 @@ class GetUtils { | ||
| 534 | /// Remove all whitespace inside string | 534 | /// Remove all whitespace inside string |
| 535 | /// Example: your name => yourname | 535 | /// Example: your name => yourname |
| 536 | static String removeAllWhitespace(String value) { | 536 | static String removeAllWhitespace(String value) { |
| 537 | - return value?.replaceAll(' ', ''); | 537 | + return value.replaceAll(' ', ''); |
| 538 | } | 538 | } |
| 539 | 539 | ||
| 540 | /// Camelcase string | 540 | /// Camelcase string |
| @@ -28,13 +28,13 @@ | @@ -28,13 +28,13 @@ | ||
| 28 | import 'package:flutter_test/flutter_test.dart'; | 28 | import 'package:flutter_test/flutter_test.dart'; |
| 29 | 29 | ||
| 30 | class _FunctionMatcher<T> extends CustomMatcher { | 30 | class _FunctionMatcher<T> extends CustomMatcher { |
| 31 | - final dynamic Function(T? value) _feature; | 31 | + final Object Function(T value) _feature; |
| 32 | 32 | ||
| 33 | _FunctionMatcher(String name, this._feature, matcher) | 33 | _FunctionMatcher(String name, this._feature, matcher) |
| 34 | : super('`$name`:', '`$name`', matcher); | 34 | : super('`$name`:', '`$name`', matcher); |
| 35 | 35 | ||
| 36 | @override | 36 | @override |
| 37 | - Object featureValueOf(covariant T? actual) => _feature(actual); | 37 | + Object featureValueOf(covariant T actual) => _feature(actual); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | class HavingMatcher<T> implements TypeMatcher<T> { | 40 | class HavingMatcher<T> implements TypeMatcher<T> { |
| @@ -48,27 +48,27 @@ void main() { | @@ -48,27 +48,27 @@ void main() { | ||
| 48 | Get.back(); | 48 | Get.back(); |
| 49 | expect(Get.isBottomSheetOpen, false); | 49 | expect(Get.isBottomSheetOpen, false); |
| 50 | 50 | ||
| 51 | - expect(() => Get.bottomSheet(Container(), isScrollControlled: null), | ||
| 52 | - throwsAssertionError); | 51 | + // expect(() => Get.bottomSheet(Container(), isScrollControlled: null), |
| 52 | + // throwsAssertionError); | ||
| 53 | 53 | ||
| 54 | - expect(() => Get.bottomSheet(Container(), isDismissible: null), | ||
| 55 | - throwsAssertionError); | 54 | + // expect(() => Get.bottomSheet(Container(), isDismissible: null), |
| 55 | + // throwsAssertionError); | ||
| 56 | 56 | ||
| 57 | - expect(() => Get.bottomSheet(Container(), enableDrag: null), | ||
| 58 | - throwsAssertionError); | 57 | + // expect(() => Get.bottomSheet(Container(), enableDrag: null), |
| 58 | + // throwsAssertionError); | ||
| 59 | 59 | ||
| 60 | await tester.pumpAndSettle(); | 60 | await tester.pumpAndSettle(); |
| 61 | }); | 61 | }); |
| 62 | 62 | ||
| 63 | - testWidgets( | ||
| 64 | - "GetMaterialApp with debugShowMaterialGrid null", | ||
| 65 | - (tester) async { | ||
| 66 | - expect( | ||
| 67 | - () => GetMaterialApp( | ||
| 68 | - debugShowMaterialGrid: null, | ||
| 69 | - ), | ||
| 70 | - throwsAssertionError, | ||
| 71 | - ); | ||
| 72 | - }, | ||
| 73 | - ); | 63 | + // testWidgets( |
| 64 | + // "GetMaterialApp with debugShowMaterialGrid null", | ||
| 65 | + // (tester) async { | ||
| 66 | + // expect( | ||
| 67 | + // () => GetMaterialApp( | ||
| 68 | + // debugShowMaterialGrid: null, | ||
| 69 | + // ), | ||
| 70 | + // throwsAssertionError, | ||
| 71 | + // ); | ||
| 72 | + // }, | ||
| 73 | + // ); | ||
| 74 | } | 74 | } |
| @@ -2,101 +2,101 @@ import 'package:flutter_test/flutter_test.dart'; | @@ -2,101 +2,101 @@ import 'package:flutter_test/flutter_test.dart'; | ||
| 2 | import 'package:get/get.dart'; | 2 | import 'package:get/get.dart'; |
| 3 | 3 | ||
| 4 | void main() { | 4 | void main() { |
| 5 | - testWidgets( | ||
| 6 | - "GetMaterialApp with routes null", | ||
| 7 | - (tester) async { | ||
| 8 | - expect( | ||
| 9 | - () => GetMaterialApp( | ||
| 10 | - routes: null, | ||
| 11 | - ), | ||
| 12 | - throwsAssertionError); | ||
| 13 | - }, | ||
| 14 | - ); | 5 | + // testWidgets( |
| 6 | + // "GetMaterialApp with routes null", | ||
| 7 | + // (tester) async { | ||
| 8 | + // expect( | ||
| 9 | + // () => GetMaterialApp( | ||
| 10 | + // routes: null, | ||
| 11 | + // ), | ||
| 12 | + // throwsAssertionError); | ||
| 13 | + // }, | ||
| 14 | + // ); | ||
| 15 | 15 | ||
| 16 | - testWidgets( | ||
| 17 | - "GetMaterialApp with navigatorObservers null", | ||
| 18 | - (tester) async { | ||
| 19 | - expect( | ||
| 20 | - () => GetMaterialApp( | ||
| 21 | - navigatorObservers: null, | ||
| 22 | - ), | ||
| 23 | - throwsAssertionError); | ||
| 24 | - }, | ||
| 25 | - ); | ||
| 26 | - testWidgets( | ||
| 27 | - "GetMaterialApp with title null", | ||
| 28 | - (tester) async { | ||
| 29 | - expect( | ||
| 30 | - () => GetMaterialApp( | ||
| 31 | - title: null, | ||
| 32 | - ), | ||
| 33 | - throwsAssertionError); | ||
| 34 | - }, | ||
| 35 | - ); | ||
| 36 | - testWidgets( | ||
| 37 | - "GetMaterialApp with debugShowMaterialGrid null", | ||
| 38 | - (test) async { | ||
| 39 | - expect( | ||
| 40 | - () => GetMaterialApp( | ||
| 41 | - debugShowMaterialGrid: null, | ||
| 42 | - ), | ||
| 43 | - throwsAssertionError, | ||
| 44 | - ); | ||
| 45 | - }, | ||
| 46 | - ); | ||
| 47 | - testWidgets( | ||
| 48 | - "GetMaterialApp with showPerformanceOverlay null", | ||
| 49 | - (test) async { | ||
| 50 | - expect( | ||
| 51 | - () => GetMaterialApp( | ||
| 52 | - showPerformanceOverlay: null, | ||
| 53 | - ), | ||
| 54 | - throwsAssertionError, | ||
| 55 | - ); | ||
| 56 | - }, | ||
| 57 | - ); | ||
| 58 | - testWidgets( | ||
| 59 | - "GetMaterialApp with showSemanticsDebugger null", | ||
| 60 | - (test) async { | ||
| 61 | - expect( | ||
| 62 | - () => GetMaterialApp( | ||
| 63 | - showSemanticsDebugger: null, | ||
| 64 | - ), | ||
| 65 | - throwsAssertionError, | ||
| 66 | - ); | ||
| 67 | - }, | ||
| 68 | - ); | ||
| 69 | - testWidgets( | ||
| 70 | - "GetMaterialApp with debugShowCheckedModeBanner null", | ||
| 71 | - (tester) async { | ||
| 72 | - expect( | ||
| 73 | - () => GetMaterialApp( | ||
| 74 | - debugShowCheckedModeBanner: null, | ||
| 75 | - ), | ||
| 76 | - throwsAssertionError); | ||
| 77 | - }, | ||
| 78 | - ); | 16 | + // testWidgets( |
| 17 | + // "GetMaterialApp with navigatorObservers null", | ||
| 18 | + // (tester) async { | ||
| 19 | + // expect( | ||
| 20 | + // () => GetMaterialApp( | ||
| 21 | + // navigatorObservers: null, | ||
| 22 | + // ), | ||
| 23 | + // throwsAssertionError); | ||
| 24 | + // }, | ||
| 25 | + // ); | ||
| 26 | + // testWidgets( | ||
| 27 | + // "GetMaterialApp with title null", | ||
| 28 | + // (tester) async { | ||
| 29 | + // expect( | ||
| 30 | + // () => GetMaterialApp( | ||
| 31 | + // title: null, | ||
| 32 | + // ), | ||
| 33 | + // throwsAssertionError); | ||
| 34 | + // }, | ||
| 35 | + // ); | ||
| 36 | + // testWidgets( | ||
| 37 | + // "GetMaterialApp with debugShowMaterialGrid null", | ||
| 38 | + // (test) async { | ||
| 39 | + // expect( | ||
| 40 | + // () => GetMaterialApp( | ||
| 41 | + // debugShowMaterialGrid: null, | ||
| 42 | + // ), | ||
| 43 | + // throwsAssertionError, | ||
| 44 | + // ); | ||
| 45 | + // }, | ||
| 46 | + // ); | ||
| 47 | + // testWidgets( | ||
| 48 | + // "GetMaterialApp with showPerformanceOverlay null", | ||
| 49 | + // (test) async { | ||
| 50 | + // expect( | ||
| 51 | + // () => GetMaterialApp( | ||
| 52 | + // showPerformanceOverlay: null, | ||
| 53 | + // ), | ||
| 54 | + // throwsAssertionError, | ||
| 55 | + // ); | ||
| 56 | + // }, | ||
| 57 | + // ); | ||
| 58 | + // testWidgets( | ||
| 59 | + // "GetMaterialApp with showSemanticsDebugger null", | ||
| 60 | + // (test) async { | ||
| 61 | + // expect( | ||
| 62 | + // () => GetMaterialApp( | ||
| 63 | + // showSemanticsDebugger: null, | ||
| 64 | + // ), | ||
| 65 | + // throwsAssertionError, | ||
| 66 | + // ); | ||
| 67 | + // }, | ||
| 68 | + // ); | ||
| 69 | + // testWidgets( | ||
| 70 | + // "GetMaterialApp with debugShowCheckedModeBanner null", | ||
| 71 | + // (tester) async { | ||
| 72 | + // expect( | ||
| 73 | + // () => GetMaterialApp( | ||
| 74 | + // debugShowCheckedModeBanner: null, | ||
| 75 | + // ), | ||
| 76 | + // throwsAssertionError); | ||
| 77 | + // }, | ||
| 78 | + // ); | ||
| 79 | 79 | ||
| 80 | - testWidgets( | ||
| 81 | - "GetMaterialApp with checkerboardRasterCacheImages null", | ||
| 82 | - (tester) async { | ||
| 83 | - expect( | ||
| 84 | - () => GetMaterialApp( | ||
| 85 | - checkerboardRasterCacheImages: null, | ||
| 86 | - ), | ||
| 87 | - throwsAssertionError); | ||
| 88 | - }, | ||
| 89 | - ); | 80 | + // testWidgets( |
| 81 | + // "GetMaterialApp with checkerboardRasterCacheImages null", | ||
| 82 | + // (tester) async { | ||
| 83 | + // expect( | ||
| 84 | + // () => GetMaterialApp( | ||
| 85 | + // checkerboardRasterCacheImages: null, | ||
| 86 | + // ), | ||
| 87 | + // throwsAssertionError); | ||
| 88 | + // }, | ||
| 89 | + // ); | ||
| 90 | 90 | ||
| 91 | - testWidgets( | ||
| 92 | - "GetMaterialApp with checkerboardOffscreenLayers null", | ||
| 93 | - (tester) async { | ||
| 94 | - expect( | ||
| 95 | - () => GetMaterialApp( | ||
| 96 | - checkerboardOffscreenLayers: null, | ||
| 97 | - ), | ||
| 98 | - throwsAssertionError, | ||
| 99 | - ); | ||
| 100 | - }, | ||
| 101 | - ); | 91 | + // testWidgets( |
| 92 | + // "GetMaterialApp with checkerboardOffscreenLayers null", | ||
| 93 | + // (tester) async { | ||
| 94 | + // expect( | ||
| 95 | + // () => GetMaterialApp( | ||
| 96 | + // checkerboardOffscreenLayers: null, | ||
| 97 | + // ), | ||
| 98 | + // throwsAssertionError, | ||
| 99 | + // ); | ||
| 100 | + // }, | ||
| 101 | + // ); | ||
| 102 | } | 102 | } |
| @@ -3,41 +3,41 @@ import 'package:flutter_test/flutter_test.dart'; | @@ -3,41 +3,41 @@ import 'package:flutter_test/flutter_test.dart'; | ||
| 3 | import 'package:get/get.dart'; | 3 | import 'package:get/get.dart'; |
| 4 | 4 | ||
| 5 | void main() { | 5 | void main() { |
| 6 | - testWidgets( | ||
| 7 | - 'GetPage page null', | ||
| 8 | - (tester) async { | ||
| 9 | - expect(() => GetPage(page: null, name: null), throwsAssertionError); | ||
| 10 | - }, | ||
| 11 | - ); | 6 | + // testWidgets( |
| 7 | + // 'GetPage page null', | ||
| 8 | + // (tester) async { | ||
| 9 | + // expect(() => GetPage(page: null, name: null), throwsAssertionError); | ||
| 10 | + // }, | ||
| 11 | + // ); | ||
| 12 | 12 | ||
| 13 | - testWidgets( | ||
| 14 | - "GetPage maintainState null", | ||
| 15 | - (tester) async { | ||
| 16 | - expect( | ||
| 17 | - () => GetPage(page: () => Scaffold(), maintainState: null, name: '/'), | ||
| 18 | - throwsAssertionError, | ||
| 19 | - ); | ||
| 20 | - }, | ||
| 21 | - ); | 13 | + // testWidgets( |
| 14 | + // "GetPage maintainState null", | ||
| 15 | + // (tester) async { | ||
| 16 | + // expect( | ||
| 17 | + // () => GetPage(page: () => Scaffold(), maintainState: null, name: '/'), | ||
| 18 | + // throwsAssertionError, | ||
| 19 | + // ); | ||
| 20 | + // }, | ||
| 21 | + // ); | ||
| 22 | 22 | ||
| 23 | - testWidgets( | ||
| 24 | - "GetPage name null", | ||
| 25 | - (tester) async { | ||
| 26 | - expect( | ||
| 27 | - () => GetPage(page: () => Scaffold(), maintainState: null, name: null), | ||
| 28 | - throwsAssertionError, | ||
| 29 | - ); | ||
| 30 | - }, | ||
| 31 | - ); | 23 | + // testWidgets( |
| 24 | + // "GetPage name null", | ||
| 25 | + // (tester) async { | ||
| 26 | + // expect( | ||
| 27 | + // () => GetPage(page: () => Scaffold(), maintainState: null, name: null), | ||
| 28 | + // throwsAssertionError, | ||
| 29 | + // ); | ||
| 30 | + // }, | ||
| 31 | + // ); | ||
| 32 | 32 | ||
| 33 | - testWidgets( | ||
| 34 | - "GetPage fullscreenDialog null", | ||
| 35 | - (tester) async { | ||
| 36 | - expect( | ||
| 37 | - () => | ||
| 38 | - GetPage(page: () => Scaffold(), fullscreenDialog: null, name: '/'), | ||
| 39 | - throwsAssertionError, | ||
| 40 | - ); | ||
| 41 | - }, | ||
| 42 | - ); | 33 | + // testWidgets( |
| 34 | + // "GetPage fullscreenDialog null", | ||
| 35 | + // (tester) async { | ||
| 36 | + // expect( | ||
| 37 | + // () => | ||
| 38 | + // GetPage(page: () => Scaffold(), fullscreenDialog: null, name: '/'), | ||
| 39 | + // throwsAssertionError, | ||
| 40 | + // ); | ||
| 41 | + // }, | ||
| 42 | + // ); | ||
| 43 | } | 43 | } |
| @@ -64,18 +64,18 @@ void main() { | @@ -64,18 +64,18 @@ void main() { | ||
| 64 | expect(find.text("Count: 2"), findsOneWidget); | 64 | expect(find.text("Count: 2"), findsOneWidget); |
| 65 | }); | 65 | }); |
| 66 | 66 | ||
| 67 | - testWidgets( | ||
| 68 | - "MixinBuilder with build null", | ||
| 69 | - (tester) async { | ||
| 70 | - expect( | ||
| 71 | - () => MixinBuilder<Controller>( | ||
| 72 | - init: Controller(), | ||
| 73 | - builder: null, | ||
| 74 | - ), | ||
| 75 | - throwsAssertionError, | ||
| 76 | - ); | ||
| 77 | - }, | ||
| 78 | - ); | 67 | + // testWidgets( |
| 68 | + // "MixinBuilder with build null", | ||
| 69 | + // (tester) async { | ||
| 70 | + // expect( | ||
| 71 | + // () => MixinBuilder<Controller>( | ||
| 72 | + // init: Controller(), | ||
| 73 | + // builder: null, | ||
| 74 | + // ), | ||
| 75 | + // throwsAssertionError, | ||
| 76 | + // ); | ||
| 77 | + // }, | ||
| 78 | + // ); | ||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | class Controller extends GetxController { | 81 | class Controller extends GetxController { |
| @@ -679,7 +679,7 @@ void main() { | @@ -679,7 +679,7 @@ void main() { | ||
| 679 | expect('foo bar'.capitalize, 'Foo Bar'); | 679 | expect('foo bar'.capitalize, 'Foo Bar'); |
| 680 | expect('FoO bAr'.capitalize, 'Foo Bar'); | 680 | expect('FoO bAr'.capitalize, 'Foo Bar'); |
| 681 | expect('FOO BAR'.capitalize, 'Foo Bar'); | 681 | expect('FOO BAR'.capitalize, 'Foo Bar'); |
| 682 | - expect(null.capitalize, null); | 682 | + // expect(null.capitalize, null); |
| 683 | expect(''.capitalize, ''); | 683 | expect(''.capitalize, ''); |
| 684 | expect('foo bar '.capitalize, 'Foo Bar '); | 684 | expect('foo bar '.capitalize, 'Foo Bar '); |
| 685 | }); | 685 | }); |
| @@ -688,16 +688,16 @@ void main() { | @@ -688,16 +688,16 @@ void main() { | ||
| 688 | expect('foo bar'.capitalizeFirst, 'Foo bar'); | 688 | expect('foo bar'.capitalizeFirst, 'Foo bar'); |
| 689 | expect('FoO bAr'.capitalizeFirst, 'Foo bar'); | 689 | expect('FoO bAr'.capitalizeFirst, 'Foo bar'); |
| 690 | expect('FOO BAR'.capitalizeFirst, 'Foo bar'); | 690 | expect('FOO BAR'.capitalizeFirst, 'Foo bar'); |
| 691 | - expect(null.capitalizeFirst, null); | 691 | + // expect(null.capitalizeFirst, null); |
| 692 | expect(''.capitalizeFirst, ''); | 692 | expect(''.capitalizeFirst, ''); |
| 693 | }); | 693 | }); |
| 694 | 694 | ||
| 695 | test('var.removeAllWhitespace', () { | 695 | test('var.removeAllWhitespace', () { |
| 696 | - late String nullString; | 696 | + //late String nullString; |
| 697 | expect('foo bar'.removeAllWhitespace, 'foobar'); | 697 | expect('foo bar'.removeAllWhitespace, 'foobar'); |
| 698 | expect('foo'.removeAllWhitespace, 'foo'); | 698 | expect('foo'.removeAllWhitespace, 'foo'); |
| 699 | expect(''.removeAllWhitespace, ''); | 699 | expect(''.removeAllWhitespace, ''); |
| 700 | - expect(nullString.removeAllWhitespace, null); | 700 | + // expect(nullString.removeAllWhitespace, null); |
| 701 | }); | 701 | }); |
| 702 | 702 | ||
| 703 | test('var.camelCase', () { | 703 | test('var.camelCase', () { |
-
Please register or login to post a comment