# Flutter

`talaria_flutter` **0.3.1** re-exports [`talaria`](https://docs.newtalaria.com/sdk/dart.md). Flutter init accepts only a publishable `tal_pk_…` key, from `--dart-define=TALARIA_BROWSER_API_KEY`. A `tal_sk_` or `tal_mon_` key disables Talaria with one warning. The app still runs, and no error hooks are installed.

## Install

```yaml
dependencies:
  talaria_flutter: ^0.3.1
```

## Initialise

```dart
import 'package:flutter/material.dart';
import 'package:talaria_flutter/talaria_flutter.dart';

Future<void> main() async {
  await TalariaFlutter.runZonedApp(
    TalariaOptions(
      apiKey: const String.fromEnvironment('TALARIA_BROWSER_API_KEY'),
      minLevel: SeverityLevel.warning,
    ),
    const MyApp(),
  );
}
```

Pass `TalariaNavigatorObserver` on `MaterialApp`. Leave `url` unset to use `https://ingest-<cell>.newtalaria.com`.

## Verify

```dart
await Talaria.captureException(Exception('Talaria test error'), stackTrace: StackTrace.current);
```

Run this once, then open **Issues** in the [dashboard](https://one.newtalaria.com). The test error shows as a new issue in the key's environment. Nothing there? See [troubleshooting](https://docs.newtalaria.com/sdk/flutter/troubleshooting.md).

## Next

See [configuration](https://docs.newtalaria.com/sdk/flutter/configuration.md), [errors](https://docs.newtalaria.com/sdk/flutter/errors.md), [tracing](https://docs.newtalaria.com/sdk/flutter/tracing.md), [navigation](https://docs.newtalaria.com/sdk/flutter/navigation.md), and [troubleshooting](https://docs.newtalaria.com/sdk/flutter/troubleshooting.md).
