Flutter reference (package:tryyoursize)
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 and Android SDKs. On Android your MainActivity must extend FlutterFragmentActivity. Register ios-app://<bundle id> and android-app://<package> for your key in Studio.
Install
Section titled “Install”dependencies: tryyoursize: ^0.1.0Initialize
Section titled “Initialize”import 'package:tryyoursize/tryyoursize.dart';
final tys = await TryYourSize.create('pk_test_…');Client
Section titled “Client”TryYourSize.create() |
Creates the client. |
recommendation() |
The shopper’s recommended size for a product, in your size labels. |
onRecommendation() |
The recommendation now (once known) and on every change: signing in, a new body, a simulation finishing. |
events |
Window events: ready, open, close, size, loadError. |
present() |
Opens the measuring / try-on window for a product. |
setAppearance() |
Live restyle (e.g. |
Widgets
Section titled “Widgets”SizeGuide |
The compact “Size guide” button, drawn natively: “Size guide” → “Calculating your size…” → “Your size: M”. |
Recommendation |
The shopper’s recommended size for one product, in the store’s own size labels. |
Appearance |
Like the web SDK’s (and Stripe’s) Appearance API. |
TryYourSizeException |
Every error the SDK raises: a stable code (e.g. |
Was this page helpful?
Thank you. We read every answer.