A flutter plugin to draw the coordinates on the widget and as well as to find the given point is inside a list of coordinates or not.

Overview

Draw On

Pub Version

A flutter plugin to draw the coordinates on widget and as well as to find the given point is inside a list of coordinates or not.

For Draw on widget

DrawOnWidget(
    widget: _DrawOnImageWidget(),
    correctAnswerCoordinates: selectedPositions,
    getXaxis: (xAxis) {
    setState(() {
        selectedX = xAxis;
    });
    },
    getYaxis: (yAxis) {
    setState(() {
        selectedY = yAxis;
    });
    },
    showPointer: showPointer,
    onTap: () {
    setState(() {
        showPointer = true;
        if (selectedPositions.last.length > 3 &&
            selectedPositions.last.first == selectedPositions.last.last) {
        selectedPositions.add([]);
        }
        Offset? nearestValue = Polygon.getNearestPoint(
            selectedPositions.last, Offset(selectedX!, selectedY!));
        selectedPositions.last.add(Offset(selectedX!, selectedY!));
        if (nearestValue != null) {
        selectedPositions.last.add(nearestValue);
        }
        selectedX = null;
        selectedY = null;
    });
    print(selectedPositions);
    },
    pointsColor: Colors.green,
    lineColor: Colors.green,
),

For Select Area Widget

 SelectAreaWidget(
    correctAnswerCoordinates: correctAnswerCoordinates,
    widget: _DrawOnImageWidget(),
    isSelectable: isSelectable,
    getXaxis: (xAxis) {
    setState(() {
        selectedPositionX = xAxis;
    });
    },
    showPointer: showPointer,
    getYaxis: (yAxis) {
    setState(() {
        selectedPositionY = yAxis;
    });
    },
    onTap: () {
    setState(() {
        showPointer = true;
    });
    },
    pointsColor: Colors.red,
    lineColor: Colors.green,
),

To find nearest point

Polygon.getNearestPoint(points, currentPoints);

To find whether the given point is inside the coordinates

Polygon polygon = Polygon(polygonPoints);
isInside = polygon.isPointInside(Offset(xAxis, yAxis));

Demo

example-location-builders

You might also like...

This is a simple open source project where you can easily contribute by uploading algorithms that are not specified in the list.

This is a simple open source project where you can easily contribute by uploading algorithms that are not specified in the list.

Support this project by giving it a thumbs up! AlgoBook A new Flutter application for algorithms. This app is mainly to refer to the algorithms that a

Jul 23, 2022

A platform similar to iFood that makes it easier for the consumers to find a list of generators with solar plates system available for rent

iEnergy App A platform similar to iFood that makes it easier for the consumers to find a list of generators with solar plates system available for ren

Jun 7, 2022

Breathe is a mental health blogging app where users can join communities of doctors and other users from around the world and both share their problems as well as lend a ear to and help others

Breathe is a mental health blogging app where users can join communities of doctors and other users from around the world and both share their problems as well as lend a ear to and help others

𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐁𝐫𝐞𝐚𝐭𝐡𝐞 In a condensed, suffocating society you can feel closed off, when you can't process your emotions and are going through

May 16, 2022

The application contains the Noble Qur’an, Qur’an radio stations, morning and evening remembrances, and some supplications that a Muslim needs in his life, as well as prayer times, the direction of the qiblah, and the Forty-Nawawi book

The application contains the Noble Qur’an, Qur’an radio stations, morning and evening remembrances, and some supplications that a Muslim needs in his life, as well as prayer times, the direction of the qiblah, and the Forty-Nawawi book

The application contains the Noble Qur’an, Qur’an radio stations, morning and evening remembrances, and some supplications that a Muslim needs in his life, as well as prayer times, the direction of the qiblah, and the Forty-Nawawi book

Dec 15, 2022

Allows communication between your bot and the Web App built in Flutter displayed inside Telegram.

tele_web_app It enables communication between your bot and the Flutter-embedded Web App displayed inside Telegram by making use of interoperability be

Dec 8, 2022

Makes it possible to safely execute and retry a Future inside a StatelessWidget

Makes it possible to safely execute and retry a Future inside a StatelessWidget

futuristic Makes it possible to safely execute and retry a Future inside a StatelessWidget. See the Mainstream package for a similar API for working w

Sep 15, 2022

A group of overlapping round avatars are called face piles, a face pile is a series of overlapping avatar images that come and go as users join and leave a given group.

A group of overlapping round avatars are called face piles, a face pile is a series of overlapping avatar images that come and go as users join and leave a given group.

Flutter Face Pile A group of overlapping round avatars are called face piles. A face pile is a series of overlapping avatar images that come and go as

Sep 22, 2022

Working proof of the Go (golang) server running inside Flutter

Working proof of the Go (golang) server running inside Flutter

flap Working proof of the Go server running inside Flutter Video in action Prerequisites Flutter 2.0 Go 1.16 Build Go server cd go macOS: make maco

Dec 17, 2022

A Flutter package that provides a dropdown form field using a dropdown button inside a form field.

A Flutter package that provides a dropdown form field using a dropdown button inside a form field.

Dropdown form field A dropdown form field using a dropdown button inside a form field. Demo Features Can be used as regular form field. Simple to impl

Jan 1, 2023
Comments
  • Is it possible to have guide line before clicking.

    Is it possible to have guide line before clicking.

    Screenshot 2021-10-01 at 1 41 11 PM

    Is it possible to have a guide line on mouse move before clicking to make a line. It will be like a feedback on mouse move

    It would be great if feedback line would stick to x/y axis to a particular threshold to draw a straight line

    opened by sohan99 2
Owner
Sivaramsiva10
Flutter | Express.js | Freelancer
Sivaramsiva10
A smartphone application called Easy Job goal is to make easier for businesses to find people who meet their standards as well as for job seekers to search for and choose from available positions .

Easy_Jobs 19SW54(MAD-Project) A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to ge

Muskan 2 Nov 6, 2022
Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Andi Semler 113 Sep 28, 2022
Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map.

Custom Radio Group List Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map. Feature

Ashok Kumar Verma 0 Nov 30, 2021
Find The Latest trending and upcoming movies and tv shows with MovieDB app. The app contains all info about movies and tv shows. find similar movies or shows, Browse all genres, video trailers, backdrops, logos, and posters.

MovieDB App Features. Dynamic Theming Search Functionality Onboarding-Screen Select favourite movie Home Screen Tranding movie Movies different catego

Ansh rathod 80 Dec 12, 2022
Boris Gautier 1 Jan 31, 2022
Iridium-reader-widget - Plug and play reader widget allowing to easily integrate an Iridium viewer inside any app

Plug and play reader widget allowing to easily integrate an Iridium viewer insid

Mantano 15 Dec 31, 2022
Find-Kosan-Cimahi - Find Kosan Cimahi App With Flutter

Find Kosan Cimahi Masih Tahap Belajar Dart This project is a starting point for

null 1 Feb 17, 2022
A tab bar widget for Flutter 💙 with point indicator.

flutter_point_tab_bar A tab bar widget with point indicator. Demo Usage TabBar( controller: _tabController, indicator: PointTabIndicator(

Hiển Lê 5 Sep 16, 2022
Grad text package - A Flutter Widget to draw gradients into text

grad_text A Flutter Widget to draw gradients into text.(Null safe) Demo Install

Karthik Sunil K 3 Jan 31, 2022