2019-05-23 16:27:43 +00:00
|
|
|
import 'package:comunic/enums/post_visibility_level.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
/// Post visibility level tile
|
|
|
|
///
|
|
|
|
/// @author Pierre HUBERT
|
|
|
|
|
|
|
|
class PostVisibilityLevelTile extends StatelessWidget {
|
|
|
|
final PostVisibilityLevel level;
|
|
|
|
final String title;
|
|
|
|
final void Function(PostVisibilityLevel) onSelect;
|
|
|
|
final bool visible;
|
|
|
|
|
|
|
|
const PostVisibilityLevelTile({
|
2022-03-10 18:39:57 +00:00
|
|
|
Key? key,
|
|
|
|
required this.level,
|
|
|
|
required this.title,
|
|
|
|
required this.onSelect,
|
2019-05-23 16:27:43 +00:00
|
|
|
this.visible = true,
|
2022-03-11 15:40:56 +00:00
|
|
|
}) : super(key: key);
|
2019-05-23 16:27:43 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
if(!visible)
|
|
|
|
return Container();
|
|
|
|
|
|
|
|
return ListTile(
|
|
|
|
leading: Icon(PostVisibilityLevelsMapIcons[level]),
|
|
|
|
title: Text(title),
|
|
|
|
onTap: () => onSelect(level),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|