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
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
// 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() {
@malibayram
malibayram / SudokuSolver.dart
Created May 31, 2021 15:02
https://youtu.be/8ext9G7xspg?t=6715 python ile anlatılan sudoku çözme ileminin dart ile kodlanması
// https://youtu.be/8ext9G7xspg?t=6715
List findNextEmpty(List<List<int>> sudoku) {
for (int r = 0; r < 9; r++) {
for (int c = 0; c < 9; c++) {
if (sudoku[r][c] == 0) {
return [r, c];
}
}
}
@malibayram
malibayram / covid.dart
Created April 28, 2021 15:46
Mustafa Yıldız tarafından 28 Nisan 2021'de Discord'ta sorduğu soruya cevap olarak oluşturuldu
class Covid {
String? patients;
String? totalPatients;
String? deaths;
String? totalDeaths;
String? recovered;
String? totalRecovered;
String? totalIntubated;
String? totalIntensiveCare;
// Dart bir yazılım dilidir.
// Flutter ise Dart dili kullanılarak hazırlanmış bir kod çerçevesidir (Framework).
// Arayüz UI -> (User interface) geliştirme aracıdır
// import içe al -> ithat et
// export dışa aktar -> ihracat yap
import 'package:flutter/material.dart';
void main() {
// runApp -> uygulama çalıştır
void main() {
// String
print("tırnak içinde belirtilen verilerin tipi String'tir");
// int
print(234.runtimeType);
// double
print(2.34.runtimeType);
// bool => boolean
// reserve edilmiş kelime veya kelime gruplar
// küçük büyük harf duyarlı
// Compiler => derleyici => mütercim
// main => ana
// işlem tanımlama
// 1. İşleme isim veriyoruz
// 2. a. işlem olduğunu belirtmek için parantez açıp kapatıyoruz
// 2. b. işlemde işlenmesini istediğimiz şey(ler) var ise bunları parantez içinde yazıyoruz.
// 3. yapılacak işleri süslü parantezler içine yazıyoruz
import 'dart:convert';
import 'package:flutter/material.dart';
main() => runApp(MaterialApp(home: LocalJsonKonusu()));
class LocalJsonKonusu extends StatefulWidget {
@override
State<StatefulWidget> createState() => LocaleState();
}
@malibayram
malibayram / workshop.dart
Last active December 13, 2020 17:19
13 Aralık 2020'de yazdığımız kodlar
// 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';
// slayt linki: https://docs.google.com/presentation/d/1tuiMbSNSipgOyc-bp-_sTh3u7aCj0Wo07KV7eDAoDuM/
// önceki ve çalışmayacak olan link: https://dartpad.dev/b6409e10de32b280b8938aa75364fa7b
// çalışan link
// 1. Sıralı ve hepsi zorunlu
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Projem',