This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/cupertino.dart'; | |
| import 'measure_size.dart'; | |
| class ClickableListWheelWidget extends StatefulWidget { | |
| final ListWheelScrollView child; | |
| final ScrollController scrollController; | |
| final double listHeight; | |
| final double itemHeight; | |
| final int itemCount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/scheduler.dart'; | |
| typedef OnWidgetSizeChange = void Function(Size size); | |
| class MeasureSize extends StatefulWidget { | |
| final Widget child; | |
| final OnWidgetSizeChange onChange; | |
| const MeasureSize({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface ProfileEntity { | |
| val pid: Long | |
| val id: Long | |
| val username: String | |
| val firstName: String | |
| val lastName: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Dao | |
| interface ProfileDao { | |
| @Insert(onConflict = OnConflictStrategy.REPLACE) | |
| fun insert(profileEntity: ProfileEntity) | |
| @Query("SELECT * FROM profile_entity WHERE pid=1") | |
| fun getProfile(): ProfileEntity? | |
| @Query("DELETE FROM profile_entity") | |
| fun deleteProfile() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val dbFile = "questsRepository.sqlite" | |
| val documentsDirectory = getAppSupportDirectory() | |
| val sqlDriver = NativeSqliteDriver( | |
| databaseManager = NativeDatabaseManager("$documentsDirectory/$dbFile", | |
| configuration = DatabaseConfiguration( | |
| name = dbFile, | |
| version = LokimoSchema.version, | |
| create = { connection -> | |
| // Core data sqlite user version always equals 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun getAppSupportDirectory() { | |
| val paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, true) | |
| val documentsDirectory = paths[0] as String | |
| val fileManager = NSFileManager.defaultManager() | |
| if (!fileManager.fileExistsAtPath(documentsDirectory)) | |
| fileManager.createDirectoryAtPath(documentsDirectory, true, null, null) //Create folder | |
| return documentsDirectory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sourceSets { | |
| iOSMain { | |
| dependencies { | |
| implementation project(":database") | |
| implementation "com.squareup.sqldelight:native-driver:$sqldelight_version" | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sourceSets { | |
| androidMain { | |
| dependencies { | |
| implementation project(":database") | |
| implementation "com.squareup.sqldelight:android-driver:$sqldelight_version" | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class QuestDaoImpl( | |
| private val queries: QuestEntityQueries | |
| ) : QuestDao { | |
| override fun insert(qp: QuestEntity) { | |
| queries.insert(qp) | |
| } | |
| override fun getQuests(): List<QuestEntity> { | |
| return queries.getQuests().executeAsList() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface QuestDao { | |
| fun insert(qp: QuestEntity) | |
| fun getQuests(): List<QuestEntity> | |
| fun getQuests(questIds: List<String>): List<QuestEntity> | |
| fun insertQuest(quest: QuestEntity) | |
| fun getQuestById(questId: String): QuestEntity? | |
| fun deleteQuestById(questId: String) | |
| fun deleteQuests() | |
| fun getQuestCount(): Int | |
| } |
NewerOlder