PMD_Kouvshinoff_PIbd_31/lib/main.dart

68 lines
1.4 KiB
Dart
Raw Permalink Normal View History

2024-09-15 21:21:25 +04:00
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
2024-09-15 21:37:26 +04:00
@override
2024-09-15 21:21:25 +04:00
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
2024-09-15 21:37:26 +04:00
primarySwatch: Colors.blue,
2024-09-15 21:21:25 +04:00
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
2024-09-15 21:37:26 +04:00
_counter++;
2024-09-15 21:21:25 +04:00
});
}
@override
Widget build(BuildContext context) {
2024-09-15 21:37:26 +04:00
return Scaffold(
2024-09-15 21:21:25 +04:00
appBar: AppBar(
2024-09-15 21:37:26 +04:00
title: Text("Кувшинов Тимур Александрович"),
2024-09-15 21:21:25 +04:00
),
body: Center(
2024-09-15 21:37:26 +04:00
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
2024-09-15 21:21:25 +04:00
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
2024-09-15 21:37:26 +04:00
),
);
2024-09-15 21:21:25 +04:00
}
}