From acc2cd6c9e23c2245ef6f33d7878d2338debf591 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Sun, 12 Apr 2020 16:15:14 +0900 Subject: [PATCH] info: open at most one metadata directory --- lib/widgets/fullscreen/info/metadata_section.dart | 5 +++++ pubspec.lock | 8 +++++--- pubspec.yaml | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/widgets/fullscreen/info/metadata_section.dart b/lib/widgets/fullscreen/info/metadata_section.dart index a4d0f9768..e69a2567f 100644 --- a/lib/widgets/fullscreen/info/metadata_section.dart +++ b/lib/widgets/fullscreen/info/metadata_section.dart @@ -26,6 +26,7 @@ class MetadataSectionSliver extends StatefulWidget { class _MetadataSectionSliverState extends State with AutomaticKeepAliveClientMixin { List<_MetadataDirectory> _metadata = []; String _loadedMetadataUri; + final ValueNotifier _expandedDirectoryNotifier = ValueNotifier(null); bool get isVisible => widget.visibleNotifier.value; @@ -81,6 +82,8 @@ class _MetadataSectionSliverState extends State with Auto } final dir = directoriesWithTitle[index - 1 - untitledDirectoryCount]; return ExpansionTileCard( + value: dir.name, + expandedNotifier: _expandedDirectoryNotifier, title: _DirectoryTitle(dir.name), children: [ const Divider(thickness: 1.0, height: 1.0), @@ -91,6 +94,7 @@ class _MetadataSectionSliverState extends State with Auto ), ], baseColor: Colors.grey[900], + expandedColor: Colors.grey[850], ); }, childCount: 1 + _metadata.length, @@ -119,6 +123,7 @@ class _MetadataSectionSliverState extends State with Auto _metadata = []; _loadedMetadataUri = null; } + _expandedDirectoryNotifier.value = null; if (mounted) setState(() {}); } diff --git a/pubspec.lock b/pubspec.lock index a132cabff..8606a78d5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -104,9 +104,11 @@ packages: expansion_tile_card: dependency: "direct main" description: - name: expansion_tile_card - url: "https://pub.dartlang.org" - source: hosted + path: "." + ref: HEAD + resolved-ref: edb6b11bb448fc2f30e566a20605b37093503176 + url: "git://github.com/deckerst/expansion_tile_card.git" + source: git version: "1.0.3" flushbar: dependency: "direct main" diff --git a/pubspec.yaml b/pubspec.yaml index 1f2600bf9..ace22c153 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,10 +20,14 @@ dependencies: charts_flutter: collection: draggable_scrollbar: +# path: ../flutter-draggable-scrollbar git: url: git://github.com/deckerst/flutter-draggable-scrollbar.git event_bus: expansion_tile_card: +# path: ../expansion_tile_card + git: + url: git://github.com/deckerst/expansion_tile_card.git flushbar: # flushbar-1.9.1 cannot be built with Flutter 1.15.17 git: