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