An end-to-end Flutter example showing how to upload a video to FastPix with the
fastpix_resumable_uploader SDK.
The same code runs on Android and iOS — Flutter handles the platform glue.
The example demonstrates:
- Picking a video from the device gallery (Android & iOS).
- Requesting a signed URL from the FastPix Direct Upload API.
- Uploading the video in 16 MB chunks via the builder API.
- Real-time progress, chunk counters, pause / resume / abort, and error handling.
Open lib/upload_screen.dart and replace the placeholder
constants near the top of the file:
const String _kFastPixTokenId = 'YOUR_FASTPIX_TOKEN_ID';
const String _kFastPixSecretKey = 'YOUR_FASTPIX_SECRET_KEY';You can generate these from the FastPix dashboard.
In production never ship the token + secret in the client. Proxy
POST https://api.fastpix.app/v1/on-demand/uploadthrough your own backend and only return the resultingdata.urlto the device.
cd example
flutter pub get# Android
flutter run -d android
# iOS (open ios/Runner.xcworkspace once first to set a signing team if needed)
flutter run -d iosThese are already configured in the example, but worth knowing about if you're porting this into your own app.
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/><key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to your photo library to pick a video for upload.</string>
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to record videos to upload.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access to record audio when recording video.</string>| File | What it does |
|---|---|
lib/main.dart |
App entry point and theming. |
lib/signed_url_service.dart |
Calls the FastPix Direct Upload API to mint a signed URL. |
lib/upload_screen.dart |
UI + glue code that drives FlutterResumableUploads. |
The example consumes the SDK via a path dependency in
pubspec.yaml, so any local edits to the library propagate
into the example without re-publishing:
dependencies:
fastpix_resumable_uploader:
path: ../