Skip to content

Instantly share code, notes, and snippets.

// Gelen değerleri liste olarak return eden bir fonksiyon
fun <T> addList(vararg myList: T): List<T> {
println("Gonderilen parametre sayisi: ${myList.size} ")
val result = ArrayList<T>()
for (t in myList) // Tüm liste dolaşılarak result listesine değerler atanıyor
result.add(t)
return result
}
fun main() {
addList(1)
fun outerFunction(nice: String) {
val hello = "Hello, Medium"
fun innerFunction(awesome: String) {
println(awesome)
//Bu kısımdan outerFunction'un "nice" değişkenine erişebiliriz.
println(nice)
// Ayrıca bu kısımdan outerFunction'a ait olan "hello" değişkenine erişim sağlayabiliriz.
fun sum(a : Int, b : Int) : Int {
return a + b
}
fun higherOrderSumFunction( name : String,
numberOne : Int,
numberTwo : Int,
result : (Int, Int) -> Int) {
println("$name ---> $numberOne + $numberTwo = ${result(numberOne,numberTwo)}")
}
@egeysn
egeysn / locations.dart
Last active August 14, 2022 13:01
JSON Locations Class
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
class Locations {
List<Offices> offices;
List<Regions> regions;
Locations({this.offices, this.regions});
@egeysn
egeysn / main.dart
Last active September 2, 2020 15:17
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import "locations.dart" as locations;
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
MyApp({Key key}) : super(key: key);
@override
name: googlemapswithjson
description: A new Flutter project.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
@egeysn
egeysn / activity_binding.java
Created January 10, 2022 19:32
viewBinding
public class AddAddresActivity {
//activity_add_address.xml
private ActivityAddAddressBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityAddAddressBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
@egeysn
egeysn / .gitlab-ci.yml
Last active April 6, 2022 09:07
Android Gitlab CI/CD integration.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Android.gitlab-ci.yml
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
image: openjdk:11-jdk