Skip to content

Commit

Permalink
use DropdownMenu in feed
Browse files Browse the repository at this point in the history
  • Loading branch information
HarlJo committed Apr 25, 2024
1 parent f501c8d commit bcb03bb
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions lib/home/_feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,25 @@ class _FeedScreenState extends State<FeedScreen>
pinned: false,
snap: true,
floating: true,
title: DropdownButton(
padding: EdgeInsets.only(left: 8),
underline: Container(),
value: _tabValue,
style: Theme.of(context).appBarTheme.titleTextStyle,
onChanged: (value) => setState(() {
if (value == L10n.current.foryou) {
_tab = 1;
} else if (value == L10n.current.following) {
_tab = 0;
}
_tabValue = value;
}),
items: [
DropdownMenuItem(value: L10n.current.following, child: Text(L10n.current.following)),
DropdownMenuItem(value: L10n.current.foryou, child: Text(L10n.current.foryou))
]),
title: Padding(
padding: const EdgeInsets.all(8.0),
child: DropdownMenu(
inputDecorationTheme: InputDecorationTheme(
isDense: true, border: OutlineInputBorder(borderRadius: BorderRadius.circular(12))),
initialSelection: L10n.current.following,
textStyle: Theme.of(context).appBarTheme.titleTextStyle,
onSelected: (value) => setState(() {
if (value == L10n.current.foryou) {
_tab = 1;
} else if (value == L10n.current.following) {
_tab = 0;
}
_tabValue = value;
}),
dropdownMenuEntries: [
DropdownMenuEntry(value: L10n.current.following, label: L10n.current.following),
DropdownMenuEntry(value: L10n.current.foryou, label: L10n.current.foryou)
])),
actions: _tab == 1
? [
IconButton(
Expand Down

0 comments on commit bcb03bb

Please sign in to comment.