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