mod: longPress enlarge img
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/skeleton/video_card_v.dart';
|
||||
import 'package:pilipala/common/widgets/animated_dialog.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/common/widgets/overlay_pop.dart';
|
||||
import 'package:pilipala/common/widgets/video_card_v.dart';
|
||||
import 'package:pilipala/models/models_rec_video_item.dart';
|
||||
import './controller.dart';
|
||||
import 'package:pilipala/common/constants.dart';
|
||||
import 'package:pilipala/pages/home/widgets/app_bar.dart';
|
||||
@ -84,7 +88,18 @@ class _HomePageState extends State<HomePage>
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return videoList.isNotEmpty
|
||||
? VideoCardV(videoItem: videoList[index])
|
||||
? VideoCardV(
|
||||
videoItem: videoList[index],
|
||||
longPress: () {
|
||||
_homeController.popupDialog =
|
||||
_createPopupDialog(videoList[index]);
|
||||
Overlay.of(context)
|
||||
.insert(_homeController.popupDialog!);
|
||||
},
|
||||
longPressEnd: () {
|
||||
_homeController.popupDialog?.remove();
|
||||
},
|
||||
)
|
||||
: const VideoCardVSkeleton();
|
||||
},
|
||||
childCount: videoList.isNotEmpty ? videoList.length : 10,
|
||||
@ -98,6 +113,14 @@ class _HomePageState extends State<HomePage>
|
||||
// ),
|
||||
);
|
||||
}
|
||||
|
||||
OverlayEntry _createPopupDialog(RecVideoItemModel videoItem) {
|
||||
return OverlayEntry(
|
||||
builder: (context) => AnimatedDialog(
|
||||
child: OverlayPop(videoItem: videoItem),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MySliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
|
||||
|
Reference in New Issue
Block a user