Skip to content

Commit bcb03bb

Browse files
committed
use DropdownMenu in feed
1 parent f501c8d commit bcb03bb

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

lib/home/_feed.dart

+19-17
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,25 @@ class _FeedScreenState extends State<FeedScreen>
7373
pinned: false,
7474
snap: true,
7575
floating: true,
76-
title: DropdownButton(
77-
padding: EdgeInsets.only(left: 8),
78-
underline: Container(),
79-
value: _tabValue,
80-
style: Theme.of(context).appBarTheme.titleTextStyle,
81-
onChanged: (value) => setState(() {
82-
if (value == L10n.current.foryou) {
83-
_tab = 1;
84-
} else if (value == L10n.current.following) {
85-
_tab = 0;
86-
}
87-
_tabValue = value;
88-
}),
89-
items: [
90-
DropdownMenuItem(value: L10n.current.following, child: Text(L10n.current.following)),
91-
DropdownMenuItem(value: L10n.current.foryou, child: Text(L10n.current.foryou))
92-
]),
76+
title: Padding(
77+
padding: const EdgeInsets.all(8.0),
78+
child: DropdownMenu(
79+
inputDecorationTheme: InputDecorationTheme(
80+
isDense: true, border: OutlineInputBorder(borderRadius: BorderRadius.circular(12))),
81+
initialSelection: L10n.current.following,
82+
textStyle: Theme.of(context).appBarTheme.titleTextStyle,
83+
onSelected: (value) => setState(() {
84+
if (value == L10n.current.foryou) {
85+
_tab = 1;
86+
} else if (value == L10n.current.following) {
87+
_tab = 0;
88+
}
89+
_tabValue = value;
90+
}),
91+
dropdownMenuEntries: [
92+
DropdownMenuEntry(value: L10n.current.following, label: L10n.current.following),
93+
DropdownMenuEntry(value: L10n.current.foryou, label: L10n.current.foryou)
94+
])),
9395
actions: _tab == 1
9496
? [
9597
IconButton(

0 commit comments

Comments
 (0)