Skip to content

Instantly share code, notes, and snippets.

@fractalwrench
Created October 17, 2022 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fractalwrench/dcdcae58e8ef2dd92d38cf9fbb3a37ca to your computer and use it in GitHub Desktop.
Save fractalwrench/dcdcae58e8ef2dd92d38cf9fbb3a37ca to your computer and use it in GitHub Desktop.
Flutter question
// Task: Develop 'breadcrumbs' in a simplified implementation of Embrace's
// Flutter SDK.
//
// A 'breadcrumb' is an arbitrary log message that developers can
// leave at any point in an application. These are then displayed on Embrace's
// dashboard in time order - and can be invaluable for debugging why an error
// happened.
//
// You can assume that the Dart code will be the only place that breadcrumbs
// are logged by developers. You should also assume that the breadcrumbs
// need passing to the Android/iOS SDKs so that state is appropriately
// synchronized.
//
class Embrace {
static EmbracePlatform _instance = MethodChannelEmbrace();
void logBreadcrumb(String message) {
// TODO implement me
}
}
abstract class MethodChannelEmbrace extends PlatformInterface {
static MethodChannelEmbrace _instance = MethodChannelEmbrace();
static MethodChannelEmbrace get instance => _instance;
void logBreadcrumb(String message) {
// TODO implement me
}
}
//
// Android/iOS SDK method call handlers
//
public class EmbracePlugin : FlutterPlugin, MethodCallHandler {
// communicates with the Android SDK
val androidInterface: EmbraceAndroidSdk
public override fun onMethodCall(call: MethodCall, result: Result) : Unit {
// TODO implement me
}
}
@implementation EmbracePlugin {
@property EmbraceIosSdk *iosInterface;
}
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
// TODO implement me
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment