Skip to content

Instantly share code, notes, and snippets.

@aunpyz
Created September 7, 2022 10:55
Show Gist options
  • Save aunpyz/979a0070196e9808d5fbccab1bc7fa18 to your computer and use it in GitHub Desktop.
Save aunpyz/979a0070196e9808d5fbccab1bc7fa18 to your computer and use it in GitHub Desktop.
//from
//class Person {
// final String name;
// final int age;
//
// Person({
// required this.name,
// required this.age,
// })
//}
//to
@freezed
class Person {
const factory Person({
required String name,
required int age,
}) = _Person;
}
#!/bin/sh
cd /path/to/flutter/project
cd lib/
flutter pub run build_runner build --delete-conflicting-outputs
# edit code to L:13-19
flutter pub run build_runner build --delete-conflicting-outputs
# see the terminal, put something there in dart file
flutter pub run build_runner build --delete-conflicting-outputs
# copy-paste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment