livro_delivery_sdk 1.0.5 copy "livro_delivery_sdk: ^1.0.5" to clipboard
livro_delivery_sdk: ^1.0.5 copied to clipboard

Flutter SDK for integrating Livro delivery, tracking, QR code and payment services into Flutter applications.

livro_delivery_sdk #

Livro Delivery SDK #

Livro Delivery SDK is a Flutter package that allows third-party applications to integrate Livro's delivery services directly into their own applications.

The SDK provides a complete delivery workflow including order creation, delivery tracking, QR code generation, payment handling, and a floating bubble that lets users quickly return to an active delivery.


Features #

The SDK currently provides:

  • Create a delivery order
  • Select pickup and delivery locations
  • Real-time delivery tracking
  • QR Code generation and sharing
  • Wallet and cash payment support
  • Floating bubble for quick access to active deliveries
  • Delivery details page
  • Tracking page
  • Integration with external applications

Installation #

Add the package to your project's pubspec.yaml.

From GitHub #

dependencies:
  livro_delivery_sdk:
    git:
      url: https://github.com/Dihas-ets/livro-package
      ref: v1.0.0

Then install the package:

flutter pub get

Import the SDK:

import 'package:livro_delivery_sdk/livro_delivery_sdk.dart';

Initialization #

Before using the SDK, initialize Livro during your application's startup.

Initialize the bubble service before calling runApp().

void main() async {

  WidgetsFlutterBinding.ensureInitialized();

  await SDKBubbleService.initialize();

  LivroSDK.initialize(

    baseUrl: "YOUR_API_BASE_URL",

    token: "YOUR_API_TOKEN",

    externalApp: true,

    externalClientId: "YOUR_CLIENT_ID",

    externalClientName: "YOUR_CLIENT_NAME",

    publicKey: "YOUR_PUBLIC_KEY",

    secretKey: "YOUR_SECRET_KEY",

    onExit: () {

      LivroSDK.navigatorKey.currentState?.popUntil(
        (route) => route.isFirst,
      );

    },
  );

  runApp(const MyApp());

}

Your MaterialApp must use the SDK navigator key.

MaterialApp(
  navigatorKey: LivroSDK.navigatorKey,
)

To enable the floating delivery bubble, wrap your application with SDKFloatingBubble.

MaterialApp(

  builder: (context, child) {

    return SDKFloatingBubble(
      child: child!,
    );

  },

)

The SDK is now ready to be used.