swaarm_sdk 0.1.4
swaarm_sdk: ^0.1.4 copied to clipboard
Swaarm SDK
Swaarm SDK #
Installation #
flutter pub add swaarm_sdk
Configuration #
in android/app/build.gradle, set android.defaultConfig.minSdkVersion
to 18
and dependencies.implementation
to "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0"
...
android {
...
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.test123"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 18
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0"
}
copied to clipboard
In your main.dart, init the swaarm client singleton with the factory method await SwaarmClient.init("<domain>", "<token>");
inside your main method.
In the same file inside the build function returning the Widget, set the context SwaarmClient.context = context;
and wrap the App with a RepaintBoundary.
void main() async {
runApp(const TabBarApp());
var sc = await SwaarmClient.init("<domain>",
"<token>");
}
class TabBarApp extends StatelessWidget {
const TabBarApp({super.key});
@override
Widget build(BuildContext context) {
SwaarmClient.context = context;
return RepaintBoundary(
child: MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const TabBarExample(),
)
);
}
}
copied to clipboard