no para inclusão dos paises
This commit is contained in:
65
lib/widgets/dropdown_button_cidadao.dart
Normal file
65
lib/widgets/dropdown_button_cidadao.dart
Normal file
@@ -0,0 +1,65 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/models/equipe_cidadao.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../config/color_palette.dart';
|
||||
import '../config/const_variable.dart';
|
||||
|
||||
class DropDownButtonCidadao extends StatelessWidget {
|
||||
var onChanged;
|
||||
EquipeCidadao? select;
|
||||
String title;
|
||||
double fontSize;
|
||||
List<EquipeCidadao> list;
|
||||
double width;
|
||||
double widthContainer;
|
||||
|
||||
DropDownButtonCidadao({
|
||||
required this.onChanged,
|
||||
required this.select,
|
||||
required this.title,
|
||||
required this.list,
|
||||
required this.width,
|
||||
this.fontSize = 15,
|
||||
this.widthContainer = 300
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width*0.95,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
color: ColorPalette.white,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
hint: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
||||
child: TextDefault(text: title,fontSize: ConstVariable().fontSizeInput,textAlign: TextAlign.end,color: Colors.black,),
|
||||
),
|
||||
value: select,
|
||||
items: list.map((value) => DropdownMenuItem<EquipeCidadao>(
|
||||
value: value,
|
||||
child: Container(
|
||||
width: widthContainer,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 0.0),
|
||||
child: TextDefault(
|
||||
text: value.DESCRICAO,
|
||||
maxLines: 2,
|
||||
fontSize: fontSize,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
).toList(),
|
||||
onChanged:onChanged
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
81
lib/widgets/dropdown_with_subtitle_cidadao.dart
Normal file
81
lib/widgets/dropdown_with_subtitle_cidadao.dart
Normal file
@@ -0,0 +1,81 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/models/equipe_cidadao.dart';
|
||||
import 'package:rkm/widgets/dropdown_button_cidadao.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../config/color_palette.dart';
|
||||
import 'dropdown_button_default.dart';
|
||||
|
||||
class DropdownWithSubtitleCidadao extends StatelessWidget {
|
||||
String subtitle;
|
||||
String hintDropdown;
|
||||
EquipeCidadao? select;
|
||||
double widthSubtitle;
|
||||
double widthDropdown;
|
||||
double widthContainerDropdown;
|
||||
List<EquipeCidadao> list;
|
||||
var onChanged;
|
||||
var onTapDelete;
|
||||
bool showDelete;
|
||||
Color colorBorder;
|
||||
|
||||
DropdownWithSubtitleCidadao({
|
||||
required this.subtitle,
|
||||
required this.select,
|
||||
required this.widthDropdown,
|
||||
required this.widthContainerDropdown,
|
||||
required this.widthSubtitle,
|
||||
required this.hintDropdown,
|
||||
required this.onChanged,
|
||||
required this.list,
|
||||
this.colorBorder = ColorPalette.white,
|
||||
this.onTapDelete = null,
|
||||
this.showDelete = false
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: widthDropdown,
|
||||
child: TextDefault(
|
||||
textAlign: TextAlign.start,
|
||||
text: subtitle,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(color: colorBorder)
|
||||
),
|
||||
margin: EdgeInsets.symmetric(horizontal: 5),
|
||||
padding: EdgeInsets.symmetric(horizontal: 2),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
DropDownButtonCidadao(
|
||||
title: hintDropdown,
|
||||
fontSize: 14,
|
||||
width: widthDropdown,
|
||||
widthContainer: widthContainerDropdown,
|
||||
select: select,
|
||||
list: list,
|
||||
onChanged: onChanged,
|
||||
),
|
||||
select!=null &&showDelete?GestureDetector(
|
||||
onTap: onTapDelete,
|
||||
child: Icon(Icons.delete,color: ColorPalette.appBar,)
|
||||
):Container(width: 23,)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../controllers/format_txt.dart';
|
||||
|
||||
class InputText extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user