feat: find ID

Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
Kingtous
2022-08-23 17:52:53 +08:00
parent 4f859d3c9d
commit 0eed72a60d
2 changed files with 57 additions and 13 deletions

View File

@@ -977,6 +977,9 @@ class _PeerTabbedPageState extends State<_PeerTabbedPage>
// hard code for now
void _handleTabSelection() {
if (_tabController.indexIsChanging) {
// reset search text
peerSearchText.value = "";
peerSearchTextController.clear();
_tabIndex.value = _tabController.index;
switch (_tabController.index) {
case 0:
@@ -1063,7 +1066,31 @@ class _PeerTabbedPageState extends State<_PeerTabbedPage>
}
_createSearchBar(BuildContext context) {
return Offstage();
return Container(
width: 175,
height: 30,
margin: EdgeInsets.only(right: 16),
decoration: BoxDecoration(color: Colors.white),
child: Obx(
() => TextField(
controller: peerSearchTextController,
onChanged: (searchText) {
peerSearchText.value = searchText;
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
size: 20,
),
contentPadding: EdgeInsets.zero,
hintText: translate("Search ID"),
hintStyle: TextStyle(fontSize: 14),
border: OutlineInputBorder(),
isDense: true,
),
),
),
);
}
_createPeerViewTypeSwitch(BuildContext context) {
@@ -1082,6 +1109,7 @@ class _PeerTabbedPageState extends State<_PeerTabbedPage>
child: Icon(
Icons.grid_view_rounded,
size: 20,
color: Colors.black54,
)),
),
),
@@ -1096,11 +1124,12 @@ class _PeerTabbedPageState extends State<_PeerTabbedPage>
},
child: Icon(
Icons.list,
size: 20,
size: 24,
color: Colors.black54,
)),
),
),
],
);
).paddingOnly(right: 16.0);
}
}