Skip to content

Tiled's infinite mode will report an error #3932

@zhou26192619

Description

@zhou26192619

What happened?

Image

mapComponent = await TiledComponent.load('map.tmx', Vector2(32.0, 32.0));
I just need to change the tiled mode to infinite, and there will be an error:


The following TypeErrorImpl was thrown building FutureBuilder<void>(dirty, state: _FutureBuilderState<void>#b0632):
Unexpected null value.

The relevant error-causing widget was: 
 FutureBuilder<void> FutureBuilder:file:///C:/Users/46089/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/flame-1.37.0/lib/src/game/game_widget/game_widget.dart:418:30
When the exception was thrown, this was the stack: 
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 274:3             throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 950:18        nullCheck
package:flame_tiled/src/renderable_layers/tile_layers/orthogonal_tile_layer.dart 26:36  cacheTiles
package:flame_tiled/src/renderable_layers/tile_layers/tile_layer.dart 189:5             refreshCache
package:flame_tiled/src/renderable_tile_map.dart 474:12                                 [_refreshCache]
package:flame_tiled/src/renderable_tile_map.dart 69:5                                   new
package:flame_tiled/src/renderable_tile_map.dart 403:5                                  <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 618:19                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 643:23                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 589:19                     <fn>
dart-sdk/lib/async/zone.dart 962:54                                                     runUnary
dart-sdk/lib/async/future_impl.dart 222:18                                              handleValue
dart-sdk/lib/async/future_impl.dart 948:44                                              handleValueCallback
dart-sdk/lib/async/future_impl.dart 977:13                                              _propagateToListeners
dart-sdk/lib/async/future_impl.dart 720:5                                               [_completeWithValue]
dart-sdk/lib/async/future.dart 554:22                                                   <fn>
dart-sdk/lib/async/zone.dart 962:54                                                     runUnary
dart-sdk/lib/async/future_impl.dart 222:18                                              handleValue
dart-sdk/lib/async/future_impl.dart 948:44                                              handleValueCallback
dart-sdk/lib/async/future_impl.dart 977:13                                              _propagateToListeners
dart-sdk/lib/async/future_impl.dart 720:5                                               [_completeWithValue]
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 499:7                      complete
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 566:12                     _asyncReturn
package:flame_tiled/src/renderable_tile_map.dart 458:7                                  <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 618:19                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 643:23                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 589:19                     <fn>
dart-sdk/lib/async/zone.dart 962:54                                                     runUnary
dart-sdk/lib/async/future_impl.dart 222:18                                              handleValue
dart-sdk/lib/async/future_impl.dart 948:44                                              handleValueCallback
dart-sdk/lib/async/future_impl.dart 977:13                                              _propagateToListeners
dart-sdk/lib/async/future_impl.dart 720:5                                               [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 804:7                                               <fn>
dart-sdk/lib/async/schedule_microtask.dart 40:34                                        _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                                         _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77        tear
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 183:69                     <fn> ```

### What do you expect?

Capable of loading tiled infinite modes correctly

### How can we reproduce this?

_No response_

### What steps should take to fix this?

_No response_

### Do have an example of where the bug occurs?

_No response_

### Relevant log output

```shell

Execute in a terminal and put output into the code block below

Output of: flutter doctor -v

Affected platforms

All

Other information

No response

Are you interested in working on a PR for this?

  • I want to work on this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions