Skip to content

Instantly share code, notes, and snippets.

@gabrielgatu
Last active November 20, 2021 16:15
Show Gist options
  • Select an option

  • Save gabrielgatu/bf53536bbeb97c516cb8a2d95f979e5a to your computer and use it in GitHub Desktop.

Select an option

Save gabrielgatu/bf53536bbeb97c516cb8a2d95f979e5a to your computer and use it in GitHub Desktop.
Flutter2Start - Componenti custom #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 StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(value: 25),
);
}
}
class HomePage extends StatefulWidget {
final int value;
const HomePage({required this.value});
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
int value = 0;
@override
void initState() {
value = widget.value;
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text(
"Persone in lista d'attesa: $value",
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment