forked from flutter-tizen/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[audioplayers] Update audioplayers (flutter-tizen#596)
- Loading branch information
Showing
29 changed files
with
1,497 additions
and
493 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
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(), | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/audioplayers/example/lib/components/list_tile.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,26 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class WrappedListTile extends StatelessWidget { | ||
final List<Widget> children; | ||
final Widget? leading; | ||
final Widget? trailing; | ||
|
||
const WrappedListTile({ | ||
required this.children, | ||
this.leading, | ||
this.trailing, | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: Wrap( | ||
alignment: WrapAlignment.end, | ||
children: children, | ||
), | ||
leading: leading, | ||
trailing: trailing, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.