Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CristhianLara1996/5747ccc7013227c3056e10d89bc4c8ca to your computer and use it in GitHub Desktop.
Save CristhianLara1996/5747ccc7013227c3056e10d89bc4c8ca to your computer and use it in GitHub Desktop.
Input Generics
class InputPhone extends StatelessWidget {
/// Creates a phone input widget.
const InputPhone(
this.label, {
Key? key,
...
}) : super(key: key);
final String label;
@override
Widget build(BuildContext context) {
return Row(
children: [
Icon(Icons.flag),
_InputGeneric(
key: key,
label: label,
...
)
],
);
}
}
class InputXl extends StatelessWidget {
/// Creates a xl input widget.
const InputXl(
this.label, {
Key? key,
...
}) : super(key: key);
final String label;
@override
Widget build(BuildContext context) {
return _InputGeneric(
key: key,
label: label,
...
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment