monigo_portal 0.1.0
monigo_portal: ^0.1.0 copied to clipboard
Embeddable customer-portal widgets for Monigo — invoices, bills, subscriptions, wallets, payment methods, and payout accounts.
monigo_portal #
Embeddable customer-portal widgets for Monigo. Full billing experience — invoices, bills, subscriptions, wallets, payment methods, payout accounts — in a single Flutter widget.
Installation #
dependencies:
monigo_portal: ^0.1.0
Or via CLI:
flutter pub add monigo_portal
Quick start #
import 'package:monigo_portal/monigo_portal.dart';
// Five-line integration:
MonigoPortal(portalToken: token)
Full example #
import 'package:flutter/material.dart';
import 'package:monigo_portal/monigo_portal.dart';
class MyApp extends StatelessWidget {
const MyApp({super.key, required this.portalToken});
final String portalToken;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: MonigoPortal(
portalToken: portalToken,
onUnauthorized: () {
// Redirect to login
},
),
),
);
}
}
Theming #
Wrap your app (or any subtree) with MonigoThemeProvider to inject Monigo's design tokens into Flutter's ThemeData:
MonigoThemeProvider(
monigoTheme: MonigoTheme.light.copyWith(
primary: const Color(0xFF0EA5E9), // override brand colour
),
child: MonigoPortal(portalToken: token),
)
Building-block usage #
Mount individual widgets standalone without the full portal shell:
import 'package:monigo_portal/monigo_portal.dart';
// Wrap with MonigoScope to provide the API client
MonigoScope(
client: PortalClient(portalToken: token),
messages: createMessages(),
locale: const Locale('en', 'US'),
child: InvoiceList(
limit: 10,
onInvoiceTap: (invoice) => Navigator.push(...),
),
)
Platform permissions #
PayInvoiceButton and FundWalletButton open payment redirect URLs via url_launcher. Add the following to your project:
Android (android/app/src/main/AndroidManifest.xml):
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>
iOS (ios/Runner/Info.plist) — no additional entries needed for https:// URLs.
Package vs hosted portal vs web packages #
monigo_portal (this package) |
Hosted portal | @monigo/svelte / @monigo/react |
|
|---|---|---|---|
| Platform | Flutter / Dart | Web (iframe) | Web (Svelte / React) |
| Customisation | Full — ThemeExtension, widget-level overrides |
Limited CSS variables | Full — CSS custom properties |
| Offline / native | Yes | No | No |
| Pub.dev | Yes | N/A | npm |