Created
November 20, 2021 18:11
-
-
Save gabrielgatu/d5e54d4c9630344a7d83e33044a261d6 to your computer and use it in GitHub Desktop.
Flutter2Start - Switch #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> { | |
bool termsAndConditionsAccepted = false; | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("Futter2Start"), | |
centerTitle: true, | |
), | |
body: Center( | |
child: body(), | |
), | |
), | |
); | |
} | |
Widget body() => SwitchListTile( | |
value: termsAndConditionsAccepted, | |
title: Text("Accetta termini e condizioni d'uso"), | |
onChanged: (value) => setState(() => termsAndConditionsAccepted = value), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment