Code Monkey home page Code Monkey logo

Comments (3)

JohnF17 avatar JohnF17 commented on August 28, 2024 2

But don't you worry @isaanyoha, i've now just released HeartOverlay Version: 1.3.0
It has support for displaying any kind of widget instead of just icons, and that includes Text to show your emojis.

 HeartOverlay(
    icon: const Text('✌️'),
    size: 60,
    verticalOffset: 20,  // Vertical Offset from tap position
    horizontalOffset: -10,  // Horizontal Offset from tap position
    duration: Duration(milliseconds: 800), // Icon to stay on screen duration 
    tapDownType: TapDownType.single, // The animation trigger type
    onPressed: (numberOfHearts) {
        // Do something with the number of hearts shown or do something whenever the icon appears
    },
    child: Image.asset('assets/image.png'), // Overlay container background
  ),

NOTE: please be aware that you might have to fiddle with the vertical and horizontal offsets to precisely align the widget to its tap position.

Make sure to close the issue if the issue has been resolved✌️ and check out the CHANGELOG for additional details and know more about the next release.

from heart_overlay.

JohnF17 avatar JohnF17 commented on August 28, 2024 1

Hello @isaanyoha, You're welcome! and I'm glad you're enjoying the package.

You can replace the heart icon with other icons using the following code:

HeartOverlay(
  icon: const Icon(
    Icons.add, // Replace with the desired emoji icon
    color: Colors.purple,
    size: 100,
  ),
),

As of my last update, directly using widgets (such as the Text widget to put text or emojis) is not supported yet, but you can use the approach above to replace the heart icon with an icon of your choice.

For further updates and changes, make sure to check the CHANGELOG here, i'll be sure to add widget support soon as described on the [Next] section in the change log.
Hope this answers your question! ✌️

from heart_overlay.

isaanyoha avatar isaanyoha commented on August 28, 2024 1

Thanks for the reply and update!

from heart_overlay.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.