Share Widget Screenshots with Flutter | Day 09 -

Поделиться
HTML-код
  • Опубликовано: 9 сен 2024
  • Kilo Loco shows you how to take screenshots of your custom widgets and share them outside of the app. In this tutorial, you will learn how to use both the screenshot and share libraries.
    ** Show Notes and Links **
    Project Files:
    github.com/Kil...
    Kilo Loco on Social Media:
    www.kiloloco.com
    Discord - / discord
    Twitter - / kilo_loco
    Instagram - / kilo_loco
    #flutter #dartlang #30DaysOfFlutter

Комментарии • 59

  • @El-lj5pz
    @El-lj5pz 3 года назад +29

    Thank Kilo Loco for the video. For those who are using the new Screenshot package you need to change the _takeScreenshot() function code to this :
    void _takeScreenshot() async {
    final uint8List = await screenshotController.capture();
    String tempPath = (await getTemporaryDirectory()).path;
    File file = File('$tempPath/image.png');
    await file.writeAsBytes(uint8List);
    await Share.shareFiles([file.path]);
    }

    • @criszx17dev92
      @criszx17dev92 3 года назад

      Thanks bro !

    • @omerkaraca7375
      @omerkaraca7375 3 года назад

      Thank so much bro. You saved my hours

    • @user-nb9kd6yp2j
      @user-nb9kd6yp2j 3 года назад

      what about getTemporaryDirectory, and image.png, and writeAsBytes, they are all showing errors

    • @Surimi888
      @Surimi888 3 года назад

      Thank you! Life saver.

    • @lawrencereeve5755
      @lawrencereeve5755 3 года назад

      @@user-nb9kd6yp2j Me too bro, did you find a solution for this?

  • @RalphShillington
    @RalphShillington 3 года назад +15

    Breaking change to Screenshot (0.3.0 10/02/2021) . The capture method now returns Uint8List instead of File. If you want to follow along with the video exactly, you'll need fix the reference the previous version of the package, in the pubspec.yml to version 0.2.0 specifically (i.e. remove the ^ )

    • @Kilo_Loco
      @Kilo_Loco  3 года назад +2

      Thanks for sharing

    • @viveks.
      @viveks. 3 года назад

      Hey @Ralph Shillington what is the solution for screenshot ^0.3.0

    • @marcelhh5722
      @marcelhh5722 3 года назад

      and for 030?

    • @El-lj5pz
      @El-lj5pz 3 года назад

      @@viveks. checkout my comment above if you haven't found any workaround

    • @El-lj5pz
      @El-lj5pz 3 года назад

      ​@@marcelhh5722 checkout my comment above if you haven't found any workaround

  • @sanjarbekfayzullayev8825
    @sanjarbekfayzullayev8825 7 месяцев назад

    Thank you, I am from Uzbekistan

  • @MoAdel92
    @MoAdel92 2 года назад +5

    newest solution will be
    shareImage() async {
    final uint8List = await screenshotController.capture();
    String tempPath = (await getTemporaryDirectory()).path;
    String fileName =" ";>>>>>your file name between ""
    File file = await File('$tempPath/$fileName" }.png').create();
    file.writeAsBytesSync(uint8List!);
    await Share.shareFiles([file.path]);
    }

  • @ADITYASINGH007
    @ADITYASINGH007 3 года назад +1

    It's very useful. I had been looking for these kind of stuff since 20 days almost.

  • @psatler
    @psatler 3 года назад +2

    I just found your channel and I think it its amazing!!

    • @Kilo_Loco
      @Kilo_Loco  3 года назад

      Haha thanks!! Glad you like it!

  • @faithtutsacademy7
    @faithtutsacademy7 3 года назад

    Great! Just what I needed 🙏

  • @quocvnguyen7117
    @quocvnguyen7117 3 года назад

    Awesome! This is really helpful

  • @sanzharzhanalin6985
    @sanzharzhanalin6985 3 года назад

    Thank you. You always help.

  • @bhaveshingale1610
    @bhaveshingale1610 3 года назад

    Sir, Do i need to have the screen open for taking the screenshot? Or can it be done in background?

  • @limatechofficial
    @limatechofficial Год назад

    Can we directly share screenshot without saving in directory from flutter web ?

  • @lovishaggarwal2453
    @lovishaggarwal2453 3 года назад

    Hey there,
    Thanks for the video. When I try to share the image along with text on WhatsApp, the image does not get shared. If I try this messenger or any other service it works well. It even works well on android WhatsApp. Can you please provide a solution for this error?

  • @angelinadyer4411
    @angelinadyer4411 Год назад

    can I use this on flutterflow?

  • @masihreyhani3910
    @masihreyhani3910 3 года назад

    You're amazing 😊💙🙏

  • @shahidwani6445
    @shahidwani6445 3 года назад

    Screenshot is not working with webview widget
    How to make it work

  • @marcelhh5722
    @marcelhh5722 3 года назад +1

    Dont work more with 0.3.0 any solution?

  • @mobileapps1472
    @mobileapps1472 2 года назад

    How to add watermark on full screen capture with Flutter

  • @omerkaraca7375
    @omerkaraca7375 3 года назад

    This doesn't work for 0.3.0 version, how to handle saving and sharing SS with the latest version.

    • @El-lj5pz
      @El-lj5pz 3 года назад +1

      See my comment above

    • @omerkaraca7375
      @omerkaraca7375 3 года назад

      @@El-lj5pz Thank so much bro. I hope your comment will be upvoted.

  • @yousour5112
    @yousour5112 3 года назад

    anyone get problem with Screenshot on samsung device ? , it works only first time ,another device works fine

  • @luisangelhernandezlopez4246
    @luisangelhernandezlopez4246 2 года назад

    path error, help please

  • @shahidwani6445
    @shahidwani6445 3 года назад

    Can we add watermark to screen shot

  • @ezone2726
    @ezone2726 3 года назад

    How can we make an flutter app where one app can login only one device ; if user will add another account it won't sign in the app?
    Does it possible to do?
    If yes please help me out!
    #thankyourforthisawesometutorial #flutter #happycoding #awesometutorial #stayhealthy

    • @Kilo_Loco
      @Kilo_Loco  3 года назад +1

      This could probably be done by saving a unique value like the user ID to the keychain and checking that before allowing the user to sign it, but i dont think that would be a good user experience. Most big apps allow you to sign in to different accounts from the same device no problem

    • @ezone2726
      @ezone2726 3 года назад

      @@Kilo_Loco i think if one user have only one account in his/her phone that might be safe and less chance of misues!

  • @jenishsavaliya5446
    @jenishsavaliya5446 3 года назад +1

    path error plz ans and give me solution

  • @sahadcp6612
    @sahadcp6612 3 года назад

    var imageuint = await screenshotController.capture();
    var directory = (await getApplicationDocumentsDirectory()).path;
    File imgFile = new File('$directory/sfs.png');