mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -111,21 +111,21 @@ class _FollowPageState extends State<FollowPage> {
|
||||
}
|
||||
}
|
||||
|
||||
class _FakeAPI {
|
||||
static const List<String> _kOptions = <String>[
|
||||
'aardvark',
|
||||
'bobcat',
|
||||
'chameleon',
|
||||
];
|
||||
// Searches the options, but injects a fake "network" delay.
|
||||
static Future<Iterable<String>> search(String query) async {
|
||||
await Future<void>.delayed(
|
||||
const Duration(seconds: 1)); // Fake 1 second delay.
|
||||
if (query == '') {
|
||||
return const Iterable<String>.empty();
|
||||
}
|
||||
return _kOptions.where((String option) {
|
||||
return option.contains(query.toLowerCase());
|
||||
});
|
||||
}
|
||||
}
|
||||
// class _FakeAPI {
|
||||
// static const List<String> _kOptions = <String>[
|
||||
// 'aardvark',
|
||||
// 'bobcat',
|
||||
// 'chameleon',
|
||||
// ];
|
||||
// // Searches the options, but injects a fake "network" delay.
|
||||
// static Future<Iterable<String>> search(String query) async {
|
||||
// await Future<void>.delayed(
|
||||
// const Duration(seconds: 1)); // Fake 1 second delay.
|
||||
// if (query == '') {
|
||||
// return const Iterable<String>.empty();
|
||||
// }
|
||||
// return _kOptions.where((String option) {
|
||||
// return option.contains(query.toLowerCase());
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user