Created
November 20, 2021 18:13
-
-
Save gabrielgatu/de7808b3a4c6579a130b72fb726edee8 to your computer and use it in GitHub Desktop.
Flutter2Start - Slider #flutter2start
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
// ignore_for_file: use_key_in_widget_constructors, prefer_const_constructors, prefer_const_literals_to_create_immutables | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(App()); | |
} | |
class App extends StatefulWidget { | |
@override | |
_AppState createState() => _AppState(); | |
} | |
class _AppState extends State<App> { | |
double ralValue = 0; | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("Futter2Start"), | |
centerTitle: true, | |
), | |
body: Center( | |
child: body(), | |
), | |
), | |
); | |
} | |
Widget body() => Slider( | |
value: ralValue, | |
min: 0, | |
max: 100000, | |
divisions: 1000, | |
label: ralValue.toStringAsFixed(0), | |
onChanged: (value) => setState(() => ralValue = value), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment