publishable_core 0.0.7
publishable_core: ^0.0.7 copied to clipboard
Framework-agnostic, minimal dependencies, and pure Dart package for implementing Publishable in your app.
publishable_core #
publishable_core is a pure Dart package that allows you to send data from your project directly to the Publishable console.
| Status | Comments |
|---|---|
| Current stable Flutter version | |
| Current beta Flutter version | |
| The oldest supported Flutter version |
Getting started #
- Add this package to your dependencies.
dependencies:
publishable_core: latest_version
- Get the dependencies.
dart pub get
- Create a new instance with your API key and
PublishableIdentity.
final publishable = Publishable(
// TODO: Replace with your Publishable API key.
token: 'xxxx-xxxx-xxxx-xxxx',
// TODO: Fill user's data.
identity: PublishableIdentity(
// ...
),
);
Usage #
The library doesn't include any opinionated dependency injection solution or third-party dependencies, and is intended for use for advanced users.
Note
If you want to use Publishable in Flutter with as little effort as possible, consider using package:publishable instead. It creates PublishableIdentity for you, and allows you to get Publishable from context.
import 'package:publishable_core/publishable_core.dart';
Future<void> main() async {
final publishable = Publishable(
// TODO: Replace with your Publishable API key.
token: 'xxxx-xxxx-xxxx-xxxx',
// TODO: Replace with user's data (or use `publishable` package instead).
// See more: https://pub.dev/packages/publishable
identity: PublishableIdentity(
id: const IdData(
uuid: 'xxxx-xxxx-xxxx-xxxx',
),
app: AppData(
platform: AppPlatform.current,
libVersion: Publishable.libVersion,
version: '1.0.0',
build: 1,
store: 'Huawei AppGallery',
),
device: const DeviceData(
model: 'Pixel 5',
osVersion: '12',
locale: 'en_US',
),
),
);
// Submit user's feedback.
await publishable.sendFeedback(
'Awesome!',
// ⬇️ A screenshot ⬇️
// attachment: UInt8List,
// ⬇️ Extra data ⬇️
// properties: Map<String, dynamic>,
);
}
Additional information #
- This package requires at least Dart 3.5 to work.
- If there are any issues feel free to go to GitHub Issues and report a bug.