├── .github └── FUNDING.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── doc └── api │ ├── __404error.html │ ├── categories.json │ ├── index.html │ ├── index.json │ ├── rx_command │ ├── Action.html │ ├── Action1.html │ ├── AsyncAction.html │ ├── AsyncAction1.html │ ├── AsyncFunc.html │ ├── AsyncFunc1.html │ ├── CommandResult-class.html │ ├── CommandResult │ │ ├── CommandResult.html │ │ ├── data.html │ │ ├── error.html │ │ ├── hasData.html │ │ ├── hasError.html │ │ ├── hashCode.html │ │ ├── isExecuting.html │ │ ├── noSuchMethod.html │ │ ├── operator_equals.html │ │ ├── runtimeType.html │ │ └── toString.html │ ├── Func.html │ ├── Func1.html │ ├── MockCommand-class.html │ ├── MockCommand │ │ ├── MockCommand.html │ │ ├── endExecutionNoData.html │ │ ├── endExecutionWithData.html │ │ ├── endExecutionWithError.html │ │ ├── execute.html │ │ ├── executionCount.html │ │ ├── lastPassedValueToExecute.html │ │ ├── queueResultsForNextExecuteCall.html │ │ ├── returnValuesForNextExecute.html │ │ ├── startExecution.html │ │ └── subject.html │ ├── RxCommand-class.html │ ├── RxCommand │ │ ├── RxCommand.html │ │ ├── any.html │ │ ├── asBroadcastStream.html │ │ ├── asyncExpand.html │ │ ├── asyncMap.html │ │ ├── buffer.html │ │ ├── bufferCount.html │ │ ├── bufferFuture.html │ │ ├── bufferTest.html │ │ ├── bufferTime.html │ │ ├── bufferWhen.html │ │ ├── bufferWithCount.html │ │ ├── call.html │ │ ├── canExecute.html │ │ ├── cast.html │ │ ├── concatMap.html │ │ ├── concatWith.html │ │ ├── contains.html │ │ ├── createAsync.html │ │ ├── createAsync1.html │ │ ├── createAsync2.html │ │ ├── createAsync3.html │ │ ├── createAsyncNoParam.html │ │ ├── createAsyncNoParamNoResult.html │ │ ├── createAsyncNoResult.html │ │ ├── createFromStream.html │ │ ├── createSync.html │ │ ├── createSync1.html │ │ ├── createSync2.html │ │ ├── createSync3.html │ │ ├── createSyncNoParam.html │ │ ├── createSyncNoParamNoResult.html │ │ ├── createSyncNoResult.html │ │ ├── debounce.html │ │ ├── debounceTime.html │ │ ├── defaultIfEmpty.html │ │ ├── delay.html │ │ ├── dematerialize.html │ │ ├── dispose.html │ │ ├── distinct.html │ │ ├── distinctUnique.html │ │ ├── doOnCancel.html │ │ ├── doOnData.html │ │ ├── doOnDone.html │ │ ├── doOnEach.html │ │ ├── doOnError.html │ │ ├── doOnListen.html │ │ ├── doOnPause.html │ │ ├── doOnResume.html │ │ ├── drain.html │ │ ├── elementAt.html │ │ ├── every.html │ │ ├── execute.html │ │ ├── exhaustMap.html │ │ ├── expand.html │ │ ├── first.html │ │ ├── firstWhere.html │ │ ├── flatMap.html │ │ ├── flatMapIterable.html │ │ ├── flatMapLatest.html │ │ ├── fold.html │ │ ├── forEach.html │ │ ├── groupBy.html │ │ ├── handleError.html │ │ ├── hashCode.html │ │ ├── ignoreElements.html │ │ ├── interval.html │ │ ├── isBroadcast.html │ │ ├── isEmpty.html │ │ ├── isExecuting.html │ │ ├── join.html │ │ ├── last.html │ │ ├── lastResult.html │ │ ├── lastWhere.html │ │ ├── length.html │ │ ├── listen.html │ │ ├── map.html │ │ ├── mapTo.html │ │ ├── materialize.html │ │ ├── max.html │ │ ├── mergeWith.html │ │ ├── min.html │ │ ├── next.html │ │ ├── noSuchMethod.html │ │ ├── ofType.html │ │ ├── onErrorResume.html │ │ ├── onErrorResumeNext.html │ │ ├── onErrorReturn.html │ │ ├── onErrorReturnWith.html │ │ ├── operator_equals.html │ │ ├── pairwise.html │ │ ├── pipe.html │ │ ├── publish.html │ │ ├── publishReplay.html │ │ ├── publishValue.html │ │ ├── publishValueSeeded.html │ │ ├── reduce.html │ │ ├── repeat.html │ │ ├── results.html │ │ ├── retype.html │ │ ├── runtimeType.html │ │ ├── sample.html │ │ ├── sampleTime.html │ │ ├── scan.html │ │ ├── share.html │ │ ├── shareReplay.html │ │ ├── shareValue.html │ │ ├── shareValueSeeded.html │ │ ├── single.html │ │ ├── singleWhere.html │ │ ├── skip.html │ │ ├── skipUntil.html │ │ ├── skipWhile.html │ │ ├── startWith.html │ │ ├── startWithMany.html │ │ ├── stream.html │ │ ├── switchIfEmpty.html │ │ ├── switchMap.html │ │ ├── take.html │ │ ├── takeUntil.html │ │ ├── takeWhile.html │ │ ├── throttle.html │ │ ├── throttleTime.html │ │ ├── throwExceptions.html │ │ ├── thrownExceptions.html │ │ ├── timeInterval.html │ │ ├── timeout.html │ │ ├── timestamp.html │ │ ├── toList.html │ │ ├── toSet.html │ │ ├── toString.html │ │ ├── transform.html │ │ ├── where.html │ │ ├── window.html │ │ ├── windowCount.html │ │ ├── windowFuture.html │ │ ├── windowTest.html │ │ ├── windowTime.html │ │ ├── windowWhen.html │ │ ├── windowWithCount.html │ │ ├── withLatestFrom.html │ │ └── zipWith.html │ ├── RxCommandAsync-class.html │ ├── RxCommandAsync │ │ ├── RxCommandAsync.html │ │ └── execute.html │ ├── RxCommandStream-class.html │ ├── RxCommandStream │ │ ├── RxCommandStream.html │ │ └── execute.html │ ├── RxCommandSync-class.html │ ├── RxCommandSync │ │ ├── RxCommandSync.html │ │ └── execute.html │ ├── StreamProvider.html │ └── rx_command-library.html │ ├── rx_command_listener │ ├── RxCommandListener-class.html │ ├── RxCommandListener │ │ ├── RxCommandListener.html │ │ ├── busyChangeSubscription.html │ │ ├── busySubscription.html │ │ ├── canExecuteStateSubscription.html │ │ ├── command.html │ │ ├── debounceDuration.html │ │ ├── dispose.html │ │ ├── errorSubscription.html │ │ ├── hashCode.html │ │ ├── noSuchMethod.html │ │ ├── onCanExecuteChange.html │ │ ├── onError.html │ │ ├── onIsBusy.html │ │ ├── onIsBusyChange.html │ │ ├── onNotBusy.html │ │ ├── onResult.html │ │ ├── onValue.html │ │ ├── operator_equals.html │ │ ├── resultsSubscription.html │ │ ├── runtimeType.html │ │ ├── toString.html │ │ └── valueSubscription.html │ └── rx_command_listener-library.html │ └── static-assets │ ├── URI.js │ ├── css │ ├── bootstrap.css │ ├── bootstrap.css.map │ └── bootstrap.min.css │ ├── favicon.png │ ├── github.css │ ├── highlight.pack.js │ ├── play_button.svg │ ├── readme.md │ ├── script.js │ ├── sdk_footer_text.html │ ├── styles.css │ └── typeahead.bundle.min.js ├── example ├── .gitignore ├── .metadata ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutterweatherdemo │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── homepage.dart │ ├── json │ │ └── weather_in_cities.dart │ ├── listview.dart │ ├── main.dart │ └── weather_viewmodel.dart ├── pubspec.lock └── pubspec.yaml ├── ios └── Runner │ ├── GeneratedPluginRegistrant.h │ └── GeneratedPluginRegistrant.m ├── lib ├── rx_command.dart └── rx_command_listener.dart ├── makedoc.bat ├── pubspec.lock ├── pubspec.yaml └── test └── rx_command_test.dart /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | github: [escamoteur] 3 | custom: ['https://www.buymeacoffee.com/escamoteur'] 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [5.3.0] - 15.01.2020 2 | 3 | * updated to rxdart 0.25.0 4 | * fixed iOS build settings in example project 5 | 6 | ## [5.2.1] - 16.09.2020 7 | 8 | * documentation fixes and small improvements by @AlexBacich thanks a lot!!! 9 | 10 | ## [5.2.0] - 03.08.2020 11 | 12 | * Fhttps://github.com/fluttercommunity/rx_command/issues/44 13 | 14 | ## [5.1.0] - 23.06.2020 15 | 16 | * PR by @AlexBacich and @nosmirck with a lot of little fixes 17 | 18 | * Updated dependency to rxdart 19 | 20 | ## [5.0.3] - 19.03.2020 21 | 22 | * Added helpful factory constructors to CommandResult 23 | 24 | ## [5.0.2] - 29.01.2020 25 | 26 | * https://github.com/fluttercommunity/rx_command/issues/36 27 | 28 | ## [5.0.1] - 29.12.2019 29 | 30 | * Removed Flutter dependency 31 | 32 | ## [5.0.0] - 28.12.2019 33 | 34 | * Adapted to rxdart ^0.23.1 by abandoning Observables and use the new extension methods 35 | 36 | ## [4.3.4] - 28.12.2019 37 | 38 | * Fix for https://github.com/fluttercommunity/rx_command/issues/32 39 | 40 | * Fix for https://github.com/fluttercommunity/rx_command/issues/33 41 | 42 | ## [4.3.3] - 03.12.2019 43 | 44 | * fix for https://github.com/fluttercommunity/rx_command/issues/31 45 | 46 | * https://github.com/fluttercommunity/rx_command/issues/28 47 | 48 | ## [4.3.2] - 23.08.2019 49 | 50 | * fix for https://github.com/fluttercommunity/rx_command/issues/26 51 | 52 | If you encounter any problems please file an issue. 53 | 54 | ## [4.3.1+2] - 16.07.2019 55 | 56 | * PR with spelling corrections 57 | 58 | ## [4.3.1+1] - 26.06.2019 59 | 60 | * updated logo in readme 61 | 62 | ## [4.3.1] - 07.05.2019 63 | 64 | * Version bump to rxdart: ^0.22.0 65 | 66 | ## [4.3.0] - 29.03.2019 67 | 68 | * Bug fix in RxCommandListener 69 | * Adding `next`property: 70 | 71 | ``` 72 | /// This property is a utility which allows us to chain RxCommands together. 73 | Future get next => Observable.merge([this, this.thrownExceptions.cast()]).take(1).last; 74 | ``` 75 | 76 | ## [4.2.0] - 15.02.2019 77 | 78 | * Thrown exceptions that are no descendants of the type Exceptions are no longer wrapped in an Exception object 79 | 80 | ## [4.1.2] - 05.02.2019 81 | 82 | * bugfix: If you created a command with `RxCommand.createFromStream` the isExecuting state was not set correctly 83 | 84 | ## [4.1.1] - 04.02.2019 85 | 86 | * bugfix https://github.com/fluttercommunity/rx_command/issues/9 87 | 88 | ## [4.1.0] - 01.01.2019 89 | 90 | * added RxCommandListener 91 | 92 | ## [4.0.2] - 30.10.2018 93 | 94 | * removed dependency to json_annotations 95 | 96 | ## [4.0.1] - 07.09.2018 97 | 98 | * Updated to rxdart v 0.19.0 99 | 100 | ## [4.0.0] - 07.09.2018 101 | 102 | * **BREAKING CHANGE** All creation functions got renamed to be more descriptive than the numbered ones. The new variants are: 103 | 104 | ```Dart 105 | static RxCommand createSync(Func1 func,... 106 | static RxCommand createSyncNoParam(Func func,... 107 | static RxCommand createSyncNoResult(Action1 action,... 108 | static RxCommand createSyncNoParamNoResult(Action action,... 109 | 110 | static RxCommand createAsync(AsyncFunc1 func,... 111 | static RxCommand createAsyncNoParam(AsyncFunc func,... 112 | static RxCommand createAsyncNoResult(AsyncAction1 action,... 113 | static RxCommand createAsyncNoParamNoResult(AsyncAction action,... 114 | ``` 115 | 116 | 117 | 118 | ## [3.0.0] - 07.09.2018 119 | 120 | * IMPORTANT: As of V3.0 `CommandResult` objects are now emitted on the `.results` property and the pure results of the wrapped function on the RxCommand itself. So I switched the two because while working on RxVMS it turned out that I use the pure result much more often. Also the name of `.results` matches much better with `CommandResult`. If you don't want to change your code you can just stay on 2.06 if you don't need any of V 3.0 features. 121 | * Also you now can set an `initialLastResult` when creating an RxCommand. 122 | 123 | ## [2.0.3] - 21.06.2018 124 | 125 | * Moved package to [Flutter Community](https://github.com/fluttercommunity) 126 | 127 | ## [2.0.4] - 19.08.2018 128 | 129 | * Fixed `quiver_hashcode` dependency issue. 130 | 131 | ## [2.0.2] - 19.06.2018 132 | 133 | * Update to RxDart 0.18.0 134 | 135 | ## [2.0.1] - 15.06.2018 136 | 137 | * Bug fix. `createAsync` and `createAsync1` were missing an await. 138 | 139 | ## [2.0.0] - 06.06.2018 140 | 141 | * Till now the `results` Observable and the `RxCommand` itself behaved like a `BehaviourSubjects`. This can lead to problems when using with Flutter. 142 | From now on the default is `PublishSubject`. If you need `BehaviourSubject` behaviour, meaning every new listener gets the last received value, you can set `emitsLastValueToNewSubscriptions = true` when creating `RxCommand`. 143 | 144 | 145 | ## [1.1.0] - 08.05.2018 146 | 147 | * Updated to accommodate a a breaking API change in RxDart 0.16.7 because no longer do Subjects expose an `observable` property because Subjects now implement Observable interface directly like other Rx implementation. 148 | 149 | ## [1.0.9] - 26.04.2018 150 | 151 | * Added an `emitLastResult` parameter to RxCommand factory functions. If true the last result will be transmitted in the data field of `CommandResults` while `isExecuting==true` or `hasError==true`. 152 | 153 | 154 | ## [1.0.8] - 25.04.2018 155 | 156 | * RxCommand no longer issues an initial `CommandResult(null,null,false)` unless you set `emitInitialCommandResult: true` when creating the command. 157 | 158 | ## [1.0.7] - 20.04.2018 159 | 160 | * Forgot to run tests and missed an error that I introduced following an analyser hint that I should use `const` instead of `new` 161 | 162 | ## [1.0.6] - 20.04.2018 163 | 164 | * Polishing and including `analysis_options.yaml` 165 | 166 | ## [1.0.5] - 20.04.2018 167 | 168 | * Improvements and docs for MockCommand 169 | 170 | ## [1.0.4] - 19.04.2018 171 | 172 | * Added MockCommand 173 | 174 | 175 | ## [1.0.3] - 17.04.2018 176 | 177 | * RxCommands created by RxCommand.createFromStream no longer emit a final event after the last item of the source stream was received 178 | 179 | 180 | ## [1.0.2] - 16.04.2018 181 | 182 | * Added CommandResult, now RxCommand is itself an Observable that emits CommandResults 183 | 184 | ## [1.0.1] - 11.04.2018 185 | 186 | * Small update in docs 187 | 188 | ## [1.0.0] - 11.04.2018 189 | 190 | * Made RxCommand a callable class so that you now can directly assign it to your widget handlers 191 | 192 | ## [0.0.3] - 10.04.2018 193 | 194 | * Trying to fix the documentation link 195 | 196 | ## [0.0.2] - 10.04.2018 197 | 198 | * Removed the necessity of type `Unit`. Instead now `Null` is used 199 | 200 | ## [0.0.1] - 10.04.2018 201 | 202 | * Initial release. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Thomas Burkhart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | errors: 5 | unused_import: error 6 | unused_local_variable: error 7 | dead_code: error 8 | invalid_override_of_non_virtual_member: error 9 | exclude: 10 | - example/lib/json/weather_in_cities.g.dart 11 | 12 | linter: 13 | rules: 14 | - annotate_overrides 15 | - avoid_empty_else 16 | - avoid_function_literals_in_foreach_calls 17 | - avoid_init_to_null 18 | - avoid_null_checks_in_equality_operators 19 | - avoid_renaming_method_parameters 20 | - avoid_return_types_on_setters 21 | - avoid_returning_null 22 | - avoid_types_as_parameter_names 23 | - avoid_unused_constructor_parameters 24 | - await_only_futures 25 | - camel_case_types 26 | #- cancel_subscriptions 27 | #- cascade_invocations 28 | - comment_references 29 | #- constant_identifier_names 30 | - control_flow_in_finally 31 | - directives_ordering 32 | - empty_catches 33 | - empty_constructor_bodies 34 | - empty_statements 35 | - hash_and_equals 36 | #- implementation_imports 37 | - invariant_booleans 38 | - iterable_contains_unrelated_type 39 | - library_names 40 | - library_prefixes 41 | - list_remove_unrelated_type 42 | - no_adjacent_strings_in_list 43 | - no_duplicate_case_values 44 | - non_constant_identifier_names 45 | - omit_local_variable_types 46 | #- only_throw_errors 47 | - overridden_fields 48 | #- package_api_docs 49 | - package_names 50 | - package_prefixed_library_names 51 | - prefer_adjacent_string_concatenation 52 | - prefer_collection_literals 53 | - prefer_conditional_assignment 54 | #- prefer_const_constructors 55 | - prefer_contains 56 | - prefer_final_fields 57 | - prefer_initializing_formals 58 | #- prefer_interpolation_to_compose_strings 59 | - prefer_is_empty 60 | - prefer_is_not_empty 61 | # - prefer_single_quotes 62 | - prefer_typing_uninitialized_variables 63 | - recursive_getters 64 | - slash_for_doc_comments 65 | - test_types_in_equals 66 | - throw_in_finally 67 | - type_init_formals 68 | - unawaited_futures 69 | - unnecessary_brace_in_string_interps 70 | - unnecessary_getters_setters 71 | # - unnecessary_lambdas 72 | - unnecessary_null_aware_assignments 73 | - unnecessary_statements 74 | # - unnecessary_this 75 | - unrelated_type_equality_checks 76 | - valid_regexps -------------------------------------------------------------------------------- /doc/api/__404error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | rx_command - Dart API docs 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 30 |
rx_command
31 | 34 |
35 | 36 |
37 | 38 | 56 | 57 |
58 |

404: Something's gone wrong :-(

59 | 60 |
61 |

You've tried to visit a page that doesn't exist. Luckily this site 62 | has other pages.

63 |

If you were looking for something specific, try searching: 64 |

67 |

68 | 69 |
70 |
71 | 72 | 74 | 75 |
76 | 77 |
78 | 79 | rx_command 80 | 5.1.0 81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /doc/api/categories.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /doc/api/rx_command/Action.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Action typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
Action
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

Action typedef

85 | 86 |
87 | void 88 | Action 89 | () 90 |
91 | 92 |
93 |

Implementation

94 |
typedef Action = void Function();
95 |
96 | 97 |
98 | 99 | 101 | 102 |
103 | 104 |
105 | 106 | rx_command 107 | 5.1.0 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /doc/api/rx_command/Action1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Action1 typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
Action1
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

Action1<TParam> typedef

85 | 86 |
87 | void 88 | Action1 89 | (
  1. TParam param
  2. 90 |
) 91 |
92 | 93 |
94 |

Implementation

95 |
typedef Action1<TParam> = void Function(TParam param);
96 |
97 | 98 |
99 | 100 | 102 | 103 |
104 | 105 |
106 | 107 | rx_command 108 | 5.1.0 109 | 110 | 111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/api/rx_command/AsyncAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | AsyncAction typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
AsyncAction
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

AsyncAction typedef

85 | 86 |
87 | Future 88 | AsyncAction 89 | () 90 |
91 | 92 |
93 |

Implementation

94 |
typedef AsyncAction = Future Function();
95 |
96 | 97 |
98 | 99 | 101 | 102 |
103 | 104 |
105 | 106 | rx_command 107 | 5.1.0 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /doc/api/rx_command/AsyncAction1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | AsyncAction1 typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
AsyncAction1
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

AsyncAction1<TParam> typedef

85 | 86 |
87 | Future 88 | AsyncAction1 89 | (
  1. TParam param
  2. 90 |
) 91 |
92 | 93 |
94 |

Implementation

95 |
typedef AsyncAction1<TParam> = Future Function(TParam param);
96 |
97 | 98 |
99 | 100 | 102 | 103 |
104 | 105 |
106 | 107 | rx_command 108 | 5.1.0 109 | 110 | 111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/api/rx_command/AsyncFunc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | AsyncFunc typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
AsyncFunc
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

AsyncFunc<TResult> typedef

85 | 86 |
87 | Future<TResult> 88 | AsyncFunc 89 | () 90 |
91 | 92 |
93 |

Implementation

94 |
typedef AsyncFunc<TResult> = Future<TResult> Function();
95 |
96 | 97 |
98 | 99 | 101 | 102 |
103 | 104 |
105 | 106 | rx_command 107 | 5.1.0 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /doc/api/rx_command/AsyncFunc1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | AsyncFunc1 typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
AsyncFunc1
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

AsyncFunc1<TParam, TResult> typedef

85 | 86 |
87 | Future<TResult> 88 | AsyncFunc1 89 | (
  1. TParam param
  2. 90 |
) 91 |
92 | 93 |
94 |

Implementation

95 |
typedef AsyncFunc1<TParam, TResult> = Future<TResult> Function(TParam param);
96 |
97 | 98 |
99 | 100 | 102 | 103 |
104 | 105 |
106 | 107 | rx_command 108 | 5.1.0 109 | 110 | 111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/CommandResult.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | CommandResult constructor - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
CommandResult
33 | 36 |
37 | 38 |
39 | 40 | 87 | 88 |
89 |

CommandResult<T> constructor

90 | 91 |
92 | const 93 | CommandResult<T>(
  1. T data,
  2. 94 |
  3. dynamic error,
  4. 95 |
  5. bool isExecuting
  6. 96 |
) 97 |
98 | 99 | 100 |
101 |

Implementation

102 |
const CommandResult(this.data, this.error, this.isExecuting);
103 |
104 | 105 |
106 | 107 | 109 | 110 |
111 | 112 |
113 | 114 | rx_command 115 | 5.1.0 116 | 117 | 118 |
119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | data property - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
data
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |

data property

91 | 92 |
93 | T 94 | data 95 |
final
96 |
97 |
98 |

Implementation

99 |
final T data
100 | 
101 | 
102 |
103 | 104 |
105 | 106 | 108 | 109 |
110 | 111 |
112 | 113 | rx_command 114 | 5.1.0 115 | 116 | 117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | error property - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
error
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |

error property

91 | 92 |
93 | dynamic 94 | error 95 |
final
96 |
97 |
98 |

Implementation

99 |
final dynamic error
100 | 
101 | 
102 |
103 | 104 |
105 | 106 | 108 | 109 |
110 | 111 |
112 | 113 | rx_command 114 | 5.1.0 115 | 116 | 117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/hasData.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | hasData property - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
hasData
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |

hasData property

91 | 92 | 93 |
94 | 95 |
96 | bool 97 | hasData 98 | 99 |
100 | 101 |
102 |

Implementation

103 |
bool get hasData => data != null;
104 |
105 |
106 | 107 |
108 | 109 | 111 | 112 |
113 | 114 |
115 | 116 | rx_command 117 | 5.1.0 118 | 119 | 120 |
121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/hasError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | hasError property - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
hasError
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |

hasError property

91 | 92 | 93 |
94 | 95 |
96 | bool 97 | hasError 98 | 99 |
100 | 101 |
102 |

Implementation

103 |
bool get hasError => error != null;
104 |
105 |
106 | 107 |
108 | 109 | 111 | 112 |
113 | 114 |
115 | 116 | rx_command 117 | 5.1.0 118 | 119 | 120 |
121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/isExecuting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | isExecuting property - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
isExecuting
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |

isExecuting property

91 | 92 |
93 | bool 94 | isExecuting 95 |
final
96 |
97 |
98 |

Implementation

99 |
final bool isExecuting
100 | 
101 | 
102 |
103 | 104 |
105 | 106 | 108 | 109 |
110 | 111 |
112 | 113 | rx_command 114 | 5.1.0 115 | 116 | 117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/noSuchMethod.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | noSuchMethod method - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
noSuchMethod
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |
91 |

noSuchMethod method

92 | 93 |
94 | dynamic 95 | noSuchMethod 96 | (
  1. Invocation invocation
  2. 97 |
) 98 |
inherited
99 |
100 |
101 |

Invoked when a non-existent method or property is accessed.

102 |

Classes can override noSuchMethod to provide custom behavior.

103 |

If a value is returned, it becomes the result of the original invocation.

104 |

The default behavior is to throw a NoSuchMethodError.

105 |
106 | 107 |
108 |

Implementation

109 |
@pragma("vm:entry-point")
110 | external dynamic noSuchMethod(Invocation invocation);
111 |
112 | 113 |
114 | 115 | 117 | 118 |
119 | 120 |
121 | 122 | rx_command 123 | 5.1.0 124 | 125 | 126 |
127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/runtimeType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | runtimeType property - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
runtimeType
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |
91 |

runtimeType property

92 | 93 | 94 |
95 | 96 |
97 | Type 98 | runtimeType 99 |
inherited
100 |
101 | 102 |
103 |

A representation of the runtime type of the object.

104 |
105 |
106 |

Implementation

107 |
external Type get runtimeType;
108 |
109 |
110 | 111 |
112 | 113 | 115 | 116 |
117 | 118 |
119 | 120 | rx_command 121 | 5.1.0 122 | 123 | 124 |
125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /doc/api/rx_command/CommandResult/toString.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | toString method - CommandResult class - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
toString
33 | 36 |
37 | 38 |
39 | 40 | 88 | 89 |
90 |

toString method

91 | 92 |
93 |
94 |
    95 |
  1. @override
  2. 96 |
97 |
98 | String 99 | toString 100 | () 101 | 102 |
103 |
104 |

Returns a string representation of this object.

105 |
106 | 107 |
108 |

Implementation

109 |
@override
110 | String toString() {
111 |   return 'Data: $data - HasError: $hasError - IsExecuting: $isExecuting';
112 | }
113 |
114 | 115 |
116 | 117 | 119 | 120 |
121 | 122 |
123 | 124 | rx_command 125 | 5.1.0 126 | 127 | 128 |
129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/api/rx_command/Func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Func typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
Func
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

Func<TResult> typedef

85 | 86 |
87 | TResult 88 | Func 89 | () 90 |
91 | 92 |
93 |

Implementation

94 |
typedef Func<TResult> = TResult Function();
95 |
96 | 97 |
98 | 99 | 101 | 102 |
103 | 104 |
105 | 106 | rx_command 107 | 5.1.0 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /doc/api/rx_command/Func1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Func1 typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
Func1
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

Func1<TParam, TResult> typedef

85 | 86 |
87 | TResult 88 | Func1 89 | (
  1. TParam param
  2. 90 |
) 91 |
92 | 93 |
94 |

Implementation

95 |
typedef Func1<TParam, TResult> = TResult Function(TParam param);
96 |
97 | 98 |
99 | 100 | 102 | 103 |
104 | 105 |
106 | 107 | rx_command 108 | 5.1.0 109 | 110 | 111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/api/rx_command/StreamProvider.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | StreamProvider typedef - rx_command library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 31 |
StreamProvider
32 | 35 |
36 | 37 |
38 | 39 | 82 | 83 |
84 |

StreamProvider<TParam, TResult> typedef

85 | 86 |
87 | Stream<TResult> 88 | StreamProvider 89 | (
  1. TParam param
  2. 90 |
) 91 |
92 | 93 |
94 |

Implementation

95 |
typedef StreamProvider<TParam, TResult> = Stream<TResult> Function(
 96 |     TParam param);
97 |
98 | 99 |
100 | 101 | 103 | 104 |
105 | 106 |
107 | 108 | rx_command 109 | 5.1.0 110 | 111 | 112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /doc/api/rx_command_listener/RxCommandListener/onIsBusy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | onIsBusy property - RxCommandListener class - rx_command_listener library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
onIsBusy
33 | 36 |
37 | 38 |
39 | 40 | 95 | 96 |
97 |

onIsBusy property

98 | 99 |
100 | void Function() 101 | onIsBusy 102 |
final
103 |
104 |
105 |

Implementation

106 |
final void Function() onIsBusy
107 | 
108 | 
109 |
110 | 111 |
112 | 113 | 115 | 116 |
117 | 118 |
119 | 120 | rx_command 121 | 5.1.0 122 | 123 | 124 |
125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /doc/api/rx_command_listener/RxCommandListener/onNotBusy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | onNotBusy property - RxCommandListener class - rx_command_listener library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 32 |
onNotBusy
33 | 36 |
37 | 38 |
39 | 40 | 95 | 96 |
97 |

onNotBusy property

98 | 99 |
100 | void Function() 101 | onNotBusy 102 |
final
103 |
104 |
105 |

Implementation

106 |
final void Function() onNotBusy
107 | 
108 | 
109 |
110 | 111 |
112 | 113 | 115 | 116 |
117 | 118 |
119 | 120 | rx_command 121 | 5.1.0 122 | 123 | 124 |
125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /doc/api/rx_command_listener/rx_command_listener-library.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | rx_command_listener library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 |
23 | 24 |
25 | 26 | 30 |
rx_command_listener
31 | 34 |
35 | 36 |
37 | 38 | 57 | 58 |
59 |

rx_command_listener library

60 | 61 | 62 |
63 |

Classes

64 | 65 |
66 |
67 | RxCommandListener<TParam, TResult> 68 |
69 |
70 | 71 |
72 |
73 |
74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
84 | 85 | 100 | 101 |
102 | 103 |
104 | 105 | rx_command 106 | 5.1.0 107 | 108 | 109 |
110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /doc/api/static-assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/doc/api/static-assets/favicon.png -------------------------------------------------------------------------------- /doc/api/static-assets/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #998; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-subst { 24 | color: #333; 25 | font-weight: bold; 26 | } 27 | 28 | .hljs-number, 29 | .hljs-literal, 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-tag .hljs-attr { 33 | color: #008080; 34 | } 35 | 36 | .hljs-string, 37 | .hljs-doctag { 38 | color: #d14; 39 | } 40 | 41 | .hljs-title, 42 | .hljs-section, 43 | .hljs-selector-id { 44 | color: #900; 45 | font-weight: bold; 46 | } 47 | 48 | .hljs-subst { 49 | font-weight: normal; 50 | } 51 | 52 | .hljs-type, 53 | .hljs-class .hljs-title { 54 | color: #458; 55 | font-weight: bold; 56 | } 57 | 58 | .hljs-tag, 59 | .hljs-name, 60 | .hljs-attribute { 61 | color: #000080; 62 | font-weight: normal; 63 | } 64 | 65 | .hljs-regexp, 66 | .hljs-link { 67 | color: #009926; 68 | } 69 | 70 | .hljs-symbol, 71 | .hljs-bullet { 72 | color: #990073; 73 | } 74 | 75 | .hljs-built_in, 76 | .hljs-builtin-name { 77 | color: #0086b3; 78 | } 79 | 80 | .hljs-meta { 81 | color: #999; 82 | font-weight: bold; 83 | } 84 | 85 | .hljs-deletion { 86 | background: #fdd; 87 | } 88 | 89 | .hljs-addition { 90 | background: #dfd; 91 | } 92 | 93 | .hljs-emphasis { 94 | font-style: italic; 95 | } 96 | 97 | .hljs-strong { 98 | font-weight: bold; 99 | } 100 | -------------------------------------------------------------------------------- /doc/api/static-assets/play_button.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/api/static-assets/readme.md: -------------------------------------------------------------------------------- 1 | # highlight.js 2 | 3 | Generated from https://highlightjs.org/download/ on 2019-05-16 4 | 5 | Included languages: 6 | 7 | * bash 8 | * css 9 | * dart 10 | * html, xml 11 | * java 12 | * javascript 13 | * json 14 | * kotlin 15 | * markdown 16 | * objective-c 17 | * shell 18 | * swift 19 | * yaml 20 | -------------------------------------------------------------------------------- /doc/api/static-assets/sdk_footer_text.html: -------------------------------------------------------------------------------- 1 | • 2 | 3 | cc license 4 | 5 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 1ad9baa8b99a2897c20f9e6e54d3b9b359ade314 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | errors: 5 | unused_import: error 6 | unused_local_variable: error 7 | dead_code: error 8 | invalid_override_of_non_virtual_member: error 9 | exclude: 10 | - lib/json/* 11 | 12 | 13 | linter: 14 | rules: 15 | - annotate_overrides 16 | - avoid_empty_else 17 | - avoid_function_literals_in_foreach_calls 18 | - avoid_init_to_null 19 | - avoid_null_checks_in_equality_operators 20 | - avoid_renaming_method_parameters 21 | - avoid_return_types_on_setters 22 | - avoid_returning_null 23 | - avoid_types_as_parameter_names 24 | - avoid_unused_constructor_parameters 25 | - await_only_futures 26 | - camel_case_types 27 | #- cancel_subscriptions 28 | #- cascade_invocations 29 | - comment_references 30 | #- constant_identifier_names 31 | - control_flow_in_finally 32 | - directives_ordering 33 | - empty_catches 34 | - empty_constructor_bodies 35 | - empty_statements 36 | - hash_and_equals 37 | #- implementation_imports 38 | - invariant_booleans 39 | - iterable_contains_unrelated_type 40 | - library_names 41 | - library_prefixes 42 | - list_remove_unrelated_type 43 | - no_adjacent_strings_in_list 44 | - no_duplicate_case_values 45 | - non_constant_identifier_names 46 | - omit_local_variable_types 47 | #- only_throw_errors 48 | - overridden_fields 49 | #- package_api_docs 50 | - package_names 51 | - package_prefixed_library_names 52 | - prefer_adjacent_string_concatenation 53 | - prefer_collection_literals 54 | - prefer_conditional_assignment 55 | #- prefer_const_constructors 56 | - prefer_contains 57 | - prefer_final_fields 58 | - prefer_initializing_formals 59 | #- prefer_interpolation_to_compose_strings 60 | - prefer_is_empty 61 | - prefer_is_not_empty 62 | # - prefer_single_quotes 63 | - prefer_typing_uninitialized_variables 64 | - recursive_getters 65 | - slash_for_doc_comments 66 | - test_types_in_equals 67 | - throw_in_finally 68 | - type_init_formals 69 | - unawaited_futures 70 | - unnecessary_brace_in_string_interps 71 | - unnecessary_getters_setters 72 | # - unnecessary_lambdas 73 | - unnecessary_null_aware_assignments 74 | - unnecessary_statements 75 | # - unnecessary_this 76 | - unrelated_type_equality_checks 77 | - valid_regexps -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.flutterweatherdemo" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/flutterweatherdemo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutterweatherdemo 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttercommunity/rx_command/ea5bfe40cc5095c0dd07d5dd1f115d7ee52c5201/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutterweatherdemo 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/homepage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'listview.dart'; 4 | import 'main.dart'; 5 | 6 | class HomePage extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar(title: Text("WeatherDemo")), 11 | body: Column( 12 | children: [ 13 | Padding( 14 | padding: const EdgeInsets.all(5.0), 15 | child: TextField( 16 | autocorrect: false, 17 | decoration: InputDecoration( 18 | hintText: "Filter cities", 19 | hintStyle: TextStyle(color: Color.fromARGB(150, 0, 0, 0)), 20 | ), 21 | style: TextStyle( 22 | fontSize: 20.0, 23 | color: Color.fromARGB(255, 0, 0, 0), 24 | ), 25 | onChanged: TheViewModel.of(context).textChangedCommand, 26 | ), 27 | ), 28 | Expanded( 29 | // Handle events to show / hide spinner 30 | child: StreamBuilder( 31 | stream: TheViewModel.of(context).updateWeatherCommand.isExecuting, 32 | builder: (BuildContext context, AsyncSnapshot isRunning) { 33 | // if true we show a buys Spinner otherwise the ListView 34 | if (isRunning.hasData && isRunning.data == true) { 35 | return Center( 36 | child: Container( 37 | width: 50.0, 38 | height: 50.0, 39 | child: CircularProgressIndicator(), 40 | ), 41 | ); 42 | } else { 43 | return WeatherListView(); 44 | } 45 | }, 46 | ), 47 | ), 48 | Padding( 49 | padding: const EdgeInsets.all(8.0), 50 | // We use a stream builder to toggle the enabled state of the button 51 | child: Row( 52 | children: [ 53 | Expanded( 54 | child: StreamBuilder( 55 | // Streambuilder rebuilds its subtree on every item the stream issues 56 | stream: TheViewModel.of(context) 57 | .updateWeatherCommand 58 | .canExecute, //We access our ViewModel through the inherited Widget 59 | builder: 60 | (BuildContext context, AsyncSnapshot snapshot) { 61 | VoidCallback handler; 62 | if (snapshot.hasData) { 63 | // Depending on teh Value we get from the stream we set or clear the Handler 64 | handler = snapshot.data 65 | ? TheViewModel.of(context).updateWeatherCommand 66 | : null; 67 | } 68 | return RaisedButton( 69 | child: Text("Update"), 70 | color: Color.fromARGB(255, 33, 150, 243), 71 | textColor: Color.fromARGB(255, 255, 255, 255), 72 | onPressed: handler, 73 | ); 74 | }, 75 | ), 76 | ), 77 | StateFullSwitch( 78 | state: true, 79 | onChanged: TheViewModel.of(context).switchChangedCommand, 80 | ) 81 | ], 82 | ), 83 | ), 84 | ], 85 | ), 86 | ); 87 | } 88 | } 89 | 90 | /// As the normal switch does not even remeber and display its current state 91 | /// we us this one 92 | class StateFullSwitch extends StatefulWidget { 93 | final bool state; 94 | final ValueChanged onChanged; 95 | 96 | StateFullSwitch({this.state, this.onChanged}); 97 | 98 | @override 99 | StateFullSwitchState createState() { 100 | return StateFullSwitchState(state, onChanged); 101 | } 102 | } 103 | 104 | class StateFullSwitchState extends State { 105 | bool state; 106 | ValueChanged handler; 107 | 108 | StateFullSwitchState(this.state, this.handler); 109 | 110 | @override 111 | Widget build(BuildContext context) { 112 | return Switch( 113 | value: state, 114 | onChanged: (b) { 115 | setState(() => state = b); 116 | handler(b); 117 | }, 118 | ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /example/lib/json/weather_in_cities.dart: -------------------------------------------------------------------------------- 1 | class WeatherInCities { 2 | WeatherInCities({ 3 | this.cod, 4 | this.calctime, 5 | this.cnt, 6 | this.cities, 7 | }); 8 | 9 | final int cod; 10 | final double calctime; 11 | final int cnt; 12 | final List cities; 13 | 14 | factory WeatherInCities.fromJson(Map json) => 15 | WeatherInCities( 16 | cod: json["cod"] as int, 17 | calctime: json["calctime"] as double, 18 | cnt: json["cnt"] as int, 19 | cities: List.from((json["list"] as List) 20 | .map((x) => City.fromJson(x as Map)) 21 | .toList()), 22 | ); 23 | 24 | Map toJson() => { 25 | "cod": cod, 26 | "calctime": calctime, 27 | "cnt": cnt, 28 | "list": List.from(cities.map((x) => x.toJson())), 29 | }; 30 | } 31 | 32 | class City { 33 | City({ 34 | this.id, 35 | this.dt, 36 | this.name, 37 | this.coord, 38 | this.main, 39 | this.visibility, 40 | this.wind, 41 | this.rain, 42 | this.snow, 43 | this.clouds, 44 | this.weather, 45 | }); 46 | 47 | final int id; 48 | final int dt; 49 | final String name; 50 | final Coord coord; 51 | final MainClass main; 52 | final int visibility; 53 | final Wind wind; 54 | final dynamic rain; 55 | final dynamic snow; 56 | final Clouds clouds; 57 | final List weather; 58 | 59 | factory City.fromJson(Map json) => City( 60 | id: json["id"] as int, 61 | dt: json["dt"] as int, 62 | name: json["name"] as String, 63 | coord: Coord.fromJson(json["coord"] as Map), 64 | main: MainClass.fromJson(json["main"] as Map), 65 | visibility: 66 | json["visibility"] == null ? null : json["visibility"] as int, 67 | wind: Wind.fromJson(json["wind"] as Map), 68 | rain: json["rain"], 69 | snow: json["snow"], 70 | clouds: Clouds.fromJson(json["clouds"] as Map), 71 | weather: List.from((json["weather"] as List) 72 | .map((x) => Weather.fromJson(x as Map))), 73 | ); 74 | 75 | Map toJson() => { 76 | "id": id, 77 | "dt": dt, 78 | "name": name, 79 | "coord": coord.toJson(), 80 | "main": main.toJson(), 81 | "visibility": visibility == null ? null : visibility, 82 | "wind": wind.toJson(), 83 | "rain": rain, 84 | "snow": snow, 85 | "clouds": clouds.toJson(), 86 | "weather": List.from(weather.map((x) => x.toJson())), 87 | }; 88 | } 89 | 90 | class Clouds { 91 | Clouds({ 92 | this.today, 93 | }); 94 | 95 | final int today; 96 | 97 | factory Clouds.fromJson(Map json) => Clouds( 98 | today: json["today"] as int, 99 | ); 100 | 101 | Map toJson() => { 102 | "today": today, 103 | }; 104 | } 105 | 106 | class Coord { 107 | Coord({ 108 | this.lon, 109 | this.lat, 110 | }); 111 | 112 | final double lon; 113 | final double lat; 114 | 115 | factory Coord.fromJson(Map json) => Coord( 116 | lon: (json["Lon"] as num).toDouble(), 117 | lat: (json["Lat"] as num).toDouble(), 118 | ); 119 | 120 | Map toJson() => { 121 | "Lon": lon, 122 | "Lat": lat, 123 | }; 124 | } 125 | 126 | class MainClass { 127 | MainClass({ 128 | this.temp, 129 | this.feelsLike, 130 | this.tempMin, 131 | this.tempMax, 132 | this.pressure, 133 | this.humidity, 134 | this.seaLevel, 135 | this.grndLevel, 136 | }); 137 | 138 | final double temp; 139 | final double feelsLike; 140 | final double tempMin; 141 | final double tempMax; 142 | final int pressure; 143 | final int humidity; 144 | final int seaLevel; 145 | final int grndLevel; 146 | 147 | factory MainClass.fromJson(Map json) => MainClass( 148 | temp: (json["temp"] as num).toDouble(), 149 | feelsLike: (json["feels_like"] as num).toDouble(), 150 | tempMin: (json["temp_min"] as num).toDouble(), 151 | tempMax: (json["temp_max"] as num).toDouble(), 152 | pressure: json["pressure"] as int, 153 | humidity: json["humidity"] as int, 154 | seaLevel: json["sea_level"] == null ? null : json["sea_level"] as int, 155 | grndLevel: 156 | json["grnd_level"] == null ? null : json["grnd_level"] as int, 157 | ); 158 | 159 | Map toJson() => { 160 | "temp": temp, 161 | "feels_like": feelsLike, 162 | "temp_min": tempMin, 163 | "temp_max": tempMax, 164 | "pressure": pressure, 165 | "humidity": humidity, 166 | "sea_level": seaLevel == null ? null : seaLevel, 167 | "grnd_level": grndLevel == null ? null : grndLevel, 168 | }; 169 | } 170 | 171 | class Weather { 172 | Weather({ 173 | this.id, 174 | this.main, 175 | this.description, 176 | this.icon, 177 | }); 178 | 179 | final int id; 180 | final String main; 181 | final String description; 182 | final String icon; 183 | 184 | factory Weather.fromJson(Map json) => Weather( 185 | id: json["id"] as int, 186 | main: json["main"] as String, 187 | description: json["description"] as String, 188 | icon: json["icon"] as String, 189 | ); 190 | 191 | Map toJson() => { 192 | "id": id, 193 | "main": main, 194 | "description": description, 195 | "icon": icon, 196 | }; 197 | } 198 | 199 | class Wind { 200 | Wind({ 201 | this.speed, 202 | this.deg, 203 | }); 204 | 205 | final double speed; 206 | final int deg; 207 | 208 | factory Wind.fromJson(Map json) => Wind( 209 | speed: json["speed"] as double, 210 | deg: json["deg"] as int, 211 | ); 212 | 213 | Map toJson() => { 214 | "speed": speed, 215 | "deg": deg, 216 | }; 217 | } 218 | -------------------------------------------------------------------------------- /example/lib/listview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'main.dart'; 4 | import 'weather_viewmodel.dart'; 5 | 6 | class WeatherListView extends StatelessWidget { 7 | WeatherListView(); 8 | @override 9 | Widget build(BuildContext context) { 10 | // Streambuilder rebuilds its subtree on every item the stream issues 11 | return StreamBuilder>( 12 | //We access our ViewModel through the inherited Widget 13 | stream: TheViewModel.of(context).updateWeatherCommand, 14 | builder: 15 | (BuildContext context, AsyncSnapshot> snapshot) { 16 | // only if we get data 17 | if (snapshot.hasData && snapshot.data.isNotEmpty) { 18 | return ListView.builder( 19 | itemCount: snapshot.data.length, 20 | itemBuilder: (BuildContext context, int index) => ListTile( 21 | title: Text(snapshot.data[index].cityName), 22 | subtitle: Text(snapshot.data[index].description), 23 | leading: Image.network( 24 | snapshot.data[index].iconURL, 25 | frameBuilder: (BuildContext context, Widget child, int frame, 26 | bool wasSynchronouslyLoaded) { 27 | return child; 28 | }, 29 | loadingBuilder: (BuildContext context, Widget child, 30 | ImageChunkEvent loadingProgress) { 31 | if (loadingProgress == null) return child; 32 | return CircularProgressIndicator(); 33 | }, 34 | errorBuilder: (context, error, stackTrace) => Icon( 35 | Icons.error, 36 | size: 40, 37 | ), 38 | ), 39 | trailing: Column( 40 | mainAxisAlignment: MainAxisAlignment.center, 41 | children: [ 42 | Text('${snapshot.data[index].temperature}°C'), 43 | Text('${snapshot.data[index].wind}km/h'), 44 | ], 45 | ), 46 | ), 47 | ); 48 | } else { 49 | return Text("No items"); 50 | } 51 | }, 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | import 'homepage.dart'; 5 | import 'weather_viewmodel.dart'; 6 | 7 | void main() => runApp(MyApp()); 8 | 9 | class MyApp extends StatefulWidget { 10 | // This widget is the root of your application. 11 | 12 | @override 13 | MyAppState createState() { 14 | return MyAppState(); 15 | } 16 | } 17 | 18 | class MyAppState extends State { 19 | WeatherViewModel viewModelData; 20 | 21 | @override 22 | void initState() { 23 | viewModelData = WeatherViewModel(); 24 | super.initState(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | // Place the Inherited Widget at the very base of the Widget tree 30 | return TheViewModel( 31 | theModel: viewModelData, 32 | child: MaterialApp(title: 'Flutter Demo', home: HomePage()), 33 | ); 34 | } 35 | } 36 | 37 | // InheritedWidgets allow you to propagate values down the widgettree. 38 | // it can then be accessed by just writing TheViewModel.of(context) 39 | class TheViewModel extends InheritedWidget { 40 | final WeatherViewModel theModel; 41 | 42 | const TheViewModel({Key key, @required this.theModel, @required Widget child}) 43 | : assert(theModel != null), 44 | assert(child != null), 45 | super(key: key, child: child); 46 | 47 | static WeatherViewModel of(BuildContext context) => 48 | context.dependOnInheritedWidgetOfExactType().theModel; 49 | 50 | @override 51 | bool updateShouldNotify(TheViewModel oldWidget) => 52 | theModel != oldWidget.theModel; 53 | } 54 | -------------------------------------------------------------------------------- /example/lib/weather_viewmodel.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'package:rxdart/rxdart.dart'; 4 | import 'package:rx_command/rx_command.dart'; 5 | 6 | import 'package:http/http.dart' as http; 7 | 8 | import 'json/weather_in_cities.dart'; 9 | 10 | class WeatherViewModel { 11 | RxCommand> updateWeatherCommand; 12 | RxCommand switchChangedCommand; 13 | RxCommand textChangedCommand; 14 | 15 | WeatherViewModel() { 16 | // Command expects a bool value when executed and issues the value on it's result Stream (stream) 17 | switchChangedCommand = RxCommand.createSync((b) => b); 18 | 19 | // We pass the result of switchChangedCommand as canExecute Stream to the upDateWeatherCommand 20 | updateWeatherCommand = RxCommand.createAsync>( 21 | update, 22 | canExecute: switchChangedCommand, 23 | emitsLastValueToNewSubscriptions: true, 24 | ); 25 | 26 | // Will be called on every change of the searchfield 27 | textChangedCommand = RxCommand.createSync((s) => s); 28 | 29 | // handler for results 30 | // make sure we start processing only if the user make a short pause typing 31 | textChangedCommand.debounceTime(Duration(milliseconds: 500)).listen( 32 | (filterText) { 33 | // I could omit he execute because RxCommand is a callable 34 | // class but here it makes the intention clearer 35 | updateWeatherCommand.execute(filterText); 36 | }, 37 | ); 38 | 39 | updateWeatherCommand.thrownExceptions.listen((ex) => print(ex.toString())); 40 | 41 | // Update data on startup 42 | updateWeatherCommand.execute(); 43 | } 44 | 45 | // Async function that queries the REST API and converts the result into the form our ListViewBuilder can consume 46 | Future> update(String filtertext) { 47 | const url = 48 | "http://api.openweathermap.org/data/2.5/box/city?bbox=12,32,15,37,10&appid=27ac337102cc4931c24ba0b50aca6bbd"; 49 | 50 | var httpStream = http.get(url).asStream(); 51 | 52 | return httpStream 53 | .where( 54 | (data) => data.statusCode == 200) // only continue if valid response 55 | .map( 56 | (data) { 57 | // convert JSON result into a List of WeatherEntries 58 | return WeatherInCities.fromJson( 59 | json.decode(data.body) as Map) 60 | .cities // we are only interested in the Cities part of the response 61 | .where((weatherInCity) => 62 | filtertext == null || 63 | filtertext 64 | .isEmpty || // if filtertext is null or empty we return all returned entries 65 | weatherInCity.name.toUpperCase().startsWith(filtertext 66 | .toUpperCase())) // otherwise only matching entries 67 | .map((weatherInCity) => WeatherEntry( 68 | weatherInCity)) // Convert City object to WeatherEntry 69 | .toList(); // aggregate entries to a List 70 | }, 71 | ).first; // Return result as Future 72 | } 73 | } 74 | 75 | class WeatherEntry { 76 | String cityName; 77 | String iconURL; 78 | double wind; 79 | double rain; 80 | double temperature; 81 | String description; 82 | 83 | WeatherEntry(City city) { 84 | this.cityName = city.name; 85 | this.iconURL = city.weather != null 86 | ? "http://openweathermap.org/img/w/${city.weather[0].icon}.png" 87 | : null; 88 | this.description = 89 | city.weather != null ? city.weather[0].description : null; 90 | this.wind = city.wind.speed; 91 | this.rain = rain; 92 | this.temperature = city.main.temp; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | characters: 5 | dependency: transitive 6 | description: 7 | name: characters 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.1.0" 11 | charcode: 12 | dependency: transitive 13 | description: 14 | name: charcode 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.1.3" 18 | collection: 19 | dependency: transitive 20 | description: 21 | name: collection 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.15.0" 25 | flutter: 26 | dependency: "direct main" 27 | description: flutter 28 | source: sdk 29 | version: "0.0.0" 30 | http: 31 | dependency: "direct main" 32 | description: 33 | name: http 34 | url: "https://pub.dartlang.org" 35 | source: hosted 36 | version: "0.12.1" 37 | http_parser: 38 | dependency: transitive 39 | description: 40 | name: http_parser 41 | url: "https://pub.dartlang.org" 42 | source: hosted 43 | version: "3.1.4" 44 | matcher: 45 | dependency: transitive 46 | description: 47 | name: matcher 48 | url: "https://pub.dartlang.org" 49 | source: hosted 50 | version: "0.12.9" 51 | meta: 52 | dependency: transitive 53 | description: 54 | name: meta 55 | url: "https://pub.dartlang.org" 56 | source: hosted 57 | version: "1.3.0" 58 | path: 59 | dependency: transitive 60 | description: 61 | name: path 62 | url: "https://pub.dartlang.org" 63 | source: hosted 64 | version: "1.7.0" 65 | pedantic: 66 | dependency: transitive 67 | description: 68 | name: pedantic 69 | url: "https://pub.dartlang.org" 70 | source: hosted 71 | version: "1.9.0" 72 | quiver: 73 | dependency: transitive 74 | description: 75 | name: quiver 76 | url: "https://pub.dartlang.org" 77 | source: hosted 78 | version: "2.1.5" 79 | rx_command: 80 | dependency: "direct main" 81 | description: 82 | path: ".." 83 | relative: true 84 | source: path 85 | version: "5.3.0" 86 | rxdart: 87 | dependency: "direct main" 88 | description: 89 | name: rxdart 90 | url: "https://pub.dartlang.org" 91 | source: hosted 92 | version: "0.25.0" 93 | sky_engine: 94 | dependency: transitive 95 | description: flutter 96 | source: sdk 97 | version: "0.0.99" 98 | source_span: 99 | dependency: transitive 100 | description: 101 | name: source_span 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.7.0" 105 | stack_trace: 106 | dependency: transitive 107 | description: 108 | name: stack_trace 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.9.6" 112 | string_scanner: 113 | dependency: transitive 114 | description: 115 | name: string_scanner 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.0.5" 119 | term_glyph: 120 | dependency: transitive 121 | description: 122 | name: term_glyph 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "1.1.0" 126 | typed_data: 127 | dependency: transitive 128 | description: 129 | name: typed_data 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "1.3.0" 133 | vector_math: 134 | dependency: transitive 135 | description: 136 | name: vector_math 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.1.0" 140 | sdks: 141 | dart: ">=2.12.0-0 <3.0.0" 142 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_weather_demo 2 | description: A new Flutter project. 3 | version: 1.0.0+1 4 | environment: 5 | sdk: '>=2.6.0 <3.0.0' 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | http: any 11 | rxdart: ^0.25.0 12 | rx_command: 13 | path: ../ 14 | 15 | flutter: 16 | uses-material-design: true 17 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GeneratedPluginRegistrant_h 6 | #define GeneratedPluginRegistrant_h 7 | 8 | #import 9 | 10 | @interface GeneratedPluginRegistrant : NSObject 11 | + (void)registerWithRegistry:(NSObject*)registry; 12 | @end 13 | 14 | #endif /* GeneratedPluginRegistrant_h */ 15 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #import "GeneratedPluginRegistrant.h" 6 | 7 | @implementation GeneratedPluginRegistrant 8 | 9 | + (void)registerWithRegistry:(NSObject*)registry { 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /lib/rx_command_listener.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:rx_command/rx_command.dart'; 4 | 5 | class RxCommandListener { 6 | StreamSubscription valueSubscription; 7 | StreamSubscription resultsSubscription; 8 | StreamSubscription busyChangeSubscription; 9 | StreamSubscription busySubscription; 10 | StreamSubscription errorSubscription; 11 | StreamSubscription canExecuteStateSubscription; 12 | 13 | final RxCommand command; 14 | 15 | // Is called on every emitted value of the command 16 | final void Function(TResult value) onValue; 17 | // Is called when isExecuting changes 18 | final void Function(bool isBusy) onIsBusyChange; 19 | // Is called on exceptions in the wrapped command function 20 | final void Function(dynamic ex) onError; 21 | // Is called when canExecute changes 22 | final void Function(bool state) onCanExecuteChange; 23 | // is called with the value of the .results Stream of the command 24 | final void Function(CommandResult result) onResult; 25 | 26 | // to make the handling of busy states even easier these are called on their respective states 27 | final void Function() onIsBusy; 28 | final void Function() onNotBusy; 29 | 30 | // optional you can directly pass in a debounce duration for the values of the command 31 | final Duration debounceDuration; 32 | 33 | RxCommandListener( 34 | this.command, { 35 | this.onValue, 36 | this.onIsBusyChange, 37 | this.onIsBusy, 38 | this.onNotBusy, 39 | this.onError, 40 | this.onCanExecuteChange, 41 | this.onResult, 42 | this.debounceDuration, 43 | }) { 44 | if (debounceDuration == null) { 45 | if (onValue != null) { 46 | valueSubscription = command.listen(onValue); 47 | } 48 | 49 | if (onResult != null) { 50 | resultsSubscription = command.results.listen(onResult); 51 | } 52 | 53 | if (onIsBusyChange != null) { 54 | busyChangeSubscription = command.isExecuting.listen(onIsBusyChange); 55 | } 56 | if (onIsBusy != null || onNotBusy != null) { 57 | busySubscription = command.isExecuting.listen((isBusy) { 58 | return isBusy ? this.onIsBusy?.call() : this.onNotBusy?.call(); 59 | }); 60 | } 61 | } else { 62 | if (onValue != null) { 63 | valueSubscription = 64 | command.debounceTime(debounceDuration).listen(onValue); 65 | if (onResult != null && debounceDuration != null) { 66 | resultsSubscription = 67 | command.results.debounceTime(debounceDuration).listen(onResult); 68 | } 69 | 70 | if (onIsBusyChange != null) { 71 | busyChangeSubscription = command.isExecuting 72 | .debounceTime(debounceDuration) 73 | .listen(onIsBusyChange); 74 | } 75 | 76 | if (onIsBusy != null || onNotBusy != null) { 77 | busySubscription = command.isExecuting 78 | .debounceTime(debounceDuration) 79 | .listen((isBusy) => 80 | isBusy ? this.onIsBusy?.call() : this.onNotBusy?.call()); 81 | } 82 | } 83 | } 84 | if (onError != null) { 85 | errorSubscription = command.thrownExceptions.listen(onError); 86 | } 87 | 88 | if (onCanExecuteChange != null) { 89 | canExecuteStateSubscription = 90 | command.canExecute.listen(onCanExecuteChange); 91 | } 92 | } 93 | 94 | void dispose() { 95 | busyChangeSubscription?.cancel(); 96 | valueSubscription?.cancel(); 97 | resultsSubscription?.cancel(); 98 | busySubscription?.cancel(); 99 | errorSubscription?.cancel(); 100 | canExecuteStateSubscription?.cancel(); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /makedoc.bat: -------------------------------------------------------------------------------- 1 | dartdoc --exclude 'dart:async,dart:collection,dart:convert,dart:core,dart:developer,dart:ffi,dart:html,dart:io,dart:isolate,dart:js,dart:js_util,dart:math,dart:typed_data,dart:ui' -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: rx_command 2 | description: Reactive event handler wrapper class inspired by ReactiveUI. 3 | version: 5.3.0 4 | maintainer: Thomas Burkhart (@escamoteur) 5 | authors: 6 | - Flutter Community 7 | - Thomas Burkhart 8 | homepage: https://github.com/fluttercommunity/rx_command 9 | documentation: 10 | environment: 11 | sdk: '>=2.6.1 <3.0.0' 12 | 13 | dependencies: 14 | rxdart: ^0.25.0 15 | quiver: ^2.0.0 16 | 17 | 18 | dev_dependencies: 19 | test: any 20 | 21 | --------------------------------------------------------------------------------