diff --git a/README.md b/README.md index e1fa7f0..e95ebdd 100644 --- a/README.md +++ b/README.md @@ -1,283 +1,122 @@ -# Escalated for Flutter - -[](https://github.com/escalated-dev/escalated-flutter/actions/workflows/run-tests.yml) -[](https://flutter.dev/) -[](https://dart.dev/) -[](https://opensource.org/licenses/MIT) -[](https://hits.sh/github.com/escalated-dev/escalated-flutter/) - -A full-featured, embeddable support ticket UI for Flutter apps. Drop it into any Flutter project — get a complete customer-facing helpdesk with ticket management, knowledge base, guest access, and SLA tracking. Connects to the Escalated REST API. - -> **[escalated.dev](https://escalated.dev)** — Learn more, view demos, and compare Cloud vs Self-Hosted options. - -**One widget, full support experience.** Wrap your app with `EscalatedPlugin`, point it at your API, and every screen is ready — login, tickets, knowledge base, guest access. Customize colors, auth behavior, and locale with a single config object. +
+ +
+ Add a customer support area to your Flutter app.
+ Tickets, a knowledge base and guest access, talking to your Escalated backend's REST API.
+
+ Website · + Docs · + Cloud · + Changelog +
+ +
+ Every support screen, ready to route+ Login, ticket list, ticket detail with replies and SLA timers, new ticket with attachments, and knowledge base screens you drop into your GoRouter tree. + |
+
+ Fits your app instead of fighting it+ Screens take colours from your app's ThemeData, light or dark, and auth hooks let you plug in the sign-in you already have. + |
+
| -## Quick Start - -Add the dependency to your `pubspec.yaml`: - -```yaml -dependencies: - escalated: - git: - url: https://github.com/escalated-dev/escalated-flutter.git -``` - -Wrap your app with `EscalatedPlugin`: - -```dart -import 'package:escalated/escalated.dart'; - -EscalatedPlugin( - config: EscalatedConfig( - apiBaseUrl: 'https://yourapp.com/support/api/v1/mobile', - ), - child: MaterialApp.router(...), -) -``` - -That's it — your app now has a full support ticket UI. - -## Configuration - -`EscalatedConfig` accepts the following options: - -```dart -EscalatedConfig( - apiBaseUrl: 'https://yourapp.com/support/api/v1/mobile', - authHooks: myAuthHooks, - primaryColor: Color(0xFF4F46E5), - borderRadius: 12.0, - darkMode: false, - defaultLocale: 'en', -) -``` +**Tickets** +- Create, view, filter and reply +- File attachments on tickets and replies +- SLA countdown timers on ticket detail -| Option | Type | Default | Description | -|--------|------|---------|-------------| -| `apiBaseUrl` | `String` | required | Base URL for the Escalated REST API | -| `authHooks` | `EscalatedAuthHooks?` | `null` | Custom auth hook overrides | -| `primaryColor` | `Color?` | `#4F46E5` | Primary action color for buttons and accents | -| `borderRadius` | `double?` | `8.0` | Border radius for cards, inputs, and buttons | -| `darkMode` | `bool?` | `false` | Enable dark theme | -| `defaultLocale` | `String?` | `'en'` | Default locale code (`en`, `es`, `fr`, `de`) | + | +-## Theming +**Self-service** +- Searchable knowledge base with HTML articles +- Post-resolution CSAT star ratings -Every screen and widget takes its colours from the app's `ThemeData`, so they -match the host without configuration: + | +-| Element | Comes from | -|---------|------------| -| Buttons, links, ticket references, selected chips | `colorScheme.primary` | -| New-ticket button | `floatingActionButtonTheme`, else `colorScheme.primary` / `onPrimary` | -| Cards, sheets, composer | `colorScheme.surface` and its `surfaceContainer*` tones | -| Body and secondary text | `colorScheme.onSurface`, `onSurfaceVariant` | -| Borders | `colorScheme.outlineVariant` | -| Errors | `colorScheme.error` / `onError` | +**Guest access** +- Tickets without an account +- Emailed code, expiring per-ticket access -Status, priority and SLA badges keep fixed colours (`AppColors.statusColor`, -`priorityColor`, `slaRed`...), since the colour carries the meaning. -`EscalatedConfig.primaryColor` and `borderRadius` feed `AppTheme` and -`themeProvider` for apps that build their theme from Escalated's; they do not -override the app's own theme. + | +
| -## Available Screens +**Authentication** +- Override login, logout, register and token +- Built-in client with secure token storage -| Screen | Description | -|--------|-------------| -| `LoginScreen` | Email/password login form | -| `RegisterScreen` | New account registration | -| `TicketListScreen` | Paginated ticket list with status filters | -| `CreateTicketScreen` | New ticket form with file attachments | -| `TicketDetailScreen` | Full ticket thread with replies and metadata | -| `KBListScreen` | Knowledge base article listing | -| `KBArticleScreen` | Single article view with HTML rendering | -| `GuestCreateScreen` | Guest ticket submission with email verification | -| `GuestTicketScreen` | Guest ticket view by reference, using the stored access grant | -| `GuestLookupScreen` | Find a guest ticket by reference and verified email; renews access | -| `SettingsScreen` | User preferences and locale selection | -| `TicketFiltersScreen` | Advanced ticket filter controls | + | +-## Available Widgets +**Flutter integration** +- Riverpod providers for auth, tickets, KB, theme +- GoRouter-compatible screens -| Widget | Description | -|--------|-------------| -| `StatusBadge` | Ticket status indicator | -| `PriorityBadge` | Priority level indicator | -| `SlaTimer` | SLA countdown display | -| `AttachmentList` | File attachment display | -| `FileDropzone` | Drag-and-drop file upload | -| `SatisfactionRating` | Star rating display and input | -| `ReplyThread` | Chronological message thread | -| `ReplyComposer` | Reply text input with attachments | -| `EmptyState` | Placeholder for empty lists | -| `LoadingShimmer` | Shimmer loading placeholder | -| `ErrorView` | Error state with retry action | + | +-## Guest access +**Look and language** +- Takes your app's ThemeData, light or dark +- English, Spanish, French, Canadian French, German +- Configurable colour, radius, locale and API URL -Guest tickets need the guest to prove they can read their mailbox. The server -emails an eight-digit code, the app sends it back with the ticket (or with a -lookup), and the server answers with an expiring access grant for that ticket. -`GuestAccessService` runs this flow and keeps each grant in the device's secure -storage, keyed by ticket reference. Grants never appear in routes or copied -links; guest routes take the ticket reference (`/guest/ESC-00042`). + | +