add transition for toolbar appearing and disappearing

This commit is contained in:
Filip Krawczyk 2022-08-25 17:40:37 +02:00
parent 2cc82e6a45
commit c83e93c755
1 changed files with 17 additions and 14 deletions

View File

@ -60,22 +60,25 @@ class EditorToolbar extends HookWidget {
create: (context) => store, create: (context) => store,
child: AsyncStoreListener( child: AsyncStoreListener(
asyncStore: store.imageUploadState, asyncStore: store.imageUploadState,
child: visible child: AnimatedSwitcher(
? Container( duration: const Duration(milliseconds: 200),
height: _height, child: visible
width: double.infinity, ? Container(
color: Theme.of(context).cardColor, height: _height,
child: Material( width: double.infinity,
child: SingleChildScrollView( color: Theme.of(context).cardColor,
scrollDirection: Axis.horizontal, child: Material(
child: _ToolbarBody( child: SingleChildScrollView(
controller: controller, scrollDirection: Axis.horizontal,
instanceHost: instanceHost, child: _ToolbarBody(
controller: controller,
instanceHost: instanceHost,
),
), ),
), ),
), )
) : const SizedBox.shrink(),
: const SizedBox.shrink(), ),
), ),
); );
} }