Skip to content

Instantly share code, notes, and snippets.

You don't know me, you're about to...

Necati Sözer necatisozer

You don't know me, you're about to...
View GitHub Profile
View PhotoEditScreen.kt
* Copyright 2023 Lyrebird Studio
package com.lyrebirdstudio.facelab.ui.photoedit
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.AnimatedVisibilityScope
import androidx.compose.animation.EnterTransition
View BindingAdapterInitializer.kt
class BindingAdapterInitializer @Inject constructor(
private val bindingAdapter: GenericBindingAdapter
) : ApplicationInitializer {
override fun invoke(context: Context) {
DataBindingUtil.setDefaultComponent(object : DataBindingComponent {
override fun getGenericBindingAdapter() = bindingAdapter
View view_date_time_picker.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="">
View MaterialDialog.kt
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.widget.DatePicker
import android.widget.TimePicker
import androidx.annotation.CheckResult
View JsonObject.kt
import org.json.JSONException
import org.json.JSONObject
fun jsonOf(vararg pairs: Pair<String, Any?>) = JSONObject().apply {
for ((key, value) in pairs) {
when (value) {
is Boolean -> put(key, value)
is Double -> put(key, value)
is Int -> put(key, value)
necatisozer / change_notifier_provider_builder.dart
Last active April 26, 2020 02:07
A ChangeNotifierProvider wrapper for consuming the value immediately.
View change_notifier_provider_builder.dart
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
typedef Build<T> = Widget Function(BuildContext context, T value, Widget child);
/// A [ChangeNotifierProvider] wrapper for consuming [T] value immediately.
/// ## Creating a [ChangeNotifierProviderBuilder]
View response.dart
class Response {
List<Data> data;
Response.fromJson(Map<String, dynamic> json) {
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));