Skip to content

Instantly share code, notes, and snippets.

View sergicastellsague's full-sized avatar

Sergi Castellsagué sergicastellsague

  • Stuart
  • Barcelona
View GitHub Profile
stage('Run tests in parallel') {
parallel {
stage('SE Tests 1 / 5') {
agent {
docker {
registryCredentialsId 'REGISTRY_CREDENTIALS'
image env.DOCKER_IMAGE_NAME
registryUrl 'https://private_registry'
args "-u root:root -m 4300m --cpus='1.5'"
}
private fun createNativeView(handle: Long) {
FlutterMain.ensureInitializationComplete(this, arrayOf())
val nativeView = FlutterNativeView(this, true)
val callback = FlutterCallbackInformation.lookupCallbackInformation(handle)
nativeView.runFromBundle(FlutterRunArguments().apply {
bundlePath = FlutterMain.findAppBundlePath(this@Service)
libraryPath = callback.callbackLibraryPath
entrypoint = callback.callbackName
@sergicastellsague
sergicastellsague / MainActivity.kt
Last active May 13, 2023 08:29
Belongs to medium article
class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
MethodChannel(flutterView, "android_app_retain").apply {
setMethodCallHandler { method, result ->
if (method.method == "sendToBackground") {
moveTaskToBack(true)
}
@sergicastellsague
sergicastellsague / main_screen.dart
Last active January 25, 2022 07:09
Belongs to medium article
class MainScreen extends StatefulWidget {
State createState() => MainScreenState();
}
class MainScreenState extends State<MainScreen> {
var _androidAppRetain = MethodChannel("android_app_retain");
@override
void initState() {
super.initState();