[AVLE] New Feature: Applying Photo Viewer

in hive-192037 •  3 years ago 

What inconvenient thing in steemit.com on mobile devices is that images are not zoomable.
(It seems there have been changes in steemit.com. It is zoomable but something strange.)

It would be very nice to have a photo viewer for an image.
image.png

Photo Viewer

If you click an image, then you will be navigated to the photo viewer screen like this:

image.png

You can zoom in/out by double tapping as well as by pinching.

It is a basic function which should have been implemented. Using Flutter it is quite simple task.

Implementation

The following packages are used to implement this:

// feee screen
 HtmlWidget(
              convertMarkdownToHtml(
                  markdownBody: body, width: MediaQuery.of(context).size.width),
              // webView: true,
              factoryBuilder: () {
                return PopupPhotoViewWidgetFactory();
              },
}

and snippet for PopupPhotoViewWidgetFactory is

class PopupPhotoViewWidgetFactory extends WidgetFactory {
  @override
  Widget? buildImageWidget(BuildMetadata meta, ImageSource src) {
    final built = super.buildImageWidget(meta, src);

    if (built is CachedNetworkImage) {
      print('buildImageWidget. built is CachedNetworkImage');

      final url = src.url;
      return Builder(
        builder: (context) => GestureDetector(
          onTap: () {
            Navigator.of(context).push(
              MaterialPageRoute(
                builder: (_) => Scaffold(
                  appBar: AppBar(),
                  body: PhotoView(
                    heroAttributes: PhotoViewHeroAttributes(tag: url),
                    imageProvider: CachedNetworkImageProvider(url),
                  ),
                ),
              ),
            );
          },
          child: Hero(tag: url, child: built!),
        ),
      );
    }
    return built;
  }

Please vote for me as a witness.

https://steemitwallet.com/~witnesses
(find etainclub ranked at 32)
or here:
https://steemyy.com/witness-voting/?witness=etainclub&action=approve

@steemcurator01, Thank you for Your Support

@misterdelegation Could you delegate steem power to help me manage mobile app (PLAY STEEM) and webapp (AVLE)?

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

This post has been featured in the latest edition of Steem News...

Upvoted! Thank you for supporting witness @jswit.
special.jpg

오늘도 응원합니다^^

고맙습니다~

thanks

push test1

  ·  3 years ago 

Happy every day, upvoted ,see you 😊! witnesses vote for me get daily upvote

I have included this post in the 26th issue of Steem News Magazine For Steemit Platform | December 05, 2021.