mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-18 20:53:45 +02:00
fix: remove template button when there are templates available
This commit is contained in:
parent
beef725364
commit
1671c90a78
1 changed files with 6 additions and 5 deletions
|
@ -48,7 +48,6 @@ class _TemplateLegendState extends State<TemplateLegend> {
|
|||
false;
|
||||
|
||||
var templatesVisible = templatesAvailable && _templateDrawerOpen;
|
||||
|
||||
if (!templatesAvailable &&
|
||||
!featureSet.require(AvailabilityFeature.templates)) {
|
||||
return const SizedBox.shrink();
|
||||
|
@ -86,7 +85,7 @@ class _TemplateLegendState extends State<TemplateLegend> {
|
|||
thickness: 1,
|
||||
);
|
||||
|
||||
if (_templateDrawerOpen && !templatesLoading) {
|
||||
if (_templateDrawerOpen && templatesAvailable) {
|
||||
body = Container(
|
||||
constraints: const BoxConstraints(maxHeight: 152),
|
||||
child: SingleChildScrollView(
|
||||
|
@ -161,8 +160,8 @@ class _TemplateLegendState extends State<TemplateLegend> {
|
|||
translations.templateLegendTitle,
|
||||
style: textTheme.titleMedium,
|
||||
),
|
||||
if ((templatesAvailable && !templatesLoading) ||
|
||||
_templateDrawerOpen) ...[
|
||||
if (templatesAvailable ||
|
||||
(_templateDrawerOpen && templatesLoading)) ...[
|
||||
Icon(
|
||||
_templateDrawerOpen
|
||||
? Icons.arrow_drop_up
|
||||
|
@ -195,7 +194,9 @@ class _TemplateLegendState extends State<TemplateLegend> {
|
|||
if (templatesLoading) ...[
|
||||
options.loadingIndicatorBuilder(context),
|
||||
] else ...[
|
||||
createNewTemplateButton,
|
||||
if (templates.isEmpty) ...[
|
||||
createNewTemplateButton,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue