mod: longPress enlarge img
This commit is contained in:
@ -11,6 +11,7 @@ class HotController extends GetxController {
|
||||
RxList videoList = [].obs;
|
||||
bool isLoadingMore = false;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/widgets/animated_dialog.dart';
|
||||
import 'package:pilipala/common/widgets/overlay_pop.dart';
|
||||
import 'package:pilipala/common/widgets/video_card_h.dart';
|
||||
import 'package:pilipala/pages/hot/controller.dart';
|
||||
import 'package:pilipala/pages/home/widgets/app_bar.dart';
|
||||
@ -56,6 +58,14 @@ class _HotPageState extends State<HotPage> with AutomaticKeepAliveClientMixin {
|
||||
delegate: SliverChildBuilderDelegate((context, index) {
|
||||
return VideoCardH(
|
||||
videoItem: videoList[index],
|
||||
longPress: () {
|
||||
_hotController.popupDialog =
|
||||
_createPopupDialog(videoList[index]);
|
||||
Overlay.of(context).insert(_hotController.popupDialog!);
|
||||
},
|
||||
longPressEnd: () {
|
||||
_hotController.popupDialog?.remove();
|
||||
},
|
||||
);
|
||||
}, childCount: videoList.length)),
|
||||
SliverToBoxAdapter(
|
||||
@ -68,4 +78,12 @@ class _HotPageState extends State<HotPage> with AutomaticKeepAliveClientMixin {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
OverlayEntry _createPopupDialog(videoItem) {
|
||||
return OverlayEntry(
|
||||
builder: (context) => AnimatedDialog(
|
||||
child: OverlayPop(videoItem: videoItem),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user