Skip to content

Instantly share code, notes, and snippets.

@gabrielgatu
Created November 20, 2021 18:13
Show Gist options
  • Save gabrielgatu/de7808b3a4c6579a130b72fb726edee8 to your computer and use it in GitHub Desktop.
Save gabrielgatu/de7808b3a4c6579a130b72fb726edee8 to your computer and use it in GitHub Desktop.
Flutter2Start - Slider #flutter2start
// 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