FLUTTER ECOSYSTEM

ltdangkhoa/Flutter-Speedometer

Flutter 速度表小部件包

Flutter-Speedometer 项目封面
Stars
14
Forks
11
最近推送(UTC)
2022年2月11日
项目状态
未归档
Kris GitHub avatar
GITHUB User

Kris ↗

@VNAppMob
语言DartObjective-CJava

技术话题

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

flutter_speedometer

Flutter Speedometer widget package

https://raw.githubusercontent.com/ltdangkhoa/Flutter-Speedometer/HEAD/flutter_speedometer_2.png

Getting Started

In order to use this package, do import

import 'package:flutter_speedometer/flutter_speedometer.dart';

Basic implementation can be done like below code:

import 'package:flutter/material.dart';
import 'package:flutter_speedometer/flutter_speedometer.dart';

void main() {
  runApp(
    Center(
      child: Speedometer(
        size: 250,
        minValue: 0,
        maxValue: 180,
        currentValue: 76,
        warningValue: 150,
        displayText: 'mph',
      ),
    ),
  );
}
Example App

You can find more examples from Example App

API

In this table, you can find all attributes provided by this package:

Attribute Default value Description
size 200 Min value to be displayed
minValue 0 Min value to be displayed
maxValue 100 Max value to be displayed
currentValue 0 Set the current value
warningValue 80 Set the current value
Objects
class Speedometer {

    final double size;
    final int minValue;
    final int maxValue;
    final int currentValue;
    final int warningValue;
    final Color backgroundColor;
    final Color meterColor;
    final Color warningColor;
    final Color kimColor;
    final TextStyle displayNumericStyle;
    final String displayText;
    final TextStyle displayTextStyle;
}
Feedback

Feel free to leave any feedback for helping support this package 🍻