Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(const MyApp());
- }
- class MyApp extends StatelessWidget {
- const MyApp({super.key});
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Flutter Demo',
- theme: ThemeData(
- colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
- useMaterial3: true,
- ),
- 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(() {
- _counter++;
- });
- }
- void magicButton() {
- // For even numbers, divide by 2
- // For odd numbers, multiply by 3 and add 1.
- if (_counter.isEven) {
- _counter ~/= 2;
- } else {
- _counter = _counter * 3 + 1;
- }
- setState(() {});
- }
- void onTitlePress() {
- print('mhgxkhgckughc,guj');
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Theme.of(context).colorScheme.inversePrimary,
- title: Text(widget.title),
- ),
- body: ListView(
- children: <Widget>[
- const Text('SSID:'),
- const Text(
- 'balt-wi-fi',
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.bold,
- ),
- ),
- const Text('or'),
- const Text(
- 'KirillIphone',
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.bold,
- ),
- ),
- const SizedBox(height: 12),
- const Text('Password:'),
- const Text(
- 'baltartek',
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.bold,
- ),
- ),
- ///////
- const SizedBox(height: 100),
- ///////
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: _incrementCounter,
- child: const Text('добавить 1'),
- ),
- ],
- ),
- Wrap(
- children: [
- InkWell(
- onTap: onTitlePress,
- child: const Icon(
- Icons.add,
- size: 80,
- color: Color.fromARGB(255, 23, 42, 148),
- ),
- ),
- Container(
- width: 200,
- height: 300,
- margin: EdgeInsets.all(10),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(18),
- gradient:const LinearGradient(
- end: Alignment.bottomRight,
- colors: [
- Colors.blue,
- Color(0xffff8800),
- Colors.green
- ],
- ),
- ),
- ),
- const SizedBox(width: 200),
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: magicButton,
- child: const Text('магическая'),
- ),
- TextButton(
- onPressed: _incrementCounter,
- child: const Text('добавить 1'),
- ),
- TextButton(
- onPressed: _incrementCounter,
- child: const Text('добавить 1'),
- ),
- TextButton(
- onPressed: _incrementCounter,
- child: const Text('добавить 1'),
- ),
- TextButton(
- onPressed: _incrementCounter,
- child: const Text('добавить 1'),
- ),
- TextButton(
- onPressed: _incrementCounter,
- child: const Text('добавить 1'),
- ),
- ],
- ),
- ],
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement