weight_slider 1.2.2 copy "weight_slider: ^1.2.2" to clipboard
weight_slider: ^1.2.2 copied to clipboard

Customisable slider widget for retrieving a person's weight/mass.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(
        title: 'Demo',
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

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
          ),
        ),
      ),
    );
  }
}
27
likes
40
pub points
45%
popularity

Publisher

verified publishercovalsolutions.com

Customisable slider widget for retrieving a person's weight/mass.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

MIT (LICENSE)

Dependencies

flutter, flutter_svg

More

Packages that depend on weight_slider