info: open at most one metadata directory
This commit is contained in:
parent
96aedf0dc2
commit
acc2cd6c9e
3 changed files with 14 additions and 3 deletions
|
@ -26,6 +26,7 @@ class MetadataSectionSliver extends StatefulWidget {
|
||||||
class _MetadataSectionSliverState extends State<MetadataSectionSliver> with AutomaticKeepAliveClientMixin {
|
class _MetadataSectionSliverState extends State<MetadataSectionSliver> with AutomaticKeepAliveClientMixin {
|
||||||
List<_MetadataDirectory> _metadata = [];
|
List<_MetadataDirectory> _metadata = [];
|
||||||
String _loadedMetadataUri;
|
String _loadedMetadataUri;
|
||||||
|
final ValueNotifier<String> _expandedDirectoryNotifier = ValueNotifier(null);
|
||||||
|
|
||||||
bool get isVisible => widget.visibleNotifier.value;
|
bool get isVisible => widget.visibleNotifier.value;
|
||||||
|
|
||||||
|
@ -81,6 +82,8 @@ class _MetadataSectionSliverState extends State<MetadataSectionSliver> with Auto
|
||||||
}
|
}
|
||||||
final dir = directoriesWithTitle[index - 1 - untitledDirectoryCount];
|
final dir = directoriesWithTitle[index - 1 - untitledDirectoryCount];
|
||||||
return ExpansionTileCard(
|
return ExpansionTileCard(
|
||||||
|
value: dir.name,
|
||||||
|
expandedNotifier: _expandedDirectoryNotifier,
|
||||||
title: _DirectoryTitle(dir.name),
|
title: _DirectoryTitle(dir.name),
|
||||||
children: [
|
children: [
|
||||||
const Divider(thickness: 1.0, height: 1.0),
|
const Divider(thickness: 1.0, height: 1.0),
|
||||||
|
@ -91,6 +94,7 @@ class _MetadataSectionSliverState extends State<MetadataSectionSliver> with Auto
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
baseColor: Colors.grey[900],
|
baseColor: Colors.grey[900],
|
||||||
|
expandedColor: Colors.grey[850],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: 1 + _metadata.length,
|
childCount: 1 + _metadata.length,
|
||||||
|
@ -119,6 +123,7 @@ class _MetadataSectionSliverState extends State<MetadataSectionSliver> with Auto
|
||||||
_metadata = [];
|
_metadata = [];
|
||||||
_loadedMetadataUri = null;
|
_loadedMetadataUri = null;
|
||||||
}
|
}
|
||||||
|
_expandedDirectoryNotifier.value = null;
|
||||||
if (mounted) setState(() {});
|
if (mounted) setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,9 +104,11 @@ packages:
|
||||||
expansion_tile_card:
|
expansion_tile_card:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: expansion_tile_card
|
path: "."
|
||||||
url: "https://pub.dartlang.org"
|
ref: HEAD
|
||||||
source: hosted
|
resolved-ref: edb6b11bb448fc2f30e566a20605b37093503176
|
||||||
|
url: "git://github.com/deckerst/expansion_tile_card.git"
|
||||||
|
source: git
|
||||||
version: "1.0.3"
|
version: "1.0.3"
|
||||||
flushbar:
|
flushbar:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
|
|
|
@ -20,10 +20,14 @@ dependencies:
|
||||||
charts_flutter:
|
charts_flutter:
|
||||||
collection:
|
collection:
|
||||||
draggable_scrollbar:
|
draggable_scrollbar:
|
||||||
|
# path: ../flutter-draggable-scrollbar
|
||||||
git:
|
git:
|
||||||
url: git://github.com/deckerst/flutter-draggable-scrollbar.git
|
url: git://github.com/deckerst/flutter-draggable-scrollbar.git
|
||||||
event_bus:
|
event_bus:
|
||||||
expansion_tile_card:
|
expansion_tile_card:
|
||||||
|
# path: ../expansion_tile_card
|
||||||
|
git:
|
||||||
|
url: git://github.com/deckerst/expansion_tile_card.git
|
||||||
flushbar:
|
flushbar:
|
||||||
# flushbar-1.9.1 cannot be built with Flutter 1.15.17
|
# flushbar-1.9.1 cannot be built with Flutter 1.15.17
|
||||||
git:
|
git:
|
||||||
|
|
Loading…
Reference in a new issue