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
@malibayram
malibayram / merge_sort.dart
Created February 25, 2022 22:46 — forked from Tomic-Riedel/merge_sort.dart
An implementation of MergeSort in Dart
List<int> mergeSort(List<int> array) {
// Stop recursion if array contains only one element
if(array.length <= 1) {
return array;
}
// split in the middle of the array
int splitIndex = array.length ~/ 2;
// 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';
// 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());
// 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;
}
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(primarySwatch: Colors.indigo),
home: MyHomePage(),
),
);
}
// 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 {
@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();
import 'package:flutter/material.dart';
extension StringExts on String {
String toLowerCaseTr() {
return replaceAll('I', 'ı').replaceAll('İ', 'i').toLowerCase();
}
}
void main() {
runApp(
// 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