Primeiro commit no ramo main
This commit is contained in:
44
lib/componentes/buttom_custom.dart
Normal file
44
lib/componentes/buttom_custom.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../utils/dimensoes.dart';
|
||||
|
||||
class ButtonCustom extends StatelessWidget{
|
||||
final VoidCallback onPressed;
|
||||
final String text;
|
||||
final double fontsize;
|
||||
final Color colorButton;
|
||||
final Color colorText;
|
||||
final Color colorBorder;
|
||||
final widthCustom;
|
||||
final heightCustom;
|
||||
|
||||
ButtonCustom({
|
||||
required this.onPressed,
|
||||
required this.text,
|
||||
required this.fontsize,
|
||||
required this.colorButton,
|
||||
required this.colorText,
|
||||
required this.colorBorder,
|
||||
this.widthCustom = 1.0,
|
||||
this.heightCustom = 1.0
|
||||
});
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: colorButton,
|
||||
minimumSize: Size(Dimensoes.width*widthCustom! , Dimensoes.height*heightCustom!),
|
||||
side: BorderSide(width: 2,color : colorBorder,),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: Text(text,
|
||||
style: TextStyle(
|
||||
color: colorText,
|
||||
fontSize: fontsize,
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
) ,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
104
lib/componentes/drawer_custom.dart
Normal file
104
lib/componentes/drawer_custom.dart
Normal file
@@ -0,0 +1,104 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
import 'package:rkm_educa_prof_app/componentes/text_custom.dart';
|
||||
import '../servicos/shared_preferences/shared.dart';
|
||||
import '../telas/tela_login.dart';
|
||||
import '../utils/dimensoes.dart';
|
||||
import 'item_drawer.dart';
|
||||
|
||||
class DrawerCustom extends StatelessWidget {
|
||||
|
||||
String usuario;
|
||||
|
||||
DrawerCustom({
|
||||
required this.usuario
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
width: Dimensoes.width*0.8,
|
||||
height: Dimensoes.height,
|
||||
color: Colors.white,
|
||||
child: ListView(
|
||||
children: [
|
||||
// CircleAvatar(
|
||||
// radius: 70,
|
||||
// backgroundColor: Colors.grey[300],
|
||||
// child:estudanteModelo.foto==''?Container():
|
||||
// ClipRRect(
|
||||
// child: Image.asset(estudanteModelo.foto),
|
||||
// borderRadius:BorderRadius.circular(70),
|
||||
// )
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0,horizontal: 40),
|
||||
child: TextCustom(text: usuario.split(" ").first,fontWeight: FontWeight.bold,size: 16.0,textAlign: TextAlign.start),
|
||||
),
|
||||
Container(
|
||||
height: Dimensoes.height*0.5,
|
||||
child: ListView(
|
||||
children: [
|
||||
ItemDrawer(
|
||||
icone: LineIcons.home,
|
||||
texto: 'HOME',
|
||||
onPressed: (){},
|
||||
// onPressed: ()=> Navigator.pushReplacement(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) => TelaSituacaoEscolar(alunos: alunos,indiceAluno: indiceFilhos)),
|
||||
// ),
|
||||
),
|
||||
Container(height: 1,color: Colors.grey,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.clipboardList,
|
||||
texto: 'LANÇAMENTO DE NOTAS',
|
||||
onPressed: (){},
|
||||
// onPressed: ()=> Navigator.pushReplacement(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) => TelaPerfil(alunos: alunos,indiceAluno: indiceFilhos)),
|
||||
// ),
|
||||
),
|
||||
Container(height: 1,color: Colors.grey,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.checkSquareAlt,
|
||||
texto: 'LANÇAMENTO DE FALTAS/PRESENÇAS',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: Colors.grey,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.calendar,
|
||||
texto: 'CALENDÁRIO ESCOLAR',
|
||||
onPressed: (){},
|
||||
// onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaChamada(alunos: alunos,indiceAluno: indiceFilhos))),
|
||||
),
|
||||
Container(height: 1,color: Colors.grey,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: Dimensoes.height*0.3,),
|
||||
SafeArea(
|
||||
child: Container(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: IconButton(
|
||||
icon: Icon(LineIcons.alternateSignOut,size: 30),
|
||||
onPressed: (){
|
||||
final PrefService _prefService = PrefService();
|
||||
_prefService.removeCacheLogin().then((value){
|
||||
Navigator.pushAndRemoveUntil(
|
||||
context, MaterialPageRoute(
|
||||
builder: (context) => TelaLogin()
|
||||
),
|
||||
(Route<dynamic> route) => false
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
57
lib/componentes/dropdown_button_city.dart
Normal file
57
lib/componentes/dropdown_button_city.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_prof_app/componentes/text_custom.dart';
|
||||
import 'package:rkm_educa_prof_app/utils/cidades_db.dart';
|
||||
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class DropDownButtonCity extends StatelessWidget {
|
||||
var onChanged;
|
||||
String? select;
|
||||
bool validator;
|
||||
String error;
|
||||
|
||||
DropDownButtonCity({
|
||||
required this.onChanged,
|
||||
required this.select,
|
||||
required this.error,
|
||||
required this.validator
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width,
|
||||
margin: EdgeInsets.symmetric(vertical: 5),
|
||||
padding: EdgeInsets.symmetric(vertical: 5),
|
||||
color:PaletaCores.cinzaInput,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
hint: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: TextCustom(text: 'Cidade',size: 15.0),
|
||||
),
|
||||
value: select,
|
||||
items: Cidades().listCidades.map((value) => DropdownMenuItem(
|
||||
value: value.cidadeFront,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: TextCustom(
|
||||
text: value.cidadeFront,
|
||||
color: Colors.black54,
|
||||
),
|
||||
),
|
||||
)
|
||||
).toList(),
|
||||
onChanged:onChanged
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
84
lib/componentes/input_text.dart
Normal file
84
lib/componentes/input_text.dart
Normal file
@@ -0,0 +1,84 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../utils/cores.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 = PaletaCores.cinza,
|
||||
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:PaletaCores.cinzaInput,
|
||||
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,
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
29
lib/componentes/item_drawer.dart
Normal file
29
lib/componentes/item_drawer.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_prof_app/componentes/text_custom.dart';
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class ItemDrawer extends StatelessWidget {
|
||||
IconData icone;
|
||||
String texto;
|
||||
var onPressed;
|
||||
|
||||
ItemDrawer({
|
||||
required this.texto,
|
||||
required this.icone,
|
||||
required this.onPressed
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: width*0.07),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: TextButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: Icon(icone,color: PaletaCores.cinza,),
|
||||
label: TextCustom(text: texto,size: 12.0,)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/componentes/snackBars.dart
Normal file
20
lib/componentes/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);
|
||||
}
|
||||
39
lib/componentes/text_custom.dart
Normal file
39
lib/componentes/text_custom.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class TextCustom extends StatelessWidget {
|
||||
final text;
|
||||
final size;
|
||||
final color;
|
||||
final fontWeight;
|
||||
final textAlign;
|
||||
final maxLines;
|
||||
|
||||
TextCustom({
|
||||
required this.text,
|
||||
this.size = 16.0,
|
||||
this.color = PaletaCores.cinza,
|
||||
this.fontWeight = FontWeight.normal,
|
||||
this.textAlign = TextAlign.start,
|
||||
this.maxLines = 1,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: textAlign,
|
||||
style: TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: color,
|
||||
fontSize: size,
|
||||
fontWeight: fontWeight,
|
||||
decorationThickness: 4,
|
||||
fontFamily: 'Nunito',
|
||||
decoration: TextDecoration.none
|
||||
),
|
||||
maxLines: maxLines,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user