Flutter - Dart

Зікір салу

main.dart

				
					import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: CounterPage(),
    );
  }
}

class CounterPage extends StatefulWidget {
  @override
  _CounterPageState createState() => _CounterPageState();
}

class _CounterPageState extends State<CounterPage> {
  int counter = 0;

  void incrementCounter() {
    setState(() {
      counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Зікір салу'),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              'Лә иләһә иллаллаһ, Мухаммадур расулуллаһ',
              style: TextStyle(fontSize: 24),
            ),
            SizedBox(height: 50),
            Text(
              'Алладан басқа тәңірі жоқ, Мұхаммед оның елшісі',
              style: TextStyle(fontSize: 24),
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: incrementCounter,
        child: Text(
          '$counter',
          style: TextStyle(fontSize: 24),
        ),
      ),
    );
  }
}