Skip to content

Crash when using http functions and the iOS Simulator #8542

@lukef

Description

@lukef

Device: iOS Simulator

Sorry there isn't any log or error message here as nothing is being emitted from Flutter.

I am getting a weird crash when using a RefreshIndicator attached to a get http action. The crash doesn't occur until I tap on a TabBar that has a listener attached to it. I'm not sure if that is relevant but its the only thing that will cause a crash.

The following is the refresh indicator code.

Please let me know what other information I can provide.

	Future<Null> _handleRefresh() {
		Completer<Null> completer = new Completer<Null>();
		get("http://api.myapp.com/endpoint").then((response) {
				print("loaded data");
				return response.body;
			})
			.then((jsonString) { 
                                print(jsonString) 
                         })
			.then((_) => completer.complete());
		return completer.future;
	}

	@override
	Widget build(BuildContext context) {
		return new Padding(
			padding: EdgeInsets.zero,
			child: new RefreshIndicator(
				onRefresh: _handleRefresh,
				child: new ListView(
					children: _cells,
				),
			)
		);
	}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions