TF-4179 Add Label bar in sidebar
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:labels/model/label.dart';
|
||||
import 'package:labels/utils/labels_constants.dart';
|
||||
import 'package:model/mailbox/expand_mode.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/state/get_all_label_state.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/usecases/get_all_label_interactor.dart';
|
||||
@@ -14,6 +15,7 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
|
||||
class LabelController extends BaseController {
|
||||
final labels = <Label>[].obs;
|
||||
final labelListExpandMode = Rx(ExpandMode.EXPAND);
|
||||
|
||||
GetAllLabelInteractor? _getAllLabelInteractor;
|
||||
|
||||
@@ -32,6 +34,12 @@ class LabelController extends BaseController {
|
||||
consumeState(_getAllLabelInteractor!.execute(accountId));
|
||||
}
|
||||
|
||||
void toggleLabelListState() {
|
||||
labelListExpandMode.value = labelListExpandMode.value == ExpandMode.COLLAPSE
|
||||
? ExpandMode.EXPAND
|
||||
: ExpandMode.COLLAPSE;
|
||||
}
|
||||
|
||||
@override
|
||||
void handleSuccessViewState(Success success) {
|
||||
if (success is GetAllLabelSuccess) {
|
||||
|
||||
Reference in New Issue
Block a user