import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:notube/constants.dart'; import 'package:notube/dlForm/cubit/dl_form_cubit.dart'; const List formatList = [ "MP3", "MP3 HD", "MP4", "MP4 HD", "MP4 2K", "3GP", "FLV", "M4A", ]; class DropdownFormat extends StatelessWidget { const DropdownFormat({super.key}); @override Widget build(BuildContext context) { final dlFormState = context.select((DlFormCubit cubit) => cubit.state); return Container( padding: EdgeInsets.symmetric( horizontal: 15, ), decoration: BoxDecoration(color: colorMainBlue), // dropdown below.. child: DropdownButton( value: dlFormState.format, elevation: 16, style: const TextStyle(color: colorMainWhite), dropdownColor: colorMainBlue, onChanged: (String? value) { context.read().setFormat(value!); }, underline: Container(), items: formatList.map>((String value) { return DropdownMenuItem( value: value, child: Text(value), ); }).toList(), )); } }