Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧

Fevzi Ömür Tekin fevziomurtekin

🎧
View GitHub Profile
View Mutation.kt
@Component
class Mutation (private val covidDao: CovidDao) : GraphQLMutationResolver{
fun createCovid(date:String,death:String,recovered:String,test:String)
= covidDao.newData(date,death,recovered,test)
fun deleteCovid(id:String)
= covidDao.deleteData(id)
}
View CovidQuery.kt
package com.fevziomurtekin.sample.graphql.query
import com.coxautodev.graphql.tools.GraphQLQueryResolver
import com.fevziomurtekin.sample.dao.CovidDao
import org.springframework.stereotype.Component
@Component
class CovidQuery(private val covidDao: CovidDao) : GraphQLQueryResolver {
fun allContent() = covidDao.findAll()
View covidquery.graphqls
type Query {
version:String!
# Get all content
allContent:[Covid]
# Get content by date
allContentByDate(date:String): Covid
}
View CovidDao.kt
package com.fevziomurtekin.sample.dao
import com.fevziomurtekin.sample.data.Covid
import com.fevziomurtekin.sample.repository.CovidRepository
import org.bson.types.ObjectId
import org.springframework.stereotype.Component
import java.util.*
@Component
class CovidDao (private val covidRepository: CovidRepository){
View CovidRepository.kt
package com.fevziomurtekin.sample.repository
import com.fevziomurtekin.sample.data.Covid
import org.springframework.data.mongodb.repository.MongoRepository
import org.springframework.stereotype.Repository
@Repository
interface CovidRepository : MongoRepository<Covid,String> {
View Covid.kt
package com.fevziomurtekin.sample.data
import com.fevziomurtekin.sample.core.Env
import org.bson.types.ObjectId
import org.springframework.beans.factory.annotation.Value
import org.springframework.data.annotation.Id
import org.springframework.data.mongodb.core.mapping.Document
@Document(collection = Env.collection_covid)
data class Covid(
View animated_container.dart
import 'dart:async';
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
@fevziomurtekin
fevziomurtekin / leak.txt
Created May 21, 2019
Toast$TN.mNextView error
View leak.txt
In com.kuarkdijital.tirassepetim:1.0:1.
* com.kuarkdijital.tirassepetim.ui.products.ProductsFragment has leaked:
* Toast$TN.mNextView
* ↳ LinearLayout.mContext
* ↳ MainActivity.!(tmpBrandResultTextView)!
* ↳ AppCompatTextView.mListenerInfo
* ↳ View$ListenerInfo.mOnClickListener
* ↳ ProductsFragment$onClick$1$3.this$0 (anonymous implementation of android.view.View$OnClickListener)
* ↳ ProductsFragment$onClick$1.this$0 (anonymous implementation of java.lang.Runnable)
* ↳ ProductsFragment
View BaseApplication.kt
Class BaseApplication : Application(), HasActivityInjector {
@Inject
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Activity>
override fun activityInjector() = dispatchingAndroidInjector
fun initDagger() {
DaggerAppComponent
.builder()
.application(this)
View ActivityModule.kt
@Module
abstract class ActivityModule {
@ContributesAndroidInjector(modules = [FragmentModule::class])
abstract fun contributeMainActivity(): MainActivity
//Add your other activities here
}