Skip to content

Latest commit

 

History

History
44 lines (40 loc) · 1.37 KB

README.md

File metadata and controls

44 lines (40 loc) · 1.37 KB

Weight Slider Widget for Flutter

Pub Version License: MIT

✨ Demo

weight slider

🚀 Usage

class _MyHomePageState extends State<MyHomePage> {
  int weight = 70;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Padding(
          padding: EdgeInsets.all(64),
          child: WeightSlider(
            weight: weight,
            minWeight: 40,
            maxWeight: 120,
            onChange: (val) => setState(() => this.weight = val),
            unit: 'kg', // optional
          ),
        ),
      ),
    );
  }
}

📝 License

This project is MIT licensed.