Created
March 22, 2020 19:15
-
-
Save guilhermelirio/f50905461c33988bdb54e7347a5eb763 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class Input extends StatelessWidget { | |
var label = ""; | |
var nomeVariavel; | |
var formkey; | |
Input( | |
{@required this.label, | |
@required this.nomeVariavel, | |
@required this.formkey}); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
padding: EdgeInsets.only(top: 10.0, left: 20, right: 20, bottom: 5), | |
child: Container( | |
child: Center( | |
child: Column(children: [ | |
TextFormField( | |
decoration: InputDecoration( | |
labelText: label, | |
//labelStyle: TextStyle(color: Color.fromRGBO(252, 180, 47, 0.8)), | |
border: OutlineInputBorder( | |
borderRadius: BorderRadius.circular(25.0), | |
borderSide: BorderSide(), | |
), | |
//fillColor: Colors.green | |
), | |
validator: (val) { | |
if (val.isEmpty) { | |
return "Os campos não podem ficar em branco!"; | |
} else { | |
return null; | |
} | |
}, | |
onSaved: (String val) { | |
nomeVariavel = val; | |
}, | |
keyboardType: TextInputType.text, | |
style: TextStyle( | |
//color: Color.fromRGBO(252, 180, 47, 1), | |
color: Colors.white, | |
fontFamily: "Poppins", | |
), | |
), | |
]), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment