sign up feature first version done
This commit is contained in:
@@ -3,7 +3,9 @@ import 'package:flutter/material.dart';
|
||||
class CustomDropdown extends StatelessWidget {
|
||||
final List<Widget> items;
|
||||
final List<dynamic>? values;
|
||||
|
||||
final ValueChanged<dynamic> onChanged;
|
||||
|
||||
final dynamic value;
|
||||
final String? hint;
|
||||
final String? label;
|
||||
@@ -28,10 +30,15 @@ class CustomDropdown extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final borderColor = color ?? const Color(0xFF4B4B4B);
|
||||
|
||||
OutlineInputBorder border(Color c) => OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(radius)),
|
||||
borderSide: BorderSide(color: c),
|
||||
);
|
||||
return Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
if (label != null)
|
||||
if (label != null) ...[
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
@@ -39,6 +46,8 @@ class CustomDropdown extends StatelessWidget {
|
||||
style: const TextStyle(fontSize: 14, letterSpacing: 0),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
@@ -46,15 +55,21 @@ class CustomDropdown extends StatelessWidget {
|
||||
child: DropdownButtonFormField<dynamic>(
|
||||
dropdownColor: Colors.white,
|
||||
decoration: InputDecoration(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(radius)),
|
||||
borderSide: BorderSide(
|
||||
color: color ?? const Color(0xFF4B4B4B),
|
||||
),
|
||||
enabledBorder: border(borderColor),
|
||||
focusedBorder: border(borderColor),
|
||||
disabledBorder: border(borderColor),
|
||||
errorBorder: border(borderColor),
|
||||
focusedErrorBorder: border(borderColor),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 16,
|
||||
),
|
||||
),
|
||||
|
||||
initialValue: value,
|
||||
|
||||
onChanged: onChanged,
|
||||
|
||||
hint: hint != null ? Text(hint!) : null,
|
||||
items: List<DropdownMenuItem<dynamic>>.generate(items.length, (
|
||||
int index,
|
||||
|
||||
Reference in New Issue
Block a user