Created
December 25, 2019 06:00
-
-
Save tirth-aubergine/37def66ae352e2c50a8d56872661d338 to your computer and use it in GitHub Desktop.
Slider + Emoji - main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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