Is there a way to return several values in a function return statement (other than returning an object) like we can do in Go (or some other languages)?
For example,
Create a class:
import 'dart:core'; class Tuple { final T1 item1; final T2 item2; Tuple({ this.item1, this.item2, }); factory Tuple.fromJson(Map json) { return Tuple( item1: json['item1'], item2: json['item2'], ); } }
Call it however you want!
Tuple(i1, i2); or Tuple.fromJson(jsonData);