flame-engine / flame-engine/flame

Tiled's infinite mode will report an error

Open
#3,932 3 comments 1 reaction 1 assignee Claimed by @ufrshubham View on GitHub
enhancement
Dominant language
Dart
Stars
10.8k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
21

Description

### 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:

``` ======== Exception caught by widgets library =======================================================

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

The relevant error-causing widget was:
FutureBuilder 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
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 618:19
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 643:23
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 589:19
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
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
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 618:19
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 643:23
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 589:19
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
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 ```

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.