criado os widgets dropdown_button_default.dart, subtitle_containers.dart, alert_dialog_default.dart e title_containers.dart.
e ajustada a tela main_procedures_screen.dart
This commit is contained in:
43
lib/widgets/alert_dialog_default.dart
Normal file
43
lib/widgets/alert_dialog_default.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/utils/const_variable.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
import 'package:rkm/widgets/item_alert_settings.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
import 'dropdown_button_default.dart';
|
||||
import 'input_search_text.dart';
|
||||
class AlertDialogDefault {
|
||||
|
||||
@override
|
||||
alert(BuildContext context,controller,Widget list,) {
|
||||
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: InputSearchText(
|
||||
controller: controller,
|
||||
width: width*0.3,
|
||||
hint: 'Buscar...',
|
||||
color: ColorPalette.titleContainer,
|
||||
border: false,
|
||||
),
|
||||
content: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
width: width*0.8,
|
||||
child: Container(
|
||||
width: width*0.8,
|
||||
height: height*0.8,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: list,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,10 @@ class AlertDialogSettings {
|
||||
icon: Icons.delete
|
||||
),
|
||||
ItemAlertSettings(
|
||||
onTap: ()=>Navigator.pushNamed(context, '/main_procedures'),
|
||||
onTap: (){
|
||||
Navigator.pop(context);
|
||||
Navigator.pushNamed(context, '/main_procedures');
|
||||
},
|
||||
title: 'Definir Procedimentos Iniciais',
|
||||
body: 'Define os Procedimentos iniciais que deverão ser\n'
|
||||
'incluídos nas fichas de atendimentos\n',
|
||||
|
||||
@@ -6,6 +6,7 @@ class ButtonDefault extends StatelessWidget {
|
||||
var onPressed;
|
||||
String title;
|
||||
Color background;
|
||||
Color disableColor;
|
||||
Color textColor;
|
||||
Color borderColor;
|
||||
double width;
|
||||
@@ -17,6 +18,7 @@ class ButtonDefault extends StatelessWidget {
|
||||
this.background = Colors.transparent,
|
||||
this.textColor = ColorPalette.border,
|
||||
this.borderColor = ColorPalette.border,
|
||||
this.disableColor = ColorPalette.border,
|
||||
this.width = 100,
|
||||
this.height = 50,
|
||||
});
|
||||
@@ -31,6 +33,7 @@ class ButtonDefault extends StatelessWidget {
|
||||
onPressed: onPressed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: background,
|
||||
disabledBackgroundColor: disableColor,
|
||||
foregroundColor: textColor,
|
||||
side: BorderSide(width: 3,color: borderColor),
|
||||
),
|
||||
|
||||
50
lib/widgets/dropdown_button_default.dart
Normal file
50
lib/widgets/dropdown_button_default.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
import '../utils/color_palette.dart';
|
||||
import '../utils/const_variable.dart';
|
||||
|
||||
class DropDownButtonDefault extends StatelessWidget {
|
||||
var onChanged;
|
||||
String? select;
|
||||
String title;
|
||||
List<String> list;
|
||||
double width;
|
||||
|
||||
DropDownButtonDefault({
|
||||
required this.onChanged,
|
||||
required this.select,
|
||||
required this.title,
|
||||
required this.list,
|
||||
required this.width
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
color: ColorPalette.white,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String>(
|
||||
hint: TextDefault(text: title,fontSize: ConstVariable().fontSizeInput,textAlign: TextAlign.end),
|
||||
value: select,
|
||||
items: list.map((value) => DropdownMenuItem(
|
||||
value: value,
|
||||
child: TextDefault(
|
||||
text: value,
|
||||
fontSize: 15,
|
||||
),
|
||||
)
|
||||
).toList(),
|
||||
onChanged:onChanged
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,18 +7,22 @@ class InputSearchText extends StatelessWidget {
|
||||
double fontSize;
|
||||
String hint;
|
||||
double width;
|
||||
Color color;
|
||||
bool border;
|
||||
|
||||
InputSearchText({
|
||||
required this.controller,
|
||||
required this.width,
|
||||
this.fontSize = 15.0,
|
||||
this.hint = '',
|
||||
this.color = ColorPalette.white,
|
||||
this.border = true
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: ColorPalette.white,
|
||||
color: color,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
width: width,
|
||||
child: TextFormField(
|
||||
@@ -30,7 +34,7 @@ class InputSearchText extends StatelessWidget {
|
||||
decoration: InputDecoration(
|
||||
fillColor: ColorPalette.appBar,
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: OutlineInputBorder(),
|
||||
border: border?OutlineInputBorder():null,
|
||||
hintText: this.hint,
|
||||
hintStyle: TextStyle(
|
||||
color: ColorPalette.gray,
|
||||
|
||||
29
lib/widgets/subtitle_containers.dart
Normal file
29
lib/widgets/subtitle_containers.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
class SubtitleContainers extends StatelessWidget {
|
||||
String title;
|
||||
double width;
|
||||
|
||||
SubtitleContainers({
|
||||
required this.title,
|
||||
this.width = double.infinity
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
width: width,
|
||||
color: ColorPalette.white,
|
||||
child: TextDefault(text: title,color: ColorPalette.black54),
|
||||
),
|
||||
Divider(color: Colors.black54,endIndent: 10,indent: 10,)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,15 @@ class TextDefault extends StatelessWidget {
|
||||
Color color;
|
||||
FontWeight fontWeigth;
|
||||
TextAlign textAlign;
|
||||
int maxLines;
|
||||
|
||||
TextDefault({
|
||||
required this.text,
|
||||
this.fontSize = 20.0,
|
||||
this.color = ColorPalette.gray,
|
||||
this.fontWeigth = FontWeight.normal,
|
||||
this.textAlign = TextAlign.start
|
||||
this.textAlign = TextAlign.start,
|
||||
this.maxLines = 1
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -22,10 +24,12 @@ class TextDefault extends StatelessWidget {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: textAlign,
|
||||
maxLines: maxLines,
|
||||
style: TextStyle(
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeigth,
|
||||
color: color,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
22
lib/widgets/title_containers.dart
Normal file
22
lib/widgets/title_containers.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
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 TitleContainers extends StatelessWidget {
|
||||
String title;
|
||||
|
||||
TitleContainers({
|
||||
required this.title
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: ConstVariable().marginHightInput,
|
||||
width: double.infinity,
|
||||
color: ColorPalette.titleContainer,
|
||||
child: TextDefault(text: title,fontWeigth: FontWeight.bold,textAlign: TextAlign.center,color: ColorPalette.black54,),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user