height_slider 1.3.1 copy "height_slider: ^1.3.1" to clipboard
height_slider: ^1.3.1 copied to clipboard

outdated

Customisable slider widget for retrieving a person's height.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:height_slider/height_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 height = 170;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: HeightSlider(
          height: height,
          onChange: (val) => setState(() => height = val),
          unit: 'cm', // optional
        ),
      ),
    );
  }
}
24
likes
40
pub points
0%
popularity

Publisher

verified publishercovalsolutions.com

Customisable slider widget for retrieving a person's height.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

MIT (license)

Dependencies

flutter, flutter_svg

More

Packages that depend on height_slider