-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-device-info-plus-2
- Loading branch information
Showing
176 changed files
with
5,185 additions
and
849 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This represents an invalid audio file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/audioplayers/example/lib/components/drop_down.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class LabeledDropDown<T> extends StatelessWidget { | ||
final String label; | ||
final Map<T, String> options; | ||
final T selected; | ||
final void Function(T?) onChange; | ||
|
||
const LabeledDropDown({ | ||
required this.label, | ||
required this.options, | ||
required this.selected, | ||
required this.onChange, | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: Text(label), | ||
trailing: CustomDropDown<T>( | ||
options: options, | ||
selected: selected, | ||
onChange: onChange, | ||
), | ||
); | ||
} | ||
} | ||
|
||
class CustomDropDown<T> extends StatelessWidget { | ||
final Map<T, String> options; | ||
final T selected; | ||
final void Function(T?) onChange; | ||
final bool isExpanded; | ||
|
||
const CustomDropDown({ | ||
required this.options, | ||
required this.selected, | ||
required this.onChange, | ||
this.isExpanded = false, | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return DropdownButton<T>( | ||
isExpanded: isExpanded, | ||
value: selected, | ||
onChanged: onChange, | ||
items: options.entries | ||
.map<DropdownMenuItem<T>>( | ||
(entry) => DropdownMenuItem<T>( | ||
value: entry.key, | ||
child: Text(entry.value), | ||
), | ||
) | ||
.toList(), | ||
); | ||
} | ||
} |
Oops, something went wrong.