# Flutter reference (package:tryyoursize)

> The native Size guide button and the shopper's recommended size in Flutter, over the iOS and Android SDKs.

Source: https://docs.tryyoursize.com/reference/flutter/

*SDK* · `tryyoursize (Dart)` · v0.1.0

Flutter 3.19+ (Dart 3.3+). The button is a native platform view and the window is our window in a native sheet, from the [iOS](https://docs.tryyoursize.com/reference/ios.md) and [Android](https://docs.tryyoursize.com/reference/android.md) SDKs. On Android your `MainActivity` must extend `FlutterFragmentActivity`. Register `ios-app://<bundle id>` and `android-app://<package>` for your key in Studio.

## Install

**pubspec.yaml**

```yaml
dependencies:
  tryyoursize: ^0.1.0
```

## Initialize

**Flutter**

```dart

final tys = await TryYourSize.create('pk_test_…');
```

## Client

| | |
|---|---|
| [`TryYourSize.create()`](https://docs.tryyoursize.com/reference/flutter/create.md) | Creates the client. |
| [`recommendation()`](https://docs.tryyoursize.com/reference/flutter/recommendation.md) | The shopper's recommended size for a product, in your size labels. |
| [`onRecommendation()`](https://docs.tryyoursize.com/reference/flutter/on-recommendation.md) | The recommendation now (once known) and on every change: signing in, a new body, a simulation finishing. |
| [`events`](https://docs.tryyoursize.com/reference/flutter/events.md) | Window events: ready, open, close, size, loadError. |
| [`present()`](https://docs.tryyoursize.com/reference/flutter/present.md) | Opens the measuring / try-on window for a product. |
| [`setAppearance()`](https://docs.tryyoursize.com/reference/flutter/set-appearance.md) | Live restyle (e.g. |

## Widgets

| | |
|---|---|
| [`SizeGuide`](https://docs.tryyoursize.com/reference/flutter/size-guide.md) | The compact "Size guide" button, drawn natively: "Size guide" → "Calculating your size…" → "Your size: M". |

## Types

| | |
|---|---|
| [`Recommendation`](https://docs.tryyoursize.com/reference/flutter/recommendation-type.md) | The shopper's recommended size for one product, in the store's own size labels. |
| [`Appearance`](https://docs.tryyoursize.com/reference/flutter/appearance.md) | Like the web SDK's (and Stripe's) Appearance API. |
| [`TryYourSizeException`](https://docs.tryyoursize.com/reference/flutter/errors.md) | Every error the SDK raises: a stable code (e.g. |
