Created
July 10, 2019 11:06
-
-
Save littleGnAl/8c3c637ccb9f1905c3932fdd3190fc4b to your computer and use it in GitHub Desktop.
This file contains 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 MainActivity: FlutterActivity() { | |
private val sqlDelightManager by lazy { | |
val accountingRepository = AccountingRepository(Db.getInstance(applicationContext)) | |
SqlDelightManager(accountingRepository) | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
GeneratedPluginRegistrant.registerWith(this) | |
MethodChannel(flutterView, SQLDELIGHT_CHANNEL).setMethodCallHandler { methodCall, result -> | |
@Suppress("UNCHECKED_CAST") | |
val args = methodCall.arguments as? Map<String, Any> ?: emptyMap() | |
sqlDelightManager.methodCall(methodCall.method, args) { | |
result.success(it) | |
} | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment