Skip to content

Instantly share code, notes, and snippets.

@epatel
Created March 22, 2024 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epatel/61f88601a41c7af9aa8e48140d83e54f to your computer and use it in GitHub Desktop.
Save epatel/61f88601a41c7af9aa8e48140d83e54f to your computer and use it in GitHub Desktop.
Null after future
class Test {
final String text;
Test({
required this.text,
});
Future<void> hello() async {
await Future.delayed(Duration(seconds: 2));
print(text);
}
}
void main() {
Test? test = Test(text: 'Hello!!!');
print('Start');
test.hello();
test = null;
print('End');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment