TF-4227 Enable label item clickable action
This commit is contained in:
@@ -6,15 +6,19 @@ import 'package:tmail_ui_user/features/mailbox/presentation/styles/mailbox_item_
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_icon_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_name_widget.dart';
|
||||
|
||||
typedef OnOpenLabelCallback = void Function(Label label);
|
||||
|
||||
class LabelListItem extends StatelessWidget {
|
||||
final Label label;
|
||||
final ImagePaths imagePaths;
|
||||
final bool isDesktop;
|
||||
final OnOpenLabelCallback onOpenLabelCallback;
|
||||
|
||||
const LabelListItem({
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.imagePaths,
|
||||
required this.onOpenLabelCallback,
|
||||
this.isDesktop = false,
|
||||
});
|
||||
|
||||
@@ -32,6 +36,7 @@ class LabelListItem extends StatelessWidget {
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
borderRadius: borderRadius,
|
||||
onTap: () => onOpenLabelCallback(label),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(borderRadius: borderRadius),
|
||||
padding: EdgeInsetsDirectional.symmetric(
|
||||
|
||||
@@ -7,11 +7,13 @@ class LabelListView extends StatelessWidget {
|
||||
final List<Label> labels;
|
||||
final ImagePaths imagePaths;
|
||||
final bool isDesktop;
|
||||
final OnOpenLabelCallback onOpenLabelCallback;
|
||||
|
||||
const LabelListView({
|
||||
super.key,
|
||||
required this.labels,
|
||||
required this.imagePaths,
|
||||
required this.onOpenLabelCallback,
|
||||
this.isDesktop = false,
|
||||
});
|
||||
|
||||
@@ -28,6 +30,7 @@ class LabelListView extends StatelessWidget {
|
||||
label: labels[index],
|
||||
imagePaths: imagePaths,
|
||||
isDesktop: isDesktop,
|
||||
onOpenLabelCallback: onOpenLabelCallback,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user