Skip to content

Instantly share code, notes, and snippets.

View malibayram's full-sized avatar
🏠
Working from home

M. Ali Bayram malibayram

🏠
Working from home
  • DersHub
  • Turkey
View GitHub Profile
// static => bu kelimenin en temel varlık sebebi sınıftaki method veya property'e sınıftan örnek
// oluşturmadan erişmektir.
// factory => bu kelime sayesinde constructor methoduna müdahale imkanı elde ederiz.
class Kitap {
final String baslik;
static int? toplamKitapSayisi;
static toplamdanDus() {
import 'package:flutter/material.dart';
// 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.
// primitive (değer tipler) variables = değişkenler
// sayılar num, int, double
// metinsel ifadeler string
// evet-hayır ifadeleri bool
// 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() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
extension StringExts on String {
String toLowerCaseTr() {
return replaceAll('I', 'ı').replaceAll('İ', 'i').toLowerCase();
}
}
void main() {
runApp(
@malibayram
malibayram / bau_flutter_firebase.dart
Created December 14, 2021 19:32
Bahçeşehir Üniversitesi WIE(Women in Engineering) Komitesi ile 14 Aralık 2021'ta gerçekleştirdiğimiz etkinlikte yazdığımız kodlar
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() async {
try {
WidgetsFlutterBinding.ensureInitialized();
// 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';
import 'dart:math' show Random;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(primarySwatch: Colors.indigo),
home: MyHomePage(),
),
);
}
// Burada bir fonksiyon tanımı görüyoruz.
void sayiYazdir(int sayi) {
// print ifadesini derinlemesine öğrenmek isteyenler => System call
print("The number is $sayi"); // Print to console.
}
int toplamaIslemiYap(int sayi1, int sayi2) {
return sayi1 + sayi2;
}
// 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());
// 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.
// calback => başka bir fonksiyona parametre olarak gönderilen fonksiyon
// Birinci yönü kullanım şekli
// İkinci yönü ise tanımlanma şekli
import 'dart:io';