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 / beetech_1.dart
Created January 22, 2024 09:28
beetech_1.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.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
// 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.
// Future -> Stream
// FutureBuilder -> StreamBuilder
import 'dart:convert';
import 'dart:math';
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
final data = await getData();
// get the record list of any keys, 'Score' as an example
final recordList = (data['Information'] as List)
.firstWhere((t) => (t as Map).keys.first == 'Score')['Score']
@malibayram
malibayram / dart_giris.dart
Created June 5, 2023 21:05
Bir dizi sayının toplamını hesaplayan bir uygulama yapın.
void main() {
// Bir dizi tanımlayarak içerisine bazı sayılar yerleştirelim
List<int> sayilar = [5, 10, 12, 15, 1];
// Toplam değeri tutacak bir sayi tipinde değişken tanımlayalım
int toplam = 0;
// Dizideki elemanları toplam değişkenine eklemek için `for`döngüsü oluşturalım
for (int sayi in sayilar) {
toplam = toplam + sayi;
@malibayram
malibayram / get_random_users_and_save_to_firebase_authentication_and_firestore.dart
Last active June 6, 2022 16:46
get random users from api and save to firebase authentication and firestore
import 'dart:convert';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:whisperp/consts/index.dart';
import 'package:whisperp/messaging_ui/constants.dart';
import 'package:http/http.dart' as http;
class WelcomeScreen extends StatefulWidget {
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
getData(i + 1);
}
}
Future<void> getData(int sec) async {
await Future.delayed(Duration(seconds: sec));
print("Merhaba");
name: Analyze, build and deploy for Web and Android
on:
push:
branches:
- alpha
pull_request:
branches:
- alpha
name: Take screenshots
on:
workflow_dispatch:
jobs:
android:
name: Take Android screenshots
runs-on: macos-10.15
@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;