Last active
April 13, 2022 18:59
-
-
Save azaslavsky/2c6389b24899d5464f51a7fc5600bf85 to your computer and use it in GitHub Desktop.
Const constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:typed_data'; | |
const BAR = Foo( | |
a: true, | |
b: 1234, | |
c: C( | |
$unknownData: null, | |
d: "abcd", | |
)); | |
void main() { | |
print ("a: ${BAR.a}"); | |
print ("b: ${BAR.b}"); | |
print ("c.d: ${BAR.c.d}"); | |
} | |
// Everything below is existing fildgen output. | |
class Foo { | |
const Foo({ | |
required this.a, | |
required this.b, | |
required this.c, | |
}); | |
final bool a; | |
final int b; | |
final C c; | |
} | |
class C { | |
const C({ | |
this.$unknownData, | |
this.d, | |
}); | |
@override | |
final Map<int, UnknownRawData>? $unknownData; | |
final String? d; | |
} | |
class UnknownRawData { | |
UnknownRawData(this.data, this.handles); | |
Uint8List data; | |
List<int> handles; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment