inserido icone android, logo,ajustada a tela home e login
This commit is contained in:
@@ -1,29 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
|
||||
import '../utils/const_variable.dart';
|
||||
class ButtonDefault extends StatelessWidget {
|
||||
var onPressed;
|
||||
String title;
|
||||
Color background;
|
||||
Color textColor;
|
||||
Color borderColor;
|
||||
double width;
|
||||
double height;
|
||||
|
||||
ButtonDefault({
|
||||
required this.onPressed,
|
||||
required this.title,
|
||||
this.background = ColorPalette.primary,
|
||||
this.textColor = ColorPalette.white
|
||||
this.background = Colors.transparent,
|
||||
this.textColor = ColorPalette.border,
|
||||
this.borderColor = ColorPalette.border,
|
||||
this.width = 100,
|
||||
this.height = 50,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextButton(
|
||||
onPressed: onPressed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: background,
|
||||
foregroundColor: textColor,
|
||||
),
|
||||
child: Text(
|
||||
title
|
||||
)
|
||||
return Container(
|
||||
margin: ConstVariable().marginHightInput,
|
||||
width: width,
|
||||
height: height,
|
||||
child: TextButton(
|
||||
onPressed: onPressed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: background,
|
||||
foregroundColor: textColor,
|
||||
side: BorderSide(width: 3,color: borderColor),
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: ConstVariable().fontSizeInput
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
65
lib/widgets/dropdown_button_city.dart
Normal file
65
lib/widgets/dropdown_button_city.dart
Normal file
@@ -0,0 +1,65 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
import '../utils/color_palette.dart';
|
||||
import '../utils/const_variable.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*0.6,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
padding: ConstVariable().paddingWidth,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(ConstVariable().radiusBorderInput),
|
||||
border: Border.all(
|
||||
color: validator?ColorPalette.white:ColorPalette.red
|
||||
),
|
||||
color: ColorPalette.white
|
||||
),
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String>(
|
||||
hint: TextDefault(text: 'Cidade',fontSize: ConstVariable().fontSizeInput),
|
||||
value: select,
|
||||
items: ConstVariable().itensCity.map((value) => DropdownMenuItem(
|
||||
value: value,
|
||||
child: TextDefault(
|
||||
text: value,
|
||||
),
|
||||
)
|
||||
).toList(),
|
||||
onChanged:onChanged
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
child: TextDefault(
|
||||
text: validator?'':error,
|
||||
color: ColorPalette.red,
|
||||
fontSize: 12
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/widgets/icon_button_default.dart
Normal file
20
lib/widgets/icon_button_default.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
|
||||
class IconButtonDefault extends StatelessWidget {
|
||||
var onPressed;
|
||||
IconData icon;
|
||||
|
||||
IconButtonDefault({
|
||||
required this.icon,
|
||||
required this.onPressed,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
onPressed: onPressed,
|
||||
icon: Icon(icon,color: ColorPalette.black54,size: 30,)
|
||||
);
|
||||
}
|
||||
}
|
||||
43
lib/widgets/input_search_text.dart
Normal file
43
lib/widgets/input_search_text.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import '../utils/const_variable.dart';
|
||||
|
||||
class InputSearchText extends StatelessWidget {
|
||||
var controller;
|
||||
double fontSize;
|
||||
String hint;
|
||||
double width;
|
||||
|
||||
InputSearchText({
|
||||
required this.controller,
|
||||
required this.width,
|
||||
this.fontSize = 15.0,
|
||||
this.hint = '',
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: ColorPalette.white,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
width: width,
|
||||
child: TextFormField(
|
||||
controller: this.controller,
|
||||
style: TextStyle(
|
||||
color: ColorPalette.gray,
|
||||
fontSize: this.fontSize,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
fillColor: ColorPalette.appBar,
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: OutlineInputBorder(),
|
||||
hintText: this.hint,
|
||||
hintStyle: TextStyle(
|
||||
color: ColorPalette.gray,
|
||||
fontSize: this.fontSize,
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import '../utils/const_variable.dart';
|
||||
|
||||
class InputText extends StatelessWidget {
|
||||
bool obscure;
|
||||
@@ -7,36 +8,45 @@ class InputText extends StatelessWidget {
|
||||
double fontSize;
|
||||
String hint;
|
||||
double width;
|
||||
String label;
|
||||
String error;
|
||||
|
||||
InputText({
|
||||
required this.controller,
|
||||
required this.width,
|
||||
this.obscure = false,
|
||||
this.fontSize = 20.0,
|
||||
this.fontSize = 15.0,
|
||||
this.hint = '',
|
||||
this.label = '',
|
||||
this.error = '',
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: ColorPalette.border
|
||||
),
|
||||
color: ColorPalette.white,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
width: width,
|
||||
child: TextFormField(
|
||||
validator: (value) {
|
||||
if (value!=null && value!.length==0) {
|
||||
return error;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: this.obscure,
|
||||
controller: this.controller,
|
||||
style: TextStyle(
|
||||
color: ColorPalette.white,
|
||||
color: ColorPalette.gray,
|
||||
fontSize: this.fontSize,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
fillColor: ColorPalette.appBar,
|
||||
labelText: label,
|
||||
border: OutlineInputBorder(),
|
||||
hintText: this.hint,
|
||||
hintStyle: TextStyle(
|
||||
color: ColorPalette.white,
|
||||
color: ColorPalette.gray,
|
||||
fontSize: this.fontSize,
|
||||
)
|
||||
)
|
||||
|
||||
40
lib/widgets/item_citizen.dart
Normal file
40
lib/widgets/item_citizen.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/utils/const_variable.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
class ItemCitizen extends StatelessWidget {
|
||||
|
||||
String name;
|
||||
String date;
|
||||
String mother;
|
||||
String numberCNS;
|
||||
String numberMedicalRecord;
|
||||
var onTap;
|
||||
|
||||
ItemCitizen({
|
||||
required this.name,
|
||||
required this.date,
|
||||
required this.mother,
|
||||
required this.numberCNS,
|
||||
required this.numberMedicalRecord,
|
||||
required this.onTap
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: ConstVariable().marginHightInput,
|
||||
child: Card(
|
||||
margin: ConstVariable().marginHightInput,
|
||||
color: ColorPalette.white,
|
||||
child: ListTile(
|
||||
title: TextDefault(text: name,fontWeigth: FontWeight.bold),
|
||||
subtitle: TextDefault(text: '$numberCNS - $numberMedicalRecord - $date - $mother',fontSize: 16),
|
||||
trailing: Icon(Icons.assignment_outlined),
|
||||
onTap: onTap,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,13 @@ class TextDefault extends StatelessWidget {
|
||||
String text;
|
||||
double fontSize;
|
||||
Color color;
|
||||
FontWeight fontWeigth;
|
||||
|
||||
TextDefault({
|
||||
required this.text,
|
||||
required this.text,
|
||||
this.fontSize = 20.0,
|
||||
this.color = ColorPalette.border
|
||||
this.color = ColorPalette.gray,
|
||||
this.fontWeigth = FontWeight.normal
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -19,7 +21,8 @@ class TextDefault extends StatelessWidget {
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: fontSize,
|
||||
color: color
|
||||
fontWeight: fontWeigth,
|
||||
color: color,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user