73 lines
2.1 KiB
Dart
73 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:ui_kit/ui_kit.dart';
|
|
|
|
class SelectWidget extends StatefulWidget {
|
|
const SelectWidget({
|
|
super.key,
|
|
this.selectedValue = '',
|
|
this.image,
|
|
required this.hintText,
|
|
});
|
|
final String selectedValue;
|
|
final String? image;
|
|
final String hintText;
|
|
|
|
@override
|
|
State<SelectWidget> createState() => _SelectWidgetState();
|
|
}
|
|
|
|
class _SelectWidgetState extends State<SelectWidget> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: () {
|
|
showBottomSheetFunc(Column(), context);
|
|
},
|
|
child: Container(
|
|
height: 48,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(10),
|
|
color: inputBgColor,
|
|
border: Border.all(color: inputStrokeColor, width: 1),
|
|
),
|
|
padding: EdgeInsets.symmetric(horizontal: 14, vertical: 14),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Expanded(
|
|
child: Row(
|
|
children: [
|
|
widget.image != null
|
|
? Row(
|
|
children: [
|
|
Image.asset(
|
|
widget.image ?? '',
|
|
width: 24,
|
|
height: 24,
|
|
),
|
|
SizedBox(width: 12),
|
|
],
|
|
)
|
|
: SizedBox(),
|
|
Text(
|
|
widget.selectedValue == ''
|
|
? widget.hintText
|
|
: widget.selectedValue,
|
|
style: headlineRegular.copyWith(
|
|
color: widget.selectedValue != ''
|
|
? blackColor
|
|
: captionColor,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SvgPicture.asset('assets/chevron-down.svg'),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|