Skip to content

Instantly share code, notes, and snippets.

@RageshAntony
RageshAntony / Error:
Last active September 20, 2022 13:18
Adding JS target to KMM project
Caused by: org.gradle.api.UnknownDomainObjectException: Extension with name 'kotlinNodeJs' does not exist.
Currently registered extension names: [ext, _internalAndroidGradlePluginDependencyCheckerRegistered]
Showing Recent Messages
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" --info --scan --stacktrace -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME -Pkotlin.native.cocoapods.archs="$ARCHS" -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
Initialized native services in: /Users/rageshantonyd/.gradle/native
Initialized jansi services in: /Users/rageshantonyd/.gradle/native
@RageshAntony
RageshAntony / MainActivity.kt
Created July 15, 2022 16:18
MainActivity not working
class MainActivity: FlutterActivity() {
private lateinit var appUpdateManager: AppUpdateManager
private val MY_REQUEST_CODE: Int = 100
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
super.onCreate(savedInstanceState, persistentState)
Toast.makeText(this, "WELCOME", Toast.LENGTH_LONG).show() // NOT CALLED
@AdaptiveAutoRouter(routes: <AutoRoute>[
AutoRoute(page: AuthMainView,initial: true),
AutoRoute(page: LoginView),
AutoRoute(page: RegisterPage),
AutoRoute(page: ThirdPage),
])
class $FlutterRouter {
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
const descText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Felis eget velit aliquet sagittis id consectetur purus ut. Faucibus scelerisque eleifend donec pretium. \n\n Id semper risus in hendrerit gravida rutrum quisque. Ultrices sagittis orci a scelerisque purus. Netus et malesuada fames ac turpis egestas integer. Urna et pharetra pharetra massa massa ultricies mi quis hendrerit. Lacus vel facilisis volutpat est velit egestas dui id. Volutpat odio facilisis mauris sit amet massa. Eu augue ut lectus arcu bibendum at varius vel. Cum sociis natoque penatibus et. Sit amet volutpat consequat mauris nunc. Vitae turpis massa sed elementum tempus egestas sed sed risus. In cursus turpis massa tincidunt dui ut ornare lectus. Vestibulum lectus mauris ultrices eros in cursus turpis massa tincidunt.';
class ThreeSegment extends Stat
@RageshAntony
RageshAntony / error
Last active December 17, 2021 06:37
FlutterMap GetX
======== Exception caught by widgets library =======================================================
The following message was thrown building Obx(has builder, dirty, state: _ObxState#e7ef9):
[Get] the improper use of a GetX has been detected.
You should only use GetX or Obx for the specific widget that will be updated.
If you are seeing this error, you probably did not insert any observable variables into GetX/Obx
or insert them outside the scope that GetX considers suitable for an update
(example: GetX => HeavyWidget => variableObservable).
If you need to update a parent widget and a child widget, wrap each one in an Obx/GetX.
The relevant error-causing widget was:
@RageshAntony
RageshAntony / App.def
Last active May 2, 2024 10:28
Kotlin/Native C Interop - Usage in Kotlin class
headers = nuklear.h App.h nuklear_glfw_gl2.h nk_defines.h /usr/include/GLFW/glfw3.h /usr/include/GLFW/glfw3native.h
compiler-options = -framework OpenGl
package = glfw
linkerOpts.osx = -L/opt/local/lib -L/usr/local/lib -lglfw
linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -lglfw -lGLU -lGL -lglut
linkerOpts.mingw = -lglfw
@RageshAntony
RageshAntony / MainActivity.kt
Last active July 9, 2021 11:57
MethodChannal ccAvenuePayment not working
class MainActivity: FlutterActivity() {
private val CHANNEL = "Method_Channel"
lateinit var inInit: OnHeadlineSelectedListener
val result = MutableLiveData<String> ().apply { value = "" }
interface OnHeadlineSelectedListener {
fun onArticleSelected(position: Int)
}
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
val streamHandlerImpl = UpdateStackMemoryStream()
@RageshAntony
RageshAntony / Enemy.cs
Created June 22, 2021 05:33
To detect the Player if he approches the enemy
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
private Rigidbody2D rigidBodyComp;
int i = 0;
float initialPos,currentPos;
private Vector2 dir = Vector2.left;
@RageshAntony
RageshAntony / CategoryService.kt
Created February 9, 2021 12:47
How to use Sealed Class Data from Flow in Swift in Kotlin Mutliplatfomr Mobile ?
@ApolloExperimental
override suspend fun getAllCategories(): CFlow<NetworkStatus<List<GetAllCategoriesQuery.Category>>> {
return flow<NetworkStatus<List<GetAllCategoriesQuery.Category>>> {
apolloClient.query(GetAllCategoriesQuery()).execute().collect {
if (it.hasErrors()) {
emit( NetworkStatus.customStatusDetailed(ErrorCaseData(404, "Apollo Error", "APP")))
}
else {
emit(NetworkStatus.data(it.data?.category as List<GetAllCategoriesQuery.Category> ) )
}