Skip to content

Instantly share code, notes, and snippets.

@tirth-aubergine
Created December 25, 2019 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tirth-aubergine/37def66ae352e2c50a8d56872661d338 to your computer and use it in GitHub Desktop.
Save tirth-aubergine/37def66ae352e2c50a8d56872661d338 to your computer and use it in GitHub Desktop.
Slider + Emoji - main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
double _value = 0;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Container(
child: Slider(
value: _value,
onChanged: (_newValue) => setState(() {
_value = _newValue;
}),
max: 5,
min: 0,
divisions: 5,
label: _value.toString(),
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment