minor fixes
This commit is contained in:
parent
1b39bb6ab4
commit
590c353fcd
2 changed files with 54 additions and 41 deletions
|
@ -221,7 +221,7 @@ class ViewerDetailOverlayContent extends StatelessWidget {
|
||||||
rows.add(_buildRatingTagsFullRow(context));
|
rows.add(_buildRatingTagsFullRow(context));
|
||||||
}
|
}
|
||||||
if (showDescription) {
|
if (showDescription) {
|
||||||
rows.add(_buildDescriptionFullRow(context));
|
rows.add(_buildDescriptionFullRow(context, infoMaxWidth));
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
@ -243,12 +243,17 @@ class ViewerDetailOverlayContent extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildDescriptionFullRow(BuildContext context) => _buildFullRowSwitcher(
|
Widget _buildDescriptionFullRow(BuildContext context, double infoMaxWidth) => _buildFullRowSwitcher(
|
||||||
context: context,
|
context: context,
|
||||||
visible: details.description != null,
|
visible: details.description != null,
|
||||||
builder: (context) => OverlayRowExpander(
|
builder: (context) => SizedBox(
|
||||||
expandedNotifier: expandedNotifier,
|
// size it so that a long description with multiple short lines
|
||||||
child: OverlayDescriptionRow(description: details.description!),
|
// expands to the full width and the scroll bar is at the edge
|
||||||
|
width: infoMaxWidth,
|
||||||
|
child: OverlayRowExpander(
|
||||||
|
expandedNotifier: expandedNotifier,
|
||||||
|
child: OverlayDescriptionRow(description: details.description!),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -286,45 +291,49 @@ class ViewerDetailOverlayContent extends StatelessWidget {
|
||||||
required double subRowWidth,
|
required double subRowWidth,
|
||||||
required bool visible,
|
required bool visible,
|
||||||
required WidgetBuilder builder,
|
required WidgetBuilder builder,
|
||||||
}) =>
|
}) {
|
||||||
AnimatedSwitcher(
|
final child = visible
|
||||||
duration: context.select<DurationsData, Duration>((v) => v.viewerOverlayChangeAnimation),
|
? SizedBox(
|
||||||
switchInCurve: Curves.easeInOutCubic,
|
width: subRowWidth,
|
||||||
switchOutCurve: Curves.easeInOutCubic,
|
child: builder(context),
|
||||||
transitionBuilder: (child, animation) => FadeTransition(
|
)
|
||||||
opacity: animation,
|
: const SizedBox();
|
||||||
child: child,
|
return AnimatedSwitcher(
|
||||||
),
|
duration: context.select<DurationsData, Duration>((v) => v.viewerOverlayChangeAnimation),
|
||||||
child: visible
|
switchInCurve: Curves.easeInOutCubic,
|
||||||
? SizedBox(
|
switchOutCurve: Curves.easeInOutCubic,
|
||||||
width: subRowWidth,
|
transitionBuilder: (child, animation) => FadeTransition(
|
||||||
child: builder(context),
|
opacity: animation,
|
||||||
)
|
child: child,
|
||||||
: const SizedBox(),
|
),
|
||||||
);
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildFullRowSwitcher({
|
Widget _buildFullRowSwitcher({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required bool visible,
|
required bool visible,
|
||||||
required WidgetBuilder builder,
|
required WidgetBuilder builder,
|
||||||
}) =>
|
}) {
|
||||||
AnimatedSwitcher(
|
final child = visible
|
||||||
duration: context.select<DurationsData, Duration>((v) => v.viewerOverlayChangeAnimation),
|
? Padding(
|
||||||
switchInCurve: Curves.easeInOutCubic,
|
padding: const EdgeInsets.only(top: _interRowPadding),
|
||||||
switchOutCurve: Curves.easeInOutCubic,
|
child: builder(context),
|
||||||
transitionBuilder: (child, animation) => FadeTransition(
|
)
|
||||||
opacity: animation,
|
: const SizedBox();
|
||||||
child: SizeTransition(
|
return AnimatedSwitcher(
|
||||||
axisAlignment: 1,
|
duration: context.select<DurationsData, Duration>((v) => v.viewerOverlayChangeAnimation),
|
||||||
sizeFactor: animation,
|
switchInCurve: Curves.easeInOutCubic,
|
||||||
child: child,
|
switchOutCurve: Curves.easeInOutCubic,
|
||||||
),
|
transitionBuilder: (child, animation) => FadeTransition(
|
||||||
|
opacity: animation,
|
||||||
|
child: SizeTransition(
|
||||||
|
sizeFactor: animation,
|
||||||
|
axisAlignment: 1,
|
||||||
|
child: child,
|
||||||
),
|
),
|
||||||
child: visible
|
),
|
||||||
? Padding(
|
child: child,
|
||||||
padding: const EdgeInsets.only(top: _interRowPadding),
|
);
|
||||||
child: builder(context),
|
}
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -414,7 +414,11 @@ class _EntryPageViewState extends State<EntryPageView> with TickerProviderStateM
|
||||||
onScaleUpdate: onScaleUpdate,
|
onScaleUpdate: onScaleUpdate,
|
||||||
onScaleEnd: onScaleEnd,
|
onScaleEnd: onScaleEnd,
|
||||||
onFling: _onFling,
|
onFling: _onFling,
|
||||||
onTap: (c, s, a, p) => _onTap(alignment: a),
|
onTap: (c, s, a, p) {
|
||||||
|
if (c.mounted) {
|
||||||
|
_onTap(alignment: a);
|
||||||
|
}
|
||||||
|
},
|
||||||
onDoubleTap: onDoubleTap,
|
onDoubleTap: onDoubleTap,
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue