mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: Bunc of uncaught exceptions
This commit is contained in:
parent
9c964e7b41
commit
9f6aa1e489
6 changed files with 34 additions and 23 deletions
|
|
@ -58,7 +58,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
|
|||
late String currentTag = widget.heroTag == true ? widget.poster.id : UniqueKey().toString();
|
||||
bool hover = false;
|
||||
|
||||
void pressedWidget() async {
|
||||
void pressedWidget(BuildContext context) async {
|
||||
if (widget.heroTag == false) {
|
||||
setState(() {
|
||||
currentTag = widget.poster.id;
|
||||
|
|
@ -67,15 +67,12 @@ class _PosterImageState extends ConsumerState<PosterImage> {
|
|||
if (widget.onPressed != null) {
|
||||
widget.onPressed?.call(() async {
|
||||
await navigateToDetails();
|
||||
if (context.mounted) {
|
||||
context.refreshData();
|
||||
}
|
||||
context.refreshData();
|
||||
}, widget.poster);
|
||||
} else {
|
||||
await navigateToDetails();
|
||||
if (context.mounted) {
|
||||
context.refreshData();
|
||||
}
|
||||
if (!context.mounted) return;
|
||||
context.refreshData();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -319,7 +316,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
|
|||
Focus(
|
||||
onFocusChange: (value) => setState(() => hover = value),
|
||||
child: FlatButton(
|
||||
onTap: pressedWidget,
|
||||
onTap: () => pressedWidget(context),
|
||||
onSecondaryTapDown: (details) async {
|
||||
Offset localPosition = details.globalPosition;
|
||||
RelativeRect position = RelativeRect.fromLTRB(
|
||||
|
|
@ -391,7 +388,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
|
|||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: pressedWidget,
|
||||
onTap: () => pressedWidget(context),
|
||||
onLongPress: () {
|
||||
showBottomSheetPill(
|
||||
context: context,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue