inserida a fonte, e criada a tela de login_screen.dart
This commit is contained in:
45
lib/widgets/buttom_custom.dart
Normal file
45
lib/widgets/buttom_custom.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ButtonCustom extends StatelessWidget{
|
||||
final VoidCallback onPressed;
|
||||
final String text;
|
||||
final double size;
|
||||
final Color colorButton;
|
||||
final Color colorText;
|
||||
final Color colorBorder;
|
||||
final widthCustom;
|
||||
final heightCustom;
|
||||
|
||||
ButtonCustom({
|
||||
required this.onPressed,
|
||||
required this.text,
|
||||
required this.size,
|
||||
required this.colorButton,
|
||||
required this.colorText,
|
||||
required this.colorBorder,
|
||||
this.widthCustom = 1.0,
|
||||
this.heightCustom = 1.0
|
||||
});
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
double width =MediaQuery.of(context).size.width;
|
||||
double height =MediaQuery.of(context).size.height;
|
||||
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: colorButton,
|
||||
minimumSize: Size(width*widthCustom! , height*heightCustom!),
|
||||
side: BorderSide(width: 2,color : colorBorder,),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: Text(text,
|
||||
style: TextStyle(
|
||||
color: colorText,
|
||||
fontSize: size,
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
) ,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
84
lib/widgets/input_text.dart
Normal file
84
lib/widgets/input_text.dart
Normal file
@@ -0,0 +1,84 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../utils/colors.dart';
|
||||
|
||||
class InputText extends StatelessWidget {
|
||||
bool obscure;
|
||||
var controller;
|
||||
double fontSize;
|
||||
String title;
|
||||
double width;
|
||||
TextInputType textInputType;
|
||||
int maxLines;
|
||||
Color colorBorder;
|
||||
var onChanged;
|
||||
bool enable;
|
||||
List<TextInputFormatter> inputFormatters;
|
||||
|
||||
InputText({
|
||||
required this.controller,
|
||||
required this.width,
|
||||
this.obscure = false,
|
||||
this.fontSize = 15.0,
|
||||
this.title = '',
|
||||
this.textInputType = TextInputType.text,
|
||||
this.maxLines = 1,
|
||||
this.colorBorder = PaletteColors.grey,
|
||||
this.onChanged = null,
|
||||
this.enable = true,
|
||||
required this.inputFormatters
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width,
|
||||
child: Text(title,style: TextStyle(fontWeight: FontWeight.bold,fontFamily: 'Nunito'),)
|
||||
),
|
||||
Container(
|
||||
color:PaletteColors.greyInput,
|
||||
width: width,
|
||||
margin: EdgeInsets.only(bottom: 5),
|
||||
child: TextFormField(
|
||||
inputFormatters: inputFormatters,
|
||||
keyboardType: textInputType,
|
||||
maxLines: maxLines,
|
||||
onChanged: onChanged,
|
||||
obscureText: this.obscure,
|
||||
controller: this.controller,
|
||||
enabled: enable,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: this.fontSize,
|
||||
fontFamily: 'Nunito'
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(width: 1,color: colorBorder)
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(width: 1, color: colorBorder),
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(width: 1, color: colorBorder),
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(width: 1, color: colorBorder),
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: this.fontSize,
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/widgets/snackBars.dart
Normal file
20
lib/widgets/snackBars.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void showSnackBar(BuildContext context, String text,Color colors){
|
||||
|
||||
final snackbar = SnackBar(
|
||||
backgroundColor: colors,
|
||||
content: Row(
|
||||
children: [
|
||||
Icon(Icons.info_outline,color: Colors.white),
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: Text(text,
|
||||
style: TextStyle(fontSize: 16),),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackbar);
|
||||
}
|
||||
Reference in New Issue
Block a user