import 'package:flutter/material.dart';
import 'package:sendtrain/helpers/widget_helpers.dart';

class FormDropDown extends StatelessWidget {
  const FormDropDown(
      {super.key,
      required this.title,
      required this.entries,
      required this.controller});

  final List<DropdownMenuEntry> entries;
  final String title;
  final TextEditingController controller;

  @override
  Widget build(BuildContext context) {
    return formItemWrapper(
        DropdownMenu(
            leadingIcon: Icon(Icons.select_all_rounded),
            initialSelection: controller.text,
            controller: controller,
            expandedInsets: EdgeInsets.zero,
            inputDecorationTheme: InputDecorationTheme(
                filled: true,
                border: OutlineInputBorder(
                    borderSide: BorderSide.none,
                    borderRadius: BorderRadius.circular(12))),
            label: Text(title),
            dropdownMenuEntries: entries),
        EdgeInsets.fromLTRB(10, 5, 10, 5));
  }
}
