Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created June 22, 2021 12:44
Show Gist options
  • Save enginebai/c64bb75e45dd2247e2d8fd76db2e98c1 to your computer and use it in GitHub Desktop.
Save enginebai/c64bb75e45dd2247e2d8fd76db2e98c1 to your computer and use it in GitHub Desktop.
class Question extends StatelessWidget {
final String questionText;
Question(this.questionText); // 1. normal constructor
Question({this.questionText}); // 2. normal constuctor with named argument
Question.text(this.questionText); // 3. named constructor
Question.create({this.questionText}); // 4. named constructor with named argument
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment