mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
* opt: sized * fix: self send * feat: ctrl enter to send * opt: checked * opt: download notifier * opt: Future.syncValue * mod: account * mod: loading state * opt: DebounceStreamMixin * opt: report * opt: enum map * opt: file handler * opt: dyn color * opt: Uint8List subview * opt: FileExt * opt: computeLuminance * opt: isNullOrEmpty * opt: Get context * update [skip ci] Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt dynamicColor [skip ci] Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * fixes [skip ci] * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Signed-off-by: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
32 lines
715 B
Dart
32 lines
715 B
Dart
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
abstract class CommonSearchController<R, T> extends CommonListController<R, T> {
|
|
final editController = TextEditingController();
|
|
final focusNode = FocusNode();
|
|
|
|
void onClear() {
|
|
if (editController.text.isNotEmpty) {
|
|
editController.clear();
|
|
} else {
|
|
Get.back();
|
|
}
|
|
}
|
|
|
|
@override
|
|
Future<void> onRefresh() {
|
|
if (editController.value.text.isEmpty) {
|
|
return Future.syncValue(null);
|
|
}
|
|
return super.onRefresh();
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
editController.dispose();
|
|
focusNode.dispose();
|
|
super.onClose();
|
|
}
|
|
}
|