Created
February 4, 2022 18:41
-
-
Save malibayram/9dc897b7a1b1d02dd45b79a4fd2442bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
| // for details. All rights reserved. Use of this source code is governed by a | |
| // BSD-style license that can be found in the LICENSE file. | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| sayiYazdir(sayi1: 5); | |
| runApp(BenimWidgetim()); | |
| } | |
| class BenimWidgetim extends StatelessWidget { | |
| Widget build(BuildContext baglam) { | |
| return MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| home: DurumluWidget(), | |
| ); | |
| } | |
| } | |
| class DurumluWidget extends StatefulWidget { | |
| State createState() { | |
| return DurumWidgetininDurumu(); | |
| } | |
| } | |
| class DurumWidgetininDurumu extends State { | |
| // YAGNI | |
| int sayac = 0; | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar(title: const Text("İlk Flutter Uygulamam")), | |
| body: Column( | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| crossAxisAlignment: CrossAxisAlignment.center, | |
| children: [ | |
| Row( | |
| children: [ | |
| Center(), | |
| const Text("Artı butonuna şu kadar bastınız:"), | |
| Text( | |
| "$sayac", | |
| style: Theme.of(context).textTheme.headline4, | |
| ), | |
| ], | |
| ), | |
| const Center( | |
| child: Text("Artı butonuna şu kadar bastınız:"), | |
| ), | |
| Text( | |
| "$sayac", | |
| style: Theme.of(context).textTheme.headline1, | |
| ), | |
| ], | |
| ), | |
| floatingActionButton: FloatingActionButton( | |
| onPressed: () { | |
| print("İkona tıklandı"); | |
| print(sayac); | |
| setState(() { | |
| sayac++; | |
| }); | |
| }, | |
| child: Icon(Icons.add), | |
| ), | |
| ); | |
| } | |
| } | |
| void sayiYazdir({required int sayi1, int sayi2 = 4}) { | |
| print("Merhaba Dünya!"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment