Giter Site home page Giter Site logo

janstol / signal_strength_indicator Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 4.42 MB

Customizable signal strength indicator widget for Flutter

License: MIT License

Kotlin 0.66% Swift 1.00% Objective-C 0.09% Dart 94.47% HTML 3.78%
flutter flutter-package flutter-widget

signal_strength_indicator's People

Contributors

casabian avatar janstol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

casabian

signal_strength_indicator's Issues

Thresholds outside of minValue/maxValue are removed.

According to the documentation, you can specify levels like this:

SignalStrengthIndicator.bars(
  value: val,
  minValue: 0,
  maxValue: 100,
  levels: <num, Color>{
    0.25: Colors.red,
    0.50: Colors.yellow,
    0.75: Colors.green,
  },
)

However, if the minValue and maxValue do not contain the levels as specified in levels, they will be removed. This doesn't make sense, since the min/max could be an entirely different range than the levels. For example, this will not use any of the specified levels because they will be removed:

SignalStrengthIndicator.bars(
  value: client["signal"],
  spacing: 0.3,
  minValue: -88,
  maxValue: -30,
  levels: <num, Color>{
    0.12: Colors.red,   // These levels will all be removed, because they fall outside of the min/max range!
    0.21: Colors.yellow,
    0.39: Colors.green, 
    0.65: Colors.green, 
    0.87: Colors.green,
  }, 
),

I believe the one line fix is to just remove:

.removeWhere((key, _) => key < style.minValue || key > style.maxValue);

Widget not rendered on value change

Repaint will not be handled on value change. In the example case repainting is handled as you are using a Stateful widget.
Using stateless widgets together with BLoC or RxDart will prevent the widget from repainting.

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.