65 lines
1.7 KiB
Dart
65 lines
1.7 KiB
Dart
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;
|
|
double fontSize;
|
|
List list;
|
|
double width;
|
|
double widthContainer;
|
|
|
|
DropDownButtonDefault({
|
|
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,
|
|
margin: ConstVariable().marginHightInput,
|
|
color: ColorPalette.white,
|
|
child: DropdownButtonHideUnderline(
|
|
child: DropdownButton(
|
|
hint: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
|
child: TextDefault(text: title,fontSize: ConstVariable().fontSizeInput,textAlign: TextAlign.end),
|
|
),
|
|
value: select,
|
|
items: list.map((value) => DropdownMenuItem(
|
|
value: value,
|
|
child: Container(
|
|
width: widthContainer,
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
|
child: TextDefault(
|
|
text: value,
|
|
fontSize: fontSize,
|
|
color: Colors.black,
|
|
),
|
|
),
|
|
),
|
|
)
|
|
).toList(),
|
|
onChanged:onChanged
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|