Giter Site home page Giter Site logo

umechanhika / dotted_line Goto Github PK

View Code? Open in Web Editor NEW
40.0 1.0 15.0 619 KB

This package allows you to draw dotted lines with Flutter.

Home Page: https://pub.dev/packages/dotted_line

License: BSD 3-Clause "New" or "Revised" License

Swift 3.32% Objective-C 0.30% Dart 92.11% Ruby 2.78% HTML 1.48%
flutter dart flutter-widget

dotted_line's Introduction

logo.png


About

This package allows you to draw dotted lines with Flutter.

screenshot.png

Usage

Parameter Default Description
direction Axis.horizontal The direction of the entire dotted line.
alignment WrapAlignment.center The alignment of the entire dotted line.
lineLength double.infinity The length of the entire dotted line.
lineThickness 1.0 The thickness of the entire dotted line.
dashLength 4.0 The length of the dash.
dashColor Colors.black The color of the dash.
dashGradient null The gradient colors of the dash.
dashRadius 0.0 The radius of the dash.
dashGapLength 4.0 The length of the dash gap.
dashGapColor Colors.transparent The color of the dash gap.
dashGapGradient null The gradient colors of the dash gap.
dashGapRadius 0.0 The radius of the dash gap.

This can be used without parameters.

import 'package:dotted_line/dotted_line.dart';

DottedLine()

You can also customize by specifying parameters.

import 'package:dotted_line/dotted_line.dart';

DottedLine(
  direction: Axis.horizontal,
  alignment: WrapAlignment.center,
  lineLength: double.infinity,
  lineThickness: 1.0,
  dashLength: 4.0,
  dashColor: Colors.black,
  dashGradient: [Colors.red, Colors.blue],
  dashRadius: 0.0,
  dashGapLength: 4.0,
  dashGapColor: Colors.transparent,
  dashGapGradient: [Colors.red, Colors.blue],
  dashGapRadius: 0.0,
)

Example

The sample code can be found under the example package. You can try changing all parameters.

dotted_line's People

Contributors

dependabot[bot] avatar filipe-varela avatar hlavki avatar mmustafasesudia avatar umechanhika avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dotted_line's Issues

Weird glitch in certain sizes

image

 const TextStyle textStyle = const TextStyle(
      color: Colors.darkBlue,
      fontWeight: FontWeight.w800,
      fontSize: 17,
      letterSpacing: -1,
    );
    return Container(
      padding: EdgeInsets.only(top: 8),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.end,
        children: [
          Text(title, style: textStyle),
          Expanded(
            child: Padding(
              padding: const EdgeInsets.only(left: 3, right: 3, bottom: 5),
              child: DottedLine(
                dashColor: Colors.darkBlue,
                direction: Axis.horizontal,
                dashRadius: 100,
                dashGapRadius: 10,
                dashLength: 3,
                dashGapLength: 1.2,
                lineThickness: 3,
              ),
            ),
          ),
          Container(
            width: 50,
            child: Text(value, style: textStyle),
          ),
        ],
      ),

Count total dots

I am not sure this feature has been include with this package or not. If have just let me know if don't so hope developers will add this.
Have any way to count total dots from a line ?

Feature: option to specify alignment

When creating a row of widgets like "" option to specify line alignment would allow to achieve a better symmetry. Currently the gap between the first line and the text can differ from the text and the second line as it's drawn from left to right.

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.