Skip to content

Instantly share code, notes, and snippets.

@josue1dario2
Created December 14, 2022 01:08
Show Gist options
  • Save josue1dario2/785702744c61e472a0fb9a8da5dfb045 to your computer and use it in GitHub Desktop.
Save josue1dario2/785702744c61e472a0fb9a8da5dfb045 to your computer and use it in GitHub Desktop.
FormScreen Flutter
class FormScreen extends StatelessWidget {
const FormScreen({super.key});
@override
Widget build(BuildContext context) {
final double widthScreem = MediaQuery.of(context).size.width;
final double heightScreem = MediaQuery.of(context).size.height;
return Scaffold(
body: Center(
child: SizedBox(
height: heightScreem * .1,
width: widthScreem,
child: Row(
children: [
_textField(context),
const ValidatorButton(navigator: Validator())
],
),
)),
);
}
}
Widget _textField(context) {
final double widthScreem = MediaQuery.of(context).size.width;
return Padding(
padding: const EdgeInsets.only(left: 20),
child: SizedBox(
width: widthScreem * .78,
child: const TextField(
autofocus: true,
//controller: codeController,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
decoration: InputDecoration(
//hintText: textFieldValue.getTextFieldGame,
hintStyle: TextStyle(fontSize: 20.0, color: Colors.black38),
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color.fromRGBO(21, 21, 21, 1), width: 1.0),
),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color.fromRGBO(21, 21, 21, 1), width: 2.0),
),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment