Showing
4 changed files
with
123 additions
and
38 deletions
| @@ -7,42 +7,42 @@ packages: | @@ -7,42 +7,42 @@ packages: | ||
| 7 | name: async | 7 | name: async |
| 8 | url: "https://pub.dartlang.org" | 8 | url: "https://pub.dartlang.org" |
| 9 | source: hosted | 9 | source: hosted |
| 10 | - version: "2.5.0-nullsafety" | 10 | + version: "2.4.2" |
| 11 | boolean_selector: | 11 | boolean_selector: |
| 12 | dependency: transitive | 12 | dependency: transitive |
| 13 | description: | 13 | description: |
| 14 | name: boolean_selector | 14 | name: boolean_selector |
| 15 | url: "https://pub.dartlang.org" | 15 | url: "https://pub.dartlang.org" |
| 16 | source: hosted | 16 | source: hosted |
| 17 | - version: "2.1.0-nullsafety" | 17 | + version: "2.0.0" |
| 18 | characters: | 18 | characters: |
| 19 | dependency: transitive | 19 | dependency: transitive |
| 20 | description: | 20 | description: |
| 21 | name: characters | 21 | name: characters |
| 22 | url: "https://pub.dartlang.org" | 22 | url: "https://pub.dartlang.org" |
| 23 | source: hosted | 23 | source: hosted |
| 24 | - version: "1.1.0-nullsafety.2" | 24 | + version: "1.0.0" |
| 25 | charcode: | 25 | charcode: |
| 26 | dependency: transitive | 26 | dependency: transitive |
| 27 | description: | 27 | description: |
| 28 | name: charcode | 28 | name: charcode |
| 29 | url: "https://pub.dartlang.org" | 29 | url: "https://pub.dartlang.org" |
| 30 | source: hosted | 30 | source: hosted |
| 31 | - version: "1.2.0-nullsafety" | 31 | + version: "1.1.3" |
| 32 | clock: | 32 | clock: |
| 33 | dependency: transitive | 33 | dependency: transitive |
| 34 | description: | 34 | description: |
| 35 | name: clock | 35 | name: clock |
| 36 | url: "https://pub.dartlang.org" | 36 | url: "https://pub.dartlang.org" |
| 37 | source: hosted | 37 | source: hosted |
| 38 | - version: "1.1.0-nullsafety" | 38 | + version: "1.0.1" |
| 39 | collection: | 39 | collection: |
| 40 | dependency: transitive | 40 | dependency: transitive |
| 41 | description: | 41 | description: |
| 42 | name: collection | 42 | name: collection |
| 43 | url: "https://pub.dartlang.org" | 43 | url: "https://pub.dartlang.org" |
| 44 | source: hosted | 44 | source: hosted |
| 45 | - version: "1.15.0-nullsafety.2" | 45 | + version: "1.14.13" |
| 46 | dio: | 46 | dio: |
| 47 | dependency: "direct main" | 47 | dependency: "direct main" |
| 48 | description: | 48 | description: |
| @@ -56,7 +56,7 @@ packages: | @@ -56,7 +56,7 @@ packages: | ||
| 56 | name: fake_async | 56 | name: fake_async |
| 57 | url: "https://pub.dartlang.org" | 57 | url: "https://pub.dartlang.org" |
| 58 | source: hosted | 58 | source: hosted |
| 59 | - version: "1.1.0-nullsafety" | 59 | + version: "1.1.0" |
| 60 | flutter: | 60 | flutter: |
| 61 | dependency: "direct main" | 61 | dependency: "direct main" |
| 62 | description: flutter | 62 | description: flutter |
| @@ -87,21 +87,21 @@ packages: | @@ -87,21 +87,21 @@ packages: | ||
| 87 | name: matcher | 87 | name: matcher |
| 88 | url: "https://pub.dartlang.org" | 88 | url: "https://pub.dartlang.org" |
| 89 | source: hosted | 89 | source: hosted |
| 90 | - version: "0.12.10-nullsafety" | 90 | + version: "0.12.8" |
| 91 | meta: | 91 | meta: |
| 92 | dependency: transitive | 92 | dependency: transitive |
| 93 | description: | 93 | description: |
| 94 | name: meta | 94 | name: meta |
| 95 | url: "https://pub.dartlang.org" | 95 | url: "https://pub.dartlang.org" |
| 96 | source: hosted | 96 | source: hosted |
| 97 | - version: "1.3.0-nullsafety.2" | 97 | + version: "1.1.8" |
| 98 | path: | 98 | path: |
| 99 | dependency: transitive | 99 | dependency: transitive |
| 100 | description: | 100 | description: |
| 101 | name: path | 101 | name: path |
| 102 | url: "https://pub.dartlang.org" | 102 | url: "https://pub.dartlang.org" |
| 103 | source: hosted | 103 | source: hosted |
| 104 | - version: "1.8.0-nullsafety" | 104 | + version: "1.7.0" |
| 105 | sky_engine: | 105 | sky_engine: |
| 106 | dependency: transitive | 106 | dependency: transitive |
| 107 | description: flutter | 107 | description: flutter |
| @@ -113,55 +113,55 @@ packages: | @@ -113,55 +113,55 @@ packages: | ||
| 113 | name: source_span | 113 | name: source_span |
| 114 | url: "https://pub.dartlang.org" | 114 | url: "https://pub.dartlang.org" |
| 115 | source: hosted | 115 | source: hosted |
| 116 | - version: "1.8.0-nullsafety" | 116 | + version: "1.7.0" |
| 117 | stack_trace: | 117 | stack_trace: |
| 118 | dependency: transitive | 118 | dependency: transitive |
| 119 | description: | 119 | description: |
| 120 | name: stack_trace | 120 | name: stack_trace |
| 121 | url: "https://pub.dartlang.org" | 121 | url: "https://pub.dartlang.org" |
| 122 | source: hosted | 122 | source: hosted |
| 123 | - version: "1.10.0-nullsafety" | 123 | + version: "1.9.5" |
| 124 | stream_channel: | 124 | stream_channel: |
| 125 | dependency: transitive | 125 | dependency: transitive |
| 126 | description: | 126 | description: |
| 127 | name: stream_channel | 127 | name: stream_channel |
| 128 | url: "https://pub.dartlang.org" | 128 | url: "https://pub.dartlang.org" |
| 129 | source: hosted | 129 | source: hosted |
| 130 | - version: "2.1.0-nullsafety" | 130 | + version: "2.0.0" |
| 131 | string_scanner: | 131 | string_scanner: |
| 132 | dependency: transitive | 132 | dependency: transitive |
| 133 | description: | 133 | description: |
| 134 | name: string_scanner | 134 | name: string_scanner |
| 135 | url: "https://pub.dartlang.org" | 135 | url: "https://pub.dartlang.org" |
| 136 | source: hosted | 136 | source: hosted |
| 137 | - version: "1.1.0-nullsafety" | 137 | + version: "1.0.5" |
| 138 | term_glyph: | 138 | term_glyph: |
| 139 | dependency: transitive | 139 | dependency: transitive |
| 140 | description: | 140 | description: |
| 141 | name: term_glyph | 141 | name: term_glyph |
| 142 | url: "https://pub.dartlang.org" | 142 | url: "https://pub.dartlang.org" |
| 143 | source: hosted | 143 | source: hosted |
| 144 | - version: "1.2.0-nullsafety" | 144 | + version: "1.1.0" |
| 145 | test_api: | 145 | test_api: |
| 146 | dependency: transitive | 146 | dependency: transitive |
| 147 | description: | 147 | description: |
| 148 | name: test_api | 148 | name: test_api |
| 149 | url: "https://pub.dartlang.org" | 149 | url: "https://pub.dartlang.org" |
| 150 | source: hosted | 150 | source: hosted |
| 151 | - version: "0.2.19-nullsafety" | 151 | + version: "0.2.17" |
| 152 | typed_data: | 152 | typed_data: |
| 153 | dependency: transitive | 153 | dependency: transitive |
| 154 | description: | 154 | description: |
| 155 | name: typed_data | 155 | name: typed_data |
| 156 | url: "https://pub.dartlang.org" | 156 | url: "https://pub.dartlang.org" |
| 157 | source: hosted | 157 | source: hosted |
| 158 | - version: "1.3.0-nullsafety.2" | 158 | + version: "1.2.0" |
| 159 | vector_math: | 159 | vector_math: |
| 160 | dependency: transitive | 160 | dependency: transitive |
| 161 | description: | 161 | description: |
| 162 | name: vector_math | 162 | name: vector_math |
| 163 | url: "https://pub.dartlang.org" | 163 | url: "https://pub.dartlang.org" |
| 164 | source: hosted | 164 | source: hosted |
| 165 | - version: "2.1.0-nullsafety.2" | 165 | + version: "2.0.8" |
| 166 | sdks: | 166 | sdks: |
| 167 | - dart: ">=2.10.0-0.0.dev <2.10.0" | 167 | + dart: ">=2.9.0-14.0.dev <3.0.0" |
| @@ -173,6 +173,91 @@ class _GetModalBottomSheetState<T> extends State<_GetModalBottomSheet<T>> { | @@ -173,6 +173,91 @@ class _GetModalBottomSheetState<T> extends State<_GetModalBottomSheet<T>> { | ||
| 173 | } | 173 | } |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | +class _GetPerModalBottomSheet<T> extends StatefulWidget { | ||
| 177 | + const _GetPerModalBottomSheet({ | ||
| 178 | + Key key, | ||
| 179 | + this.route, | ||
| 180 | + this.backgroundColor, | ||
| 181 | + this.elevation, | ||
| 182 | + this.shape, | ||
| 183 | + this.clipBehavior, | ||
| 184 | + this.isScrollControlled = false, | ||
| 185 | + this.enableDrag = true, | ||
| 186 | + }) : assert(isScrollControlled != null), | ||
| 187 | + assert(enableDrag != null), | ||
| 188 | + super(key: key); | ||
| 189 | + | ||
| 190 | + final GetModalBottomSheetRoute<T> route; | ||
| 191 | + final bool isScrollControlled; | ||
| 192 | + final Color backgroundColor; | ||
| 193 | + final double elevation; | ||
| 194 | + final ShapeBorder shape; | ||
| 195 | + final Clip clipBehavior; | ||
| 196 | + final bool enableDrag; | ||
| 197 | + | ||
| 198 | + @override | ||
| 199 | + // ignore: lines_longer_than_80_chars | ||
| 200 | + _GetPerModalBottomSheetState<T> createState() => | ||
| 201 | + _GetPerModalBottomSheetState<T>(); | ||
| 202 | +} | ||
| 203 | + | ||
| 204 | +// ignore: lines_longer_than_80_chars | ||
| 205 | +class _GetPerModalBottomSheetState<T> | ||
| 206 | + extends State<_GetPerModalBottomSheet<T>> { | ||
| 207 | + String _getRouteLabel(MaterialLocalizations localizations) { | ||
| 208 | + if ((Theme.of(context).platform == TargetPlatform.android) || | ||
| 209 | + (Theme.of(context).platform == TargetPlatform.fuchsia)) { | ||
| 210 | + return localizations.dialogLabel; | ||
| 211 | + } else { | ||
| 212 | + return ''; | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + @override | ||
| 217 | + Widget build(BuildContext context) { | ||
| 218 | + assert(debugCheckHasMediaQuery(context)); | ||
| 219 | + assert(debugCheckHasMaterialLocalizations(context)); | ||
| 220 | + final mediaQuery = MediaQuery.of(context); | ||
| 221 | + final localizations = MaterialLocalizations.of(context); | ||
| 222 | + final routeLabel = _getRouteLabel(localizations); | ||
| 223 | + | ||
| 224 | + return AnimatedBuilder( | ||
| 225 | + animation: widget.route.animation, | ||
| 226 | + builder: (context, child) { | ||
| 227 | + // Disable the initial animation when accessible navigation is on so | ||
| 228 | + // that the semantics are added to the tree at the correct time. | ||
| 229 | + final animationValue = mediaQuery.accessibleNavigation | ||
| 230 | + ? 1.0 | ||
| 231 | + : widget.route.animation.value; | ||
| 232 | + return Semantics( | ||
| 233 | + scopesRoute: true, | ||
| 234 | + namesRoute: true, | ||
| 235 | + label: routeLabel, | ||
| 236 | + explicitChildNodes: true, | ||
| 237 | + child: ClipRect( | ||
| 238 | + child: CustomSingleChildLayout( | ||
| 239 | + delegate: _GetModalBottomSheetLayout( | ||
| 240 | + animationValue, widget.isScrollControlled), | ||
| 241 | + child: BottomSheet( | ||
| 242 | + animationController: widget.route._animationController, | ||
| 243 | + onClosing: () { | ||
| 244 | + if (widget.route.isCurrent) {} | ||
| 245 | + }, | ||
| 246 | + builder: widget.route.builder, | ||
| 247 | + backgroundColor: widget.backgroundColor, | ||
| 248 | + elevation: widget.elevation, | ||
| 249 | + shape: widget.shape, | ||
| 250 | + clipBehavior: widget.clipBehavior, | ||
| 251 | + enableDrag: widget.enableDrag, | ||
| 252 | + ), | ||
| 253 | + ), | ||
| 254 | + ), | ||
| 255 | + ); | ||
| 256 | + }, | ||
| 257 | + ); | ||
| 258 | + } | ||
| 259 | +} | ||
| 260 | + | ||
| 176 | class _GetModalBottomSheetLayout extends SingleChildLayoutDelegate { | 261 | class _GetModalBottomSheetLayout extends SingleChildLayoutDelegate { |
| 177 | _GetModalBottomSheetLayout(this.progress, this.isScrollControlled); | 262 | _GetModalBottomSheetLayout(this.progress, this.isScrollControlled); |
| 178 | 263 |
| @@ -7,42 +7,42 @@ packages: | @@ -7,42 +7,42 @@ packages: | ||
| 7 | name: async | 7 | name: async |
| 8 | url: "https://pub.dartlang.org" | 8 | url: "https://pub.dartlang.org" |
| 9 | source: hosted | 9 | source: hosted |
| 10 | - version: "2.5.0-nullsafety" | 10 | + version: "2.4.2" |
| 11 | boolean_selector: | 11 | boolean_selector: |
| 12 | dependency: transitive | 12 | dependency: transitive |
| 13 | description: | 13 | description: |
| 14 | name: boolean_selector | 14 | name: boolean_selector |
| 15 | url: "https://pub.dartlang.org" | 15 | url: "https://pub.dartlang.org" |
| 16 | source: hosted | 16 | source: hosted |
| 17 | - version: "2.1.0-nullsafety" | 17 | + version: "2.0.0" |
| 18 | characters: | 18 | characters: |
| 19 | dependency: transitive | 19 | dependency: transitive |
| 20 | description: | 20 | description: |
| 21 | name: characters | 21 | name: characters |
| 22 | url: "https://pub.dartlang.org" | 22 | url: "https://pub.dartlang.org" |
| 23 | source: hosted | 23 | source: hosted |
| 24 | - version: "1.1.0-nullsafety.2" | 24 | + version: "1.0.0" |
| 25 | charcode: | 25 | charcode: |
| 26 | dependency: transitive | 26 | dependency: transitive |
| 27 | description: | 27 | description: |
| 28 | name: charcode | 28 | name: charcode |
| 29 | url: "https://pub.dartlang.org" | 29 | url: "https://pub.dartlang.org" |
| 30 | source: hosted | 30 | source: hosted |
| 31 | - version: "1.2.0-nullsafety" | 31 | + version: "1.1.3" |
| 32 | clock: | 32 | clock: |
| 33 | dependency: transitive | 33 | dependency: transitive |
| 34 | description: | 34 | description: |
| 35 | name: clock | 35 | name: clock |
| 36 | url: "https://pub.dartlang.org" | 36 | url: "https://pub.dartlang.org" |
| 37 | source: hosted | 37 | source: hosted |
| 38 | - version: "1.1.0-nullsafety" | 38 | + version: "1.0.1" |
| 39 | collection: | 39 | collection: |
| 40 | dependency: transitive | 40 | dependency: transitive |
| 41 | description: | 41 | description: |
| 42 | name: collection | 42 | name: collection |
| 43 | url: "https://pub.dartlang.org" | 43 | url: "https://pub.dartlang.org" |
| 44 | source: hosted | 44 | source: hosted |
| 45 | - version: "1.15.0-nullsafety.2" | 45 | + version: "1.14.13" |
| 46 | effective_dart: | 46 | effective_dart: |
| 47 | dependency: "direct dev" | 47 | dependency: "direct dev" |
| 48 | description: | 48 | description: |
| @@ -56,7 +56,7 @@ packages: | @@ -56,7 +56,7 @@ packages: | ||
| 56 | name: fake_async | 56 | name: fake_async |
| 57 | url: "https://pub.dartlang.org" | 57 | url: "https://pub.dartlang.org" |
| 58 | source: hosted | 58 | source: hosted |
| 59 | - version: "1.1.0-nullsafety" | 59 | + version: "1.1.0" |
| 60 | flutter: | 60 | flutter: |
| 61 | dependency: "direct main" | 61 | dependency: "direct main" |
| 62 | description: flutter | 62 | description: flutter |
| @@ -73,21 +73,21 @@ packages: | @@ -73,21 +73,21 @@ packages: | ||
| 73 | name: matcher | 73 | name: matcher |
| 74 | url: "https://pub.dartlang.org" | 74 | url: "https://pub.dartlang.org" |
| 75 | source: hosted | 75 | source: hosted |
| 76 | - version: "0.12.10-nullsafety" | 76 | + version: "0.12.8" |
| 77 | meta: | 77 | meta: |
| 78 | dependency: transitive | 78 | dependency: transitive |
| 79 | description: | 79 | description: |
| 80 | name: meta | 80 | name: meta |
| 81 | url: "https://pub.dartlang.org" | 81 | url: "https://pub.dartlang.org" |
| 82 | source: hosted | 82 | source: hosted |
| 83 | - version: "1.3.0-nullsafety.2" | 83 | + version: "1.1.8" |
| 84 | path: | 84 | path: |
| 85 | dependency: transitive | 85 | dependency: transitive |
| 86 | description: | 86 | description: |
| 87 | name: path | 87 | name: path |
| 88 | url: "https://pub.dartlang.org" | 88 | url: "https://pub.dartlang.org" |
| 89 | source: hosted | 89 | source: hosted |
| 90 | - version: "1.8.0-nullsafety" | 90 | + version: "1.7.0" |
| 91 | sky_engine: | 91 | sky_engine: |
| 92 | dependency: transitive | 92 | dependency: transitive |
| 93 | description: flutter | 93 | description: flutter |
| @@ -99,55 +99,55 @@ packages: | @@ -99,55 +99,55 @@ packages: | ||
| 99 | name: source_span | 99 | name: source_span |
| 100 | url: "https://pub.dartlang.org" | 100 | url: "https://pub.dartlang.org" |
| 101 | source: hosted | 101 | source: hosted |
| 102 | - version: "1.8.0-nullsafety" | 102 | + version: "1.7.0" |
| 103 | stack_trace: | 103 | stack_trace: |
| 104 | dependency: transitive | 104 | dependency: transitive |
| 105 | description: | 105 | description: |
| 106 | name: stack_trace | 106 | name: stack_trace |
| 107 | url: "https://pub.dartlang.org" | 107 | url: "https://pub.dartlang.org" |
| 108 | source: hosted | 108 | source: hosted |
| 109 | - version: "1.10.0-nullsafety" | 109 | + version: "1.9.5" |
| 110 | stream_channel: | 110 | stream_channel: |
| 111 | dependency: transitive | 111 | dependency: transitive |
| 112 | description: | 112 | description: |
| 113 | name: stream_channel | 113 | name: stream_channel |
| 114 | url: "https://pub.dartlang.org" | 114 | url: "https://pub.dartlang.org" |
| 115 | source: hosted | 115 | source: hosted |
| 116 | - version: "2.1.0-nullsafety" | 116 | + version: "2.0.0" |
| 117 | string_scanner: | 117 | string_scanner: |
| 118 | dependency: transitive | 118 | dependency: transitive |
| 119 | description: | 119 | description: |
| 120 | name: string_scanner | 120 | name: string_scanner |
| 121 | url: "https://pub.dartlang.org" | 121 | url: "https://pub.dartlang.org" |
| 122 | source: hosted | 122 | source: hosted |
| 123 | - version: "1.1.0-nullsafety" | 123 | + version: "1.0.5" |
| 124 | term_glyph: | 124 | term_glyph: |
| 125 | dependency: transitive | 125 | dependency: transitive |
| 126 | description: | 126 | description: |
| 127 | name: term_glyph | 127 | name: term_glyph |
| 128 | url: "https://pub.dartlang.org" | 128 | url: "https://pub.dartlang.org" |
| 129 | source: hosted | 129 | source: hosted |
| 130 | - version: "1.2.0-nullsafety" | 130 | + version: "1.1.0" |
| 131 | test_api: | 131 | test_api: |
| 132 | dependency: transitive | 132 | dependency: transitive |
| 133 | description: | 133 | description: |
| 134 | name: test_api | 134 | name: test_api |
| 135 | url: "https://pub.dartlang.org" | 135 | url: "https://pub.dartlang.org" |
| 136 | source: hosted | 136 | source: hosted |
| 137 | - version: "0.2.19-nullsafety" | 137 | + version: "0.2.17" |
| 138 | typed_data: | 138 | typed_data: |
| 139 | dependency: transitive | 139 | dependency: transitive |
| 140 | description: | 140 | description: |
| 141 | name: typed_data | 141 | name: typed_data |
| 142 | url: "https://pub.dartlang.org" | 142 | url: "https://pub.dartlang.org" |
| 143 | source: hosted | 143 | source: hosted |
| 144 | - version: "1.3.0-nullsafety.2" | 144 | + version: "1.2.0" |
| 145 | vector_math: | 145 | vector_math: |
| 146 | dependency: transitive | 146 | dependency: transitive |
| 147 | description: | 147 | description: |
| 148 | name: vector_math | 148 | name: vector_math |
| 149 | url: "https://pub.dartlang.org" | 149 | url: "https://pub.dartlang.org" |
| 150 | source: hosted | 150 | source: hosted |
| 151 | - version: "2.1.0-nullsafety.2" | 151 | + version: "2.0.8" |
| 152 | sdks: | 152 | sdks: |
| 153 | - dart: ">=2.10.0-0.0.dev <2.10.0" | 153 | + dart: ">=2.9.0-14.0.dev <3.0.0" |
-
Please register or login to post a comment