fast_sea 0.9.6
fast_sea: ^0.9.6 copied to clipboard
A Flutter UI library built on liquid_glass_widgets & GetX, providing Sea-prefixed reusable components: glass cards, buttons, toast, loading, refresh lists, ads, and more.
fast_sea #
A Flutter UI library built on liquid_glass_widgets & GetX, providing Sea-prefixed reusable components: glass cards, buttons, toast, loading, refresh lists, settings / file-manager pages, ads, remote config, Supabase auth, Firebase analytics, and more.
Features #
- 🚀 One Widget Setup —
SeaAppwidget configures everything: ads, Firebase, Supabase, glass theme, background, loading - 🫧 Glass Widgets — Full wrapping of
liquid_glass_widgets1.14 withSea-prefixed API - 📱 Page Base —
SeaAppPageis the whole page skeleton: iOS 27 large- or compact-title chrome, a glass bar that materialises as you scroll, the page gutter and the bottom clearance — plus loading / empty / error and both pull gestures, all derived from two callbacks - 🎨 Theme System —
SeaColors,SeaTextStyles,SeaGlassThemewith light/dark support - 🍞 Toast & Loading —
Sea.toast.success(),Sea.loading.show(),Sea.loading.task()— iOS 27 glass style, landing as a HUD in the middle of the screen - ✂️ Terse calls —
seaToastSuccess(),seaLoadingTask(),seaLoge(), … the same API flat, so an app never has to wrap fast_sea to get a short call - 📝 One-line logs —
[23:41:02.318][E] [AUTH] Sign in failed — BadCredentials, with history for the built-in debug page - ⚡ Loading Task —
Sea.loading.task<T>()wraps async operations with auto loading/dismiss - 🔄 Refresh —
SeaRefreshWidgetwith pull-down refresh & pull-up load more - 📄 Page Mixin —
SeaPageMixin<T, F>for paginated data loading - 📃 List Controller —
SeaListController<T>paginates and repaints by itself; the page just indexesseaData.SeaListPager<T>+SeaListHostare the same thing for a screen with several lists on one controller - 📄 Status Mixin —
SeaStatusMixin<T>for loading/error/empty three-state pages - 📢 Ads —
SeaAdsWidget.banner()/.showInterstitial()/ rewarded / app-open, with one policy (SeaAdsPolicy) deciding cooldown, daily caps and the first-launch skip; the page banner slot is built in, so a screen never hand-places a second banner - 🧰 Ready-made Pages —
SeaGlassSettingsPage(appearance + language + storage + about, one call) andSeaFileManagerPage(browse / search / multi-select / share / delete the files the app owns) - 📡 Remote Config — one hosted JSON drives announcements, the update gate, maintenance mode, feature
flags and every ad switch;
Sea.remotereads it,SeaAppapplies it. Seedoc/REMOTE_CONFIG.md - 🔐 Supabase Auth —
SeaSupabasewith login, signup, OAuth, password reset, iOS 27-style auth UI - 📊 Firebase Analytics —
SeaAnalyticswith event logging, screen tracking - 🛠 Services —
SeaLog,SeaDevice,SeaStorage,SeaHttp,SeaConnectivity,SeaPermission,SeaRating - 🎯 GetX — State management & navigation via
get - 🌓 Theme Switching —
Sea.theme.toggle()/Sea.theme.setLight()/Sea.theme.setDark() - 📱 iOS 27 Auth UI —
SeaAuthPagewith glass morphism login/signup/forgot password flows, centered glass dialog viaSea.dialog.loginDialog() - 🌐 WebView —
SeaWebViewwith iOS-style browser chrome, smooth progress indicator, navigation controls, and native system sharing - 📋 App Identity & About — reusable
SeaAppIconuses the configured app icon with a built-in fallback;SeaGlassAboutPageincludes privacy policy and user agreement links - ⚙️ App Info Config —
SeaAppInfoConfigfor app name, icon path, privacy/agreement URLs, default email - 🌍 i18n —
SeaLocaleServicewith GetX translations, per-locale on-demand JSON loading, 300+ locales (all world languages), built-in + app-level merge - 📁 Files & Cache —
Sea.fileunified file directory: pick file/image/video/audio, camera capture, save (system panel or straight intoDownload/), share, open, cache size & clearing - 🖼 Image —
SeaImageWidgetwith automatic width/height from ratio, cached network images, asset & local-file support
Demo App #
A full demo app is available in the example/ directory, showcasing all 60+ components with iOS 27 glass morphism style.
cd example && flutter run
Demo Structure #
| Tab | Content |
|---|---|
| Library | All library code usage: Services API, App Info, Buttons, Input, Feedback, Display, Typography, Colors, Theme, Glass Effects, Navigation, Overlays & Sheets, Mixins & Utilities |
| Apple Apps | iOS 27-style recreations: Messages, Weather, Notes, Music, Settings, Safari (WebView), Auth (Dialog + Full Page) |
Quick Start #
1. Install #
Add to your pubspec.yaml:
dependencies:
fast_sea: ^0.9.6
Requires Flutter ≥ 3.41.0 / Dart ^3.11.0 — the floor is set by
liquid_glass_widgets (≥3.41) and the media stack, not by this library.
2. Import #
import 'package:fast_sea/fast_sea.dart';
3. Use SeaApp — That's It! #
void main() {
runApp(const SeaApp(
title: 'My App',
home: HomePage(),
// Optional: AdMob (grouped config)
adsConfig: SeaAdsConfig(
googleBannerKey: 'ca-app-pub-xxx/yyy',
googleAppOpenKey: 'ca-app-pub-xxx/yyy',
googleRewardKey: 'ca-app-pub-xxx/yyy',
googlePageKey: 'ca-app-pub-xxx/yyy',
),
// Optional: Firebase (grouped config)
firebaseConfig: SeaFirebaseConfig(
enabled: true,
analytics: true,
// FlutterFire-generated options; SeaApp calls
// `Firebase.initializeApp(options: …)` itself.
options: DefaultFirebaseOptions.currentPlatform,
// Your own Firebase wiring, called with the live app. May be async —
// `Sea.servicesReady` waits for it.
onAppReady: (app) async {
await FirebaseMessaging.instance.getToken();
},
),
// Optional: Supabase (grouped config)
supabaseConfig: SeaSupabaseConfig(
url: 'https://your-project.supabase.co',
anonKey: 'your-anon-key',
),
// Optional: Glass theme (grouped config)
glassConfig: SeaGlassConfig(
lightGradient: [Color(0xFFE8F5E9), Color(0xFFE3F2FD)],
darkGradient: [Color(0xFF0D1B0E), Color(0xFF0D1B2A)],
),
// Optional: Services (grouped config)
servicesConfig: SeaServicesConfig(
logEnabled: true,
autoInitStorage: true,
autoInitDevice: true,
),
// Optional: App info (grouped config)
appInfoConfig: SeaAppInfoConfig(
appName: 'My App',
appIconPath: 'assets/icon/app_icon.png',
privacyPolicyUrl: 'https://example.com/privacy',
userAgreementUrl: 'https://example.com/terms',
defaultEmail: 'user@example.com',
),
// Optional: Locale (i18n)
// fast_sea ships with built-in locales in assets/locale/
// Point extraAssetBasePath to your app's own locale JSONs
localeConfig: SeaLocaleConfig(
locale: Locale('zh', 'CN'),
fallbackLocale: Locale('en', 'US'),
// Optional: this list also drives Sea.locale.supportedLocales.
supportedLocales: const [
Locale('en', 'US'),
Locale('zh', 'CN'),
Locale('ja', 'JP'),
],
extraAssetBasePath: 'assets/locale',
),
));
}
No bootstrap call of your own, no wrapper widget, no manual controller registration — SeaApp does all of it.
4. Unified API — Sea #
Everything is accessible through the Sea class:
// Theme
Sea.theme.toggle(); // Toggle light ↔ dark
Sea.theme.setLight(); // Force light
Sea.theme.setDark(); // Force dark
Sea.theme.setSystem(); // Follow system
// Toast & Loading (iOS 27 glass style)
Sea.toast.success('Done!');
Sea.toast.error('Failed');
Sea.toast.info('Tip');
Sea.toast.show('Hello');
Sea.loading.show();
Sea.loading.dismiss();
// Loading Task
final data = await Sea.loading.task(() => api.fetchItems());
// Auth — gate a tap behind sign-in (no context, no copy, no login route)
await Sea.auth.require(() => controller.toggleFavourite(id));
Sea.auth.isSignedIn;
// Keyboard
Sea.keyboard.dismiss();
// Log
Sea.log.d('Debug');
Sea.log.i('Info');
Sea.log.w('Warning');
Sea.log.e('Error');
// Device
Sea.device.deviceModel;
Sea.device.osVersion;
// Storage
Sea.storage.setString('key', 'value');
Sea.storage.getString('key');
// HTTP
Sea.http.init(baseUrl: 'https://api.example.com');
final data = await Sea.http.requestGet('/users', fromJson: User.fromJson);
// Connectivity
final online = await Sea.connectivity.isOnline;
// Permission
await Sea.permission.camera();
// Rating
await Sea.rating.requestReview();
// Analytics
Sea.analytics.logEvent(name: 'click');
// Supabase Auth
await Sea.supabase.signInWithEmail(email: 'user@example.com', password: 'pass');
Sea.supabase.isLoggedIn;
// Config
Sea.config.adsConfig.removeAds;
Sea.isReady; // SeaApp configuration is ready; await Sea.servicesReady for services
// App Info
Sea.appInfoConfig.appName; // 'My App'
Sea.appInfoConfig.appIconPath; // 'assets/icon/app_icon.png'
Sea.appInfoConfig.privacyPolicyUrl; // 'https://...'
Sea.appInfoConfig.userAgreementUrl; // 'https://...'
Sea.appInfoConfig.defaultEmail; // 'qifendev@gmail.com'
Sea.appTitle; // App title from SeaApp
Sea.appName; // Configured or platform app name
// Common utilities and platform APIs
Sea.format.bytes(1536); // '1.50 KB'
Sea.format.timeAgo(DateTime.now());
Sea.validators.email(email); // null when valid
Sea.inputFormatters.phone(); // TextInputFormatter
await Sea.clipboard.copy('Copied');
await Sea.haptics.selection();
await Sea.url.open('https://example.com');
// i18n / Locale
Sea.locale.tr('common_cancel'); // Translate key
Sea.locale.tr('time_minutes_ago', params: {'count': '5'}); // With params
Sea.locale.changeLocale(Locale('ja', 'JP')); // Switch language
Sea.locale.currentLocale.value; // Current locale
Sea.locale.supportedLocales; // App-configured choices
Sea.locale.isLoaded('ja_JP'); // Check if loaded
Sea.locale.loadLocale(Locale('fr', 'FR')); // Lazy load
Sea.locale.addTranslations('zh_CN', {'my_key': '我的值'}); // Add custom translations
Sea.locale.loadLocaleFromAsset('th_TH', 'assets/locale/th_TH.json'); // Load from custom asset
SeaLocales.supportedLocales; // Full built-in locale catalog
SeaLocales.localeDisplayName(Locale('ja', 'JP')); // '日本語'
Set SeaLocaleConfig.supportedLocales to the locales your app actually offers.
GetMaterialApp locale resolution and Sea.locale.supportedLocales use the
same list, so an in-app language page can show only configured choices. It
defaults to the full built-in catalog.
Or manually:
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return SeaApp(
title: 'My App',
home: const HomePage(),
);
}
}
5. Terse calls — the flat one-liners #
Sea groups its API by domain, which is the right shape for a reference. The
calls an app writes all day are also available flat, so nothing has to be
wrapped to get a short one:
// Messages — the surface in the middle of the screen
seaToast('Uploading…'); // generic: type, title, position, duration
seaToastSuccess('Saved'); // ✓ 2s
seaToastError('Upload failed'); // ✕ 3s
seaToastInfo('Syncing in the background'); // ℹ 2s
// Work in flight
seaShowLoading('Fetching…');
seaShowProgress(0.4, 'Downloading…');
seaHideLoading();
final items = await seaLoadingTask(() => api.loadFeed());
// Logging — one line each
seaLogi('Sign in success', tag: 'AUTH');
seaLogw('Fallback used', tag: 'API');
seaLoge('Sign in failed', tag: 'AUTH', error: e);
seaLogd('payload sent', tag: 'API', data: {'status': 200, 'ms': 42});
A second spelling, never a second behaviour: each one delegates to the class
behind it, so seaToastError('x') and Sea.toast.error('x') put the same
surface on screen, and seaLoge(...) writes the same record Sea.log.e(...)
does. Use whichever reads better where you are typing.
🌍 i18n / Internationalization #
SeaLocaleService provides a complete i18n solution built on GetX translations with per-locale on-demand JSON loading.
Architecture #
fast_sea/assets/locale/ ← Built-in common/auth/time keys (300+ locales)
+
your_app/assets/locale/ ← App-specific translations (declared via extraAssetBasePath)
↓
SeaLocaleService.loadLocale() ← Merges both sources for the requested locale only
Features #
- 300+ built-in locales available via
SeaLocales.supportedLocales; apps can expose a smaller configured subset - On-demand loading — only the current locale's JSON is loaded, not all at once
- Two-tier merge — fast_sea built-in translations + your app-level translations, merged per locale
- Built-in translations — fast_sea ships with keys for common UI, auth, and time (see table below)
- Your app translations — place
en.json,zh.json, etc. underassets/locale/and declareextraAssetBasePath - Parameterized strings —
@keyplaceholders in translations - Fallback locale — falls back to
fallbackLocaleif key not found in current locale
Built-in Translation Keys #
| Category | Keys |
|---|---|
| common | common_no_data, common_loading, common_retry, common_cancel, common_confirm, common_ok, common_save, common_delete, common_edit, common_done, common_close, common_back, common_next, common_skip, common_search, common_select, common_submit, common_reset, common_apply, common_yes, common_no, common_all, common_none, common_other, common_more, common_less, common_on, common_off, common_enabled, common_disabled, common_required, common_optional, common_error, common_success, common_warning, common_info, common_no_more_data, common_pull_to_refresh, common_release_to_refresh, common_refreshing, common_load_more, common_loading_more, common_network_error, common_request_timeout, common_server_error, common_unknown_error, common_permission_denied, common_storage_error, common_download, common_upload, common_share, common_copy, common_paste, common_cut, common_undo, common_redo, common_select_all, common_deselect_all, common_move, common_rename, common_replace, common_insert, common_remove, common_clear, common_filter, common_sort, common_group, common_expand, common_collapse, common_show, common_hide, common_lock, common_unlock, common_visible, common_hidden, common_public, common_private, common_favorite, common_unfavorite, common_like, common_dislike, common_follow, common_unfollow, common_block, common_unblock, common_report, common_flag, common_spam, common_mute, common_unmute, common_pin, common_unpin, common_archive, common_unarchive, common_restore, common_recover, common_discard, common_leave, common_join, common_accept, common_decline, common_invite, common_send, common_receive, common_reply, common_forward, common_resend, common_draft, common_published, common_unpublished, common_scheduled, common_pending, common_approved, common_rejected, common_completed, common_failed, common_in_progress, common_paused, common_stopped, common_running, common_idle, common_active, common_inactive, common_online, common_offline, common_busy, common_available, common_unavailable, common_connected, common_disconnected, common_syncing, common_synced, common_out_of_sync, common_updated, common_outdated, common_new_version, common_update_now, common_later, common_install, common_uninstall, common_open, common_open_in_browser, common_open_in_app, common_export, common_import, common_print, common_preview, common_fullscreen, common_exit_fullscreen, common_zoom_in, common_zoom_out, common_rotate, common_flip, common_crop, common_resize, common_quality, common_size, common_color, common_font, common_style, common_format, common_language, common_theme, common_dark_mode, common_light_mode, common_system_mode, common_settings, common_preferences, common_general, common_about, common_help, common_feedback, common_support, common_contact, common_privacy_policy, common_user_agreement, common_terms_of_service, common_version, common_copyright, common_license, common_licenses, common_powered_by, common_developed_by, common_made_with |
| auth | auth_login, auth_logout, auth_signup, auth_register, auth_forgot_password, auth_reset_password, auth_change_password, auth_email, auth_password, auth_confirm_password, auth_username, auth_nickname, auth_phone, auth_verification_code, auth_send_code, auth_resend_code, auth_or, auth_continue_with, auth_sign_in_with_apple, auth_sign_in_with_google, auth_sign_in_with_github, auth_already_have_account, auth_dont_have_account, auth_email_required, auth_password_required, auth_email_invalid, auth_password_too_short, auth_password_not_match, auth_login_failed, auth_signup_failed, auth_reset_email_sent, auth_welcome_back, auth_create_account |
| time | time_just_now, time_minutes_ago, time_hours_ago, time_days_ago, time_weeks_ago, time_months_ago, time_years_ago, time_yesterday, time_today, time_tomorrow |
Usage #
1. Configure in SeaApp
SeaApp(
home: HomePage(),
localeConfig: SeaLocaleConfig(
locale: Locale('zh', 'CN'), // Initial locale
fallbackLocale: Locale('en', 'US'), // Fallback locale
// Point to your app's own locale JSONs (merged on-demand with fast_sea's built-in keys)
extraAssetBasePath: 'assets/locale',
),
)
In your app's pubspec.yaml, register the asset directory:
flutter:
assets:
- assets/locale/
Create assets/locale/en.json:
{
"tab_home": "Home",
"tab_settings": "Settings",
"my_greeting": "Hello, World!"
}
Create assets/locale/zh.json:
{
"tab_home": "首页",
"tab_settings": "设置",
"my_greeting": "你好,世界!"
}
The service loads fast_sea/assets/locale/en.json (built-in) and assets/locale/en.json (your app) together when the user switches to English — both are merged automatically.
2. Translate in Code
// Simple translation
Text(Sea.locale.tr('common_cancel'))
// With parameters (use @key placeholders)
Text(Sea.locale.tr('time_minutes_ago', params: {'count': '5'}))
// → "5分钟前" (zh_CN) / "5 min ago" (en_US)
// Check if key exists
if (Sea.locale.hasKey('my_key')) { ... }
// Get all translations for current locale
final all = Sea.locale.getAllTranslations();
3. Switch Language at Runtime
// Change locale (auto-loads JSON if not loaded)
await Sea.locale.changeLocale(Locale('ja', 'JP'));
// Current locale (reactive)
Obx(() => Text('${Sea.locale.currentLocale.value}'))
4. Add Translations at Runtime
The recommended way is extraAssetBasePath in SeaLocaleConfig (see above). For dynamic / runtime additions:
// Add translations in code
await Sea.locale.addTranslations('zh_CN', {
'order_pending': '待处理订单',
'order_completed': '已完成订单',
});
// Load from a custom JSON asset
await Sea.locale.loadLocaleFromAsset('th_TH', 'assets/locale/th_TH.json');
// Load from a Map
await Sea.locale.loadLocaleFromJson('pt_BR', {
'common_cancel': 'Cancelar',
'common_confirm': 'Confirmar',
});
5. Locale Display Names
// Get native display name for a locale
SeaLocales.localeDisplayName(Locale('ja', 'JP')); // '日本語'
SeaLocales.localeDisplayName(Locale('zh', 'CN')); // '简体中文'
SeaLocales.localeDisplayName(Locale('ko', 'KR')); // '한국어'
// List all supported locales with display names
for (final locale in SeaLocales.supportedLocales) {
print('${SeaLocales.localeDisplayName(locale)}: $locale');
}
📁 Files & Cache — Sea.file #
A unified file layer that wraps file_picker, image_picker, path_provider, file_saver, share_plus and open_filex.
Every file the app imports or captures is copied into one single directory, so you always know where your data lives and can wipe it with a single call.
Why #
| Problem | Sea.file answer |
|---|---|
| Picked file paths become invalid (iOS/Android temp) | Picked files are copied into the app's cache directory |
| Files scattered across temp/cache/documents | One root: <docs>/fast_sea/{files,cache} |
| No idea how big the cache is | Sea.file.cacheSize() + formatSize() |
| Clearing cache means touching several dirs | clearCache() / clearFiles() / clearAll() |
| Five different plugin APIs to remember | One facade: Sea.file.* |
Directory layout #
<applicationDocuments>/fast_sea/
├── files/ # persistent app-managed files
│ ├── images/
│ ├── videos/
│ ├── audio/
│ ├── documents/
│ └── others/
└── cache/ # picked/captured files, disposable (or OS temp dir)
Setup #
SeaFile is initialised automatically by SeaApp (servicesConfig.autoInitFile defaults to true).
Customise it via SeaApp.fileConfig:
SeaApp(
home: const HomePage(),
fileConfig: const SeaFileConfig(
rootFolderName: 'my_app', // default: 'fast_sea'
copyPickedFiles: true, // default: true
pickedFilesInCache: true, // default: true
useTemporaryForCache: false, // default: false
),
)
Or initialise manually when you are not using SeaApp:
await SeaFile.init(config: const SeaFileConfig());
Picked and captured files are copied into cache/<kind>/ by default. Set
pickedFilesInCache: false to keep copied items in persistent files/<kind>/.
Quick start #
// Pick
final image = await Sea.file.pickImage();
final files = await Sea.file.pickFiles();
final video = await Sea.file.pickVideo();
final audio = await Sea.file.pickAudio();
// Camera
final photo = await Sea.file.takePhoto();
final clip = await Sea.file.takeVideo();
// Save out of the app / share / open
await Sea.file.saveToDevice(path: photo!.path, name: photo.displayName); // system save panel
await Sea.file.saveToDownloads(path: photo.path, name: photo.displayName); // straight into Download/
await Sea.file.sharePath(photo.path, fileName: photo.displayName);
await Sea.file.open(photo.path);
// Cache
final bytes = await Sea.file.cacheSize();
print(Sea.file.formatSize(bytes)); // e.g. "12.4 MB"
await Sea.file.clearCache();
API #
Picking (file_picker)
| Method | Returns |
|---|---|
pickFile() |
SeaFileResult? |
pickFiles() |
List<SeaFileResult> |
pickImage() / pickImages() |
SeaFileResult? / List |
pickVideo() / pickVideos() |
SeaFileResult? / List |
pickAudio() / pickAudios() |
SeaFileResult? / List |
pickMedia() |
List<SeaFileResult> (images + videos) |
pickDirectory() |
String? |
Camera & gallery (image_picker)
| Method | Returns |
|---|---|
takePhoto() / takeVideo() |
SeaFileResult? |
pickImageFromGallery() / pickVideoFromGallery() |
SeaFileResult? |
pickMultipleMedia() |
List<SeaFileResult> |
Save / share / open
| Method | Backed by |
|---|---|
saveToDevice(path:) · saveBytesToDevice(bytes:) · saveAs(path:) |
file_saver — the user picks where |
saveToDownloads(path:, name:) |
media_store_plus — Android writes Download/<appFolder>/ with no picker |
sharePath() · sharePaths() · shareResults() · shareText() |
share_plus |
open(path) |
open_filex |
Cache & size
| Method | Description |
|---|---|
cacheSize() / filesSize() / totalSize() |
Size in bytes |
sizeOfDirectory(dir) |
Size of any directory |
clearCache() |
Wipe the cache folder |
clearFiles() |
Wipe the imported files |
clearKind(kind) |
Wipe one category only |
clearAll() |
Wipe everything |
formatSize(bytes) |
"1.24 MB" |
Directories & utilities
rootDirectory · filesDirectory · cacheDirectory · directoryFor(kind) · listFiles(kind:) ·
deleteFile(path) · delete(result) · mimeTypeOf(path) · kindOf(path) · kindOfMime(mime)
Saving out of the app — two different questions #
saveToDevice and saveToDownloads both put a file where the user can find it,
but they answer different questions:
saveToDevice |
saveToDownloads |
|
|---|---|---|
| Picker | Yes — SAF / Files app | No |
| Where on Android | wherever the user chooses | Download/SeaFiles/ (MediaStore) |
| Where on iOS | Files app (system save panel) | same — iOS has no Downloads folder, so it falls back to the panel |
| Returns | the platform's path | the display path, e.g. /storage/emulated/0/Download/SeaFiles/report.pdf, or null |
final saved = await Sea.file.saveToDownloads(
path: task.filePath,
name: task.fileName, // optional; falls back to the basename
);
if (saved == null) Sea.toast.error('Could not save');
else Sea.toast.success('Saved to $saved');
Three behaviours are deliberate:
- The source file survives.
media_store_plusdeletes thetempFilePathit is given — it assumes a throwaway temp file. Passing the user's own attachment would mean "saved successfully, then the message detail says the file is missing", so the library copies to a real temp file first and lets the plugin delete that. downloadsAppFolderhas no leading slash. The plugin buildsRELATIVE_PATH = "Download/" + appFolder; a leading/yieldsDownload//SeaFiles, which MediaProvider rejects, and the file silently lands inDownload/(invalid)/SeaFiles/. Verified on a Huawei/HarmonyOS device.- Same name overwrites. There is no auto-rename; the returned path is the truth to show in the toast.
The app sub-folder is SeaFiles (SeaFile.downloadsAppFolder, a static const)
— the file manager's "Save to Downloads" and the toast both use it, so the path
a user reads is the path the OS wrote.
SeaFileResult #
final f = await Sea.file.pickImage();
f!.path; // absolute path inside the unified directory
f.displayName; // original file name (falls back to the stored name)
f.size; // bytes
f.sizeText; // "2.31 MB"
f.mimeType; // "image/png"
f.kind; // SeaFileKind.image
f.xFile; // XFile — ready for upload / share
Notes #
- Mobile/desktop only — the service relies on
dart:iopaths and throwsUnsupportedErroron web. - Remember to request the relevant permissions (
Sea.permission.photos(),.camera()) before picking on iOS/Android. - Set
copyPickedFiles: falseto keep platform paths (not recommended: they can expire). - Picked files are copied to
cache/by default; setpickedFilesInCache: falseto keep them in persistentfiles/. - Full reference:
doc/FILE_MODULE.md
🖼 Image — SeaImageWidget #
lib/src/widgets/display/sea_image_widget.dart — ported from FastImageWidget (fast_code) and
renamed to the Sea convention. It sizes itself from a ratio and picks the right image
provider automatically.
Quick start #
// Fixed height, width derived from the ratio
SeaImageWidget(
imageUrl: 'https://example.com/photo.jpg',
height: 120,
ratio: 16 / 9, // ratio = height / width → width = 67.5
fit: BoxFit.cover,
borderRadius: BorderRadius.circular(12),
)
// Fixed width, height derived from the ratio
SeaImageWidget(imageUrl: url, width: 200, ratio: 16 / 9) // height = 112.5
// Assets (also matches 'packages/...' paths)
SeaImageWidget(imageUrl: 'assets/images/logo.png', width: 96, ratio: 1)
// Local files — pairs with Sea.file
final picked = await Sea.file.pickImage();
SeaImageWidget(imageUrl: picked!.path, height: 160, ratio: 4 / 3)
Source detection #
imageUrl |
Provider |
|---|---|
assets/…, packages/… |
Image.asset |
/…, file://… |
Image.file (skipped on web) |
| anything else | CachedNetworkImage |
Overlay #
stackBuilder receives the resolved width/height, so gradients, badges or play buttons
line up exactly with the image:
SeaImageWidget(
imageUrl: thumb,
height: 200,
ratio: 16 / 9,
borderRadius: BorderRadius.circular(16),
stackBuilder: (w, h) => const Align(
alignment: Alignment.center,
child: Icon(CupertinoIcons.play_fill, color: Colors.white, size: 44),
),
)
Parameters #
| Parameter | Type | Notes |
|---|---|---|
imageUrl |
String? |
url / asset path / file path |
height |
double? |
with ratio → derives width |
width |
double? |
with ratio → derives height |
ratio |
double? |
height / width |
fit |
BoxFit? |
default BoxFit.contain |
color |
Color? |
blend colour |
borderRadius |
BorderRadius? |
clips the image |
border |
Border? |
drawn around the image |
alignment |
Alignment |
default Alignment.center |
placeholder |
Widget Function(BuildContext, String)? |
network only |
errorWidget |
Widget Function(BuildContext, String, Object)? |
network only |
stackBuilder |
Widget Function(double w, double h)? |
overlay |
cacheKey |
String? |
forwarded to CachedNetworkImage |
cacheRatio |
double? |
disk/memory cache = ratio × screen size |
Notes #
- Backed by
cached_network_image^3.4.1. Version 4.x requires Flutter>=3.44, so the library stays on 3.x while its floor is 3.41. ratioisheight / width— the same convention as the originalFastImageWidget. Passratio: 1for a square.- Migration from
fast_code: renameFastImageWidget→SeaImageWidget; everything else matches.
SeaApp — All-in-One Widget #
SeaApp replaces the two-step setup an app would otherwise write around runApp (initialise the services, then wrap the tree). One widget, zero boilerplate.
SeaApp Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
home |
Widget |
required | Root page |
title |
String |
'' |
App title |
lightTheme |
ThemeData? |
null |
Light mode theme |
darkTheme |
ThemeData? |
null |
Dark mode theme |
themeMode |
ThemeMode |
system |
Initial theme mode |
persistThemeMode |
bool |
true |
Restore and persist the selected theme using Sea.storage |
persistLocale |
bool |
true |
Restore and persist the selected locale using Sea.storage |
primaryColor |
Color? |
null |
Primary color override |
adsConfig |
SeaAdsConfig |
SeaAdsConfig() |
AdMob configuration |
firebaseConfig |
SeaFirebaseConfig |
SeaFirebaseConfig() |
Firebase configuration |
supabaseConfig |
SeaSupabaseConfig |
SeaSupabaseConfig() |
Supabase configuration |
glassConfig |
SeaGlassConfig |
SeaGlassConfig() |
Glass theme configuration |
servicesConfig |
SeaServicesConfig |
SeaServicesConfig() |
Services configuration |
appInfoConfig |
SeaAppInfoConfig |
SeaAppInfoConfig() |
App info: name, icon, privacy/agreement URLs, default email |
SeaApp initializes Flutter binding and storage before its first frame, then
restores and persists the saved theme and locale automatically. The
Sea.dialog facade keeps information alerts centred and presents operations
and choices in a bottom glass sheet:
await Sea.dialog.showInfo(title: 'Saved');
final confirmed = await Sea.dialog.showConfirm(
title: 'Delete item?',
message: 'This cannot be undone.',
isDestructive: true,
);
await Sea.dialog.loginDialog();
final date = await Sea.dialog.showDatePicker();
final time = await Sea.dialog.showTimePicker();
final dateTime = await Sea.dialog.showDateTimePicker();
It also exposes showActionSheet, showSelection, showMultiSelection, and
standard appearance/language pickers. The language picker only displays
locales configured in SeaLocaleConfig.supportedLocales /
SeaApp.supportedLocales. Bottom operation and selection sheets size
themselves to their content and do not expand when dragged; each tappable
option is an independent glass tile.
Configuration Objects #
SeaAdsConfig
const SeaAdsConfig(
googleBannerKey: 'ca-app-pub-xxx/yyy',
googleAppOpenKey: 'ca-app-pub-xxx/yyy',
googleRewardKey: 'ca-app-pub-xxx/yyy',
googlePageKey: 'ca-app-pub-xxx/yyy',
removeAds: false,
onAdsReady: null,
)
SeaFirebaseConfig
SeaFirebaseConfig(
enabled: true,
analytics: true,
options: DefaultFirebaseOptions.currentPlatform, // FirebaseOptions
app: null, // an already-built FirebaseApp takes precedence
onAppReady: null, // (FirebaseApp app) async { … } — awaited
onReady: null, // VoidCallback, fired after onAppReady
)
Three init routes, in order: a pre-built app is reused; otherwise
options are handed to Firebase.initializeApp; otherwise Firebase resolves
the native config files (GoogleService-Info.plist / google-services.json)
itself. onAppReady is awaited, so a slow handler delays Sea.servicesReady
instead of racing it.
SeaSupabaseConfig
const SeaSupabaseConfig(
url: 'https://your-project.supabase.co',
anonKey: 'your-anon-key',
onReady: null,
)
SeaGlassConfig
const SeaGlassConfig(
lightGradient: [Color(0xFFE8F5E9), Color(0xFFE3F2FD)],
darkGradient: [Color(0xFF0D1B0E), Color(0xFF0D1B2A)],
glowBlobs: null,
themeData: null,
)
The global gradient background can be toggled at runtime. Set both
lightBackground and darkBackground to null in SeaGlassConfig to start
with it disabled; enabling it uses a SeaGlassBackground with the configured
gradients and glow blobs:
Obx(
() => SeaGlassSwitch(
value: Sea.glass.gradientBackgroundEnabled.value,
onChanged: Sea.glass.setGradientBackgroundEnabled,
),
)
SeaServicesConfig
const SeaServicesConfig(
logEnabled: true,
autoInitStorage: true,
autoInitDevice: true,
autoInitFile: true, // creates the unified files/ + cache/ directories
)
SeaFileConfig
const SeaFileConfig(
rootFolderName: 'fast_sea', // folder created inside the app documents dir
copyPickedFiles: true, // copy picks into the unified directory
useTemporaryForCache: false, // put cache/ in the OS temp dir instead
)
SeaAppInfoConfig
const SeaAppInfoConfig(
appName: 'My App', // App display name
appIconPath: 'assets/icon/app_icon.png', // App icon asset path
privacyPolicyUrl: 'https://example.com/privacy', // Privacy policy URL
userAgreementUrl: 'https://example.com/terms', // User agreement URL
defaultEmail: 'qifendev@gmail.com', // Default email for auth forms
)
Sea — Unified API #
All runtime operations through one class:
Theme #
Sea.theme.toggle(); // Toggle light ↔ dark
Sea.theme.setLight(); // Force light
Sea.theme.setDark(); // Force dark
Sea.theme.setSystem(); // Follow system
Sea.theme.isDark.value; // Reactive bool
Sea.theme.themeMode.value; // Reactive ThemeMode
Toast & Loading (iOS 27 glass style) #
Sea.toast.success('Saved!');
Sea.toast.error('Failed');
Sea.toast.info('Tip');
Sea.toast.show('Hello');
Sea.loading.show();
Sea.loading.show('Fetching...');
Sea.loading.progress(0.5, 'Downloading...');
Sea.loading.dismiss();
Sea.loading.isShowing; // bool
Where a toast appears
position: moves the same surface between the three placements:
Sea.toast.success('Saved!'); // the HUD, by default
Sea.toast.success('Saved!', position: SeaToastPosition.top); // a banner
| Position | Shape |
|---|---|
SeaToastPosition.center (default) |
A HUD in the middle of the view, shrink-wrapped around its message — icon over centred text. |
SeaToastPosition.top |
A banner spanning the page gutters, under the status bar. |
SeaToastPosition.bottom |
The banner shape, above the home indicator. |
The middle is the default because an app's own message is something the user
should not have to look for: a banner under the bar can sit behind a thumb or be
missed while they are reading the centre of the screen. The centred surface
shrink-wraps instead of spanning the gutters, so it grows with its message and
stays bounded by SeaGlassToast.hudMaxWidth (300); pass SeaToastPosition.top
when a screen wants its messages out of the way.
Loading Task #
// Simple
final result = await Sea.loading.task<int>(() => api.fetchCount());
// Without loading indicator
final data = await Sea.loading.task(() => api.fetchData(), showLoading: false);
| Parameter | Type | Default | Description |
|---|---|---|---|
| the first, positional argument | FutureOr<T> Function() |
required | The operation; its result is returned and errors propagate |
message |
String? |
null |
Optional loading message |
showLoading |
bool |
true |
Show and dismiss the loading indicator around the operation |
Every wait a tap starts belongs in here. The panel is shown with
EasyLoadingMaskType.clear: it blocks the screen without dimming it, which is
what makes a second tap on the button underneath land on the barrier instead of
on the button. A double submit is otherwise a race between a finger and a round
trip, and disabling the button for the duration costs the page a second copy of
the request's state.
// A tap handler, end to end: one wait, one panel, one round trip.
Future<void> save() => seaLoadingTask(() async {
final result = await api.updateProfile({'nickname': name});
result.when(
success: (_) => seaToastSuccess(t('common_saved')),
failure: (error) => seaToastError(error.message),
);
});
Work that is not tap-started does not belong here: a page's first load and a background sync carry their own progress in the UI. Neither does a tap whose wait is the thing the reader is watching — a streamed translation, a streamed reply — because the panel would sit on top of the answer as it arrives.
Nesting is safe, and expected: a save that refreshes a list, a submit that
uploads and then reloads. The panel belongs to the outermost call — an inner
task finishing does not take it away from the outer one still running, and only
the outermost message is shown. showLoading: false takes no part in that
counting at all, so it neither draws over nor suppresses an enclosing panel.
Auth #
Sign-in is a gate, not a destination: an app can be browsed signed-out, and an action that needs an account asks for one where the user tapped it.
// Runs now when signed in, otherwise presents the sign-in sheet and then runs.
await Sea.auth.require(() => controller.toggleFavourite(id));
Sea.auth.isSignedIn; // session check (safe before Supabase.init)
await Sea.auth.dialog(); // the sheet on its own
Sea.auth.page() // the same page, for a route in getPages
require takes no copy and no login route: the sheet is SeaAuthPage, which
carries its own labels in the library's 204 locales, and the gate waits for the
session rather than for a route result — so password, sign-up and the social
providers all continue the action the user asked for. Dismissing the sheet
without signing in simply does not run it.
Context #
The action APIs — dialogs, sheets, toasts, the keyboard, the auth gate — resolve
the ambient Get.context themselves. A call site inside an event handler can
call them directly instead of threading a BuildContext through:
showSeaGlassActionSheet(title: 'Choose Action', actions: [...]);
Sea.toast.success('Saved');
Sea.keyboard.dismiss();
Pass context: when you have a specific one in mind — a dialog inside a nested
navigator, a sheet anchored to a sub-tree, or a host that is not a GetApp
(a widget test mounting a plain MaterialApp, an embedded surface): the ambient
lookup has nothing to resolve there. It stays an optional named argument
everywhere.
Logging #
One line per record. logger's stock PrettyPrinter framed every entry between
box-drawing rules and laid stack frames under it, so a screen of output was
mostly punctuation; fast_sea installs a printer that writes the level, the tag
the caller supplied and the message, and nothing else:
[23:41:02.318][I] Booted
[23:41:02.902][D] [API] payload sent | {status: 200, ms: 42}
[23:41:03.115][E] [AUTH] Sign in failed — BadCredentialsException: Invalid login credentials
seaLogd('payload sent', tag: 'API', data: {'status': 200});
seaLogi('Sign in success', tag: 'AUTH');
seaLogw('Fallback used', tag: 'API');
seaLoge('Sign in failed', tag: 'AUTH', error: e); // error joins the line
seaLogf('Cannot continue', error: e, stackTrace: s); // + capped frames
Sea.log.d('same thing'); // the namespaced spelling
SeaLog.history; // the last 1000 records, for the debug page
SeaLog.configure(printer: MyPrinter()); // or bring your own format
The tag is the app's own word for the area (AUTH, API, SUPABASE, …) and is
what you grep for. A stack trace is the only thing that takes more than one
line, and only when the caller handed one over — capped at
SeaLogPrinter(maxStackFrames:), 8 by default, 0 for never.
The clock is always on (SeaLogPrinter(showTime:)), and so is the date:
[2026-10-08 23:41:02.318][I] …. A log that runs overnight is otherwise a
pile of times with no day attached. SeaLogPrinter(showDate: false) gets the
terse clock-only form back.
Config #
Sea.config.adsConfig.removeAds;
Sea.config.glassConfig.quality;
Sea.config.fileConfig.pickedFilesInCache;
Sea.config.appInfoConfig.defaultEmail;
Sea.isReady; // synchronous SeaApp configuration is available
await Sea.servicesReady; // async service bootstrap has completed
Haptics #
Off by default — a tap must not buzz. The whole tactile vocabulary is still there; an app that wants it opts in once:
Sea.haptics.enabled = true; // then selection() / light() / medium() / …
| Method | Feels like |
|---|---|
selection() |
light tick — a selection changed |
light() |
light tap — a row press or a chip |
medium() |
firmer tap — a primary action committed |
heavy() |
heaviest tap — use sparingly |
success() / error() |
notification double / triple rumble |
vibrate() |
the platform's plain buzz (Android-only in practice) |
While Sea.haptics.enabled is false every method returns before touching the
platform channel — including the widgets that tick through it (SeaGlassFloatingActionButton,
SeaGlassRating, SeaGlassToggleGroup, SeaGlassExpansionTile,
SeaGlassColorPicker) and the SeaHapticCallback gesture helper. Nothing
under lib/ calls HapticFeedback directly, so there is no path that
bypasses the switch (a guard test enforces it).
Sheets are quiet by default too: SeaGlassSheet,
SeaGlassModalSheet, showSeaGlassSheet and showSeaGlassModalSheet all
pass enableInteractionGlow: false, which is what silences a tap on a
dialog.
Theme #
SeaColors #
Predefined color palette with light/dark schemes:
// Static colors
SeaColors.primary // #20BFA9
SeaColors.secondary // #34C759
SeaColors.accent // #5856D6
SeaColors.success // #34C759
SeaColors.warning // #FF9500
SeaColors.danger // #FF3B30
SeaColors.info // #5AC8FA
// Adaptive scheme
final scheme = SeaColors.of(context); // auto light/dark
scheme.background
scheme.surface
scheme.glassSurface
scheme.label
scheme.secondaryLabel
scheme.tertiaryLabel
scheme.divider
// Explicit schemes
SeaColors.light
SeaColors.dark
SeaTextStyles #
iOS-style typography scale:
SeaTextStyles.largeTitle(context) // 34pt bold
SeaTextStyles.title1(context) // 28pt bold
SeaTextStyles.title2(context) // 22pt bold
SeaTextStyles.title3(context) // 20pt semibold
SeaTextStyles.headline(context) // 17pt semibold
SeaTextStyles.body(context) // 17pt regular
SeaTextStyles.subheadline(context) // 15pt regular
SeaTextStyles.sectionHeader(context) // 13pt semibold
SeaTextStyles.caption // 12pt regular (const)
SeaGlassStyle & SeaGlassTheme #
Glass effect presets and theme configuration:
// Presets
SeaGlassStyle.card // blur:16, thickness:24, radius:20
SeaGlassStyle.sheet // blur:30, thickness:40, radius:32
SeaGlassStyle.button // blur:8, thickness:16, radius:28
SeaGlassStyle.navigation // blur:25, thickness:30, radius:28
SeaGlassStyle.tile // blur:10, thickness:16, radius:16
// Custom style
final style = SeaGlassStyle(
blur: 20,
thickness: 30,
borderRadius: 24,
glowIntensity: 0.7,
);
// Convert to LiquidGlassSettings
style.toSettings();
// Theme data for GlassTheme
SeaGlassTheme.themeData
// Adaptive settings for current brightness
SeaGlassTheme.settingsFor(context)
Sea.theme, Sea.glass — and why switching stays sharp #
Sea.theme.themeMode.value; // Rx<ThemeMode>, persisted by SeaApp
Sea.theme.setDark(); // setLight() / setSystem() / toggle()
Sea.theme.themeMode.value = ThemeMode.dark; // same thing, and it is watched
Sea.glass.gradientBackgroundEnabled.value;
Sea.glass.setGradientBackgroundEnabled(false);
liquid_glass_widgets' adaptive quality (SeaApp.glassConfig.adaptiveQuality)
judges your frame times: two consecutive windows over budget drop the whole
app one quality step (premium → standard), and climbing back needs ten good
windows plus an 8-second cooldown. Repainting every glass surface against a new
gradient is exactly the one or two frames that blow that budget — so "switch to
dark mode" used to look like "the glass went blurry", permanently.
The controller therefore suspends measurement for 600 ms around any theme
change, before the repaint starts, and releases it afterwards; the adapter then
skips its own settle window. It hangs off the Rx, so themeMode.value = …,
setDark() and the built-in appearance picker all take the same path.
Sea.glass.setGradientBackgroundEnabled does the same for the background
gradient. Those two are the only full-tree repaints the library performs; a
palette swap you drive yourself is not covered, so route it through
themeMode (or a gradient toggle) instead of rebuilding the surfaces directly.
Glass Widgets #
SeaGlassScaffold #
Lower-level glass layout primitive for app shells and custom layouts. For a
standard screen, prefer SeaAppPage, which adds the iOS page chrome, automatic
back button, and content insets:
SeaGlassScaffold(
appBar: SeaGlassNavigationBar(title: Text('Home')),
body: Center(child: Text('Hello')),
bottomBar: SeaGlassTabBar(...),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
body |
Widget |
required | Page content |
appBar |
Widget? |
null |
Top app bar |
bottomBar |
Widget? |
null |
Bottom navigation |
backgroundColor |
Color? |
null |
Background color |
background |
Widget? |
SeaGlassBackground() |
Background widget |
quality |
GlassQuality? |
app-wide setting | Ceiling on this page's shader quality, bars included |
SeaGlassCard #
Glass morphism card container:
SeaGlassCard(
margin: EdgeInsets.all(12),
padding: EdgeInsets.all(16),
onTap: () => print('tapped'),
child: Text('Card Content'),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget? |
null |
Card content |
padding |
EdgeInsetsGeometry |
all(16) |
Inner padding |
margin |
EdgeInsetsGeometry? |
null |
Outer margin |
width |
double? |
null |
Fixed width |
height |
double? |
null |
Fixed height |
useOwnLayer |
bool |
false |
Use independent glass layer |
useGlassEffect |
bool |
true |
Enable glass effect |
borderRadius |
double |
10 |
Corner radius (non-glass mode) |
backgroundColor |
Color? |
null |
Background (non-glass mode) |
onTap |
VoidCallback? |
null |
Tap handler |
onLongPress |
VoidCallback? |
null |
Long press handler |
SeaGlassButton #
Glass morphism button:
SeaGlassButton(
label: 'Submit',
icon: CupertinoIcons.checkmark,
isPrimary: true,
onTap: () => handleSubmit(),
)
SeaGlassButton(
label: 'Delete',
isDestructive: true,
onTap: () => handleDelete(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
label |
String |
required | Button text |
icon |
IconData? |
null |
Leading icon |
onTap |
VoidCallback? |
null |
Tap handler |
enabled |
bool |
true |
Enabled state |
width |
double? |
null |
Fixed width |
height |
double |
50 |
Fixed height |
isPrimary |
bool |
false |
Primary style |
isDestructive |
bool |
false |
Destructive style |
useGlassEffect |
bool |
true |
Enable glass effect |
iconColor |
Color? |
null |
Icon color override |
labelColor |
Color? |
null |
Label color override |
backgroundColor |
Color? |
null |
Background color override |
SeaGlassIconButton #
Glass morphism icon button:
SeaGlassIconButton(
icon: CupertinoIcons.add,
onPressed: () => addItem(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
icon |
IconData |
required | Icon data |
onPressed |
VoidCallback? |
null |
Press handler |
tooltip |
String? |
null |
Tooltip text |
useGlassEffect |
bool |
true |
Enable glass effect |
size |
double |
SeaSizes.barButton (34) |
Side of the drawn glass circle — the middle step of iOS's button ramp (28/34/50), what the platform draws in its own bars |
minTapTarget |
double |
SeaSizes.control (44) |
The touchable side, independent of the drawn size. The HIG minimum applies to the target, not the circle — the glass shrinks, the tap area does not |
SeaGlassListTile #
Glass morphism list tile:
SeaGlassListTile(
leading: Icon(CupertinoIcons.person),
title: Text('John Doe'),
subtitle: Text('john@example.com'),
trailing: Icon(CupertinoIcons.chevron_right),
onTap: () => openProfile(),
)
// A row whose control is too wide for the trailing slot:
SeaGlassListTile(
title: Text('Volume'),
subtitle: Text('Applies to media only.'),
child: SeaGlassSlider(value: v, onChanged: set),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
leading |
Widget? |
null |
Leading widget |
title |
Widget |
required | Title |
subtitle |
Widget? |
null |
Subtitle |
trailing |
Widget? |
null |
Trailing widget |
child |
Widget? |
null |
A control under the title/subtitle, inside the row |
onTap |
VoidCallback? |
null |
Tap handler |
onLongPress |
VoidCallback? |
null |
Long press handler |
dense |
bool |
false |
Drop the vertical inset, for tightly related rows |
child renders inside the row at the row's own gutter, with the title and
subtitle above it — the shape a settings or form row takes when the control is
too wide for trailing (a slider, a segmented control, a run of buttons). Its
cross-axis alignment is start, so a control with a width of its own keeps it
and one that wants the row still fills it. onTap then covers the label area
only, so the control keeps its own gestures.
SeaGlassListTile.chevron(context) is the standard disclosure mark — use it
rather than hand-rolling an Icon, so every disclosure in an app is the same
glyph at the same size and colour.
SeaGlassSection #
Grouped section container:
SeaGlassSection(
header: Text('Settings'),
footer: Text('Version 1.0'),
children: [
SeaGlassListTile(title: Text('General'), onTap: () {}),
SeaGlassListTile(title: Text('Privacy'), onTap: () {}),
],
)
| Parameter | Type | Default | Description |
|---|---|---|---|
children |
List<Widget> |
required | Section items |
header |
Widget? |
null |
Section header |
footer |
Widget? |
null |
Section footer |
margin |
EdgeInsetsGeometry? |
null |
Outer margin |
Children are stretched to the full width of the card. A grouped section puts
its rows in a Column that keeps the default cross-axis alignment, so a row
narrower than the card would otherwise shrink-wrap and float to the middle. Header
and footer use the fast_sea ramp (13pt semibold / 12pt) and preserve the app's font
family.
SeaGlassCodeBlock #
A monospaced block of source, in the page's own surface — for documentation and diagnostics:
SeaGlassCodeBlock("SeaNavigator.push(context, page, backLabel: 'Home');")
Kept deliberately plain: no syntax colouring, no gutters, no copy button. The
value is that the snippet on screen is the snippet in the source, at the same
line breaks. maxLines clamps it.
| Parameter | Type | Default | Description |
|---|---|---|---|
code |
String |
required | The source, verbatim |
maxLines |
int? |
null |
Clamp, with an ellipsis |
SeaGlassReadout #
A labelled, selectable value — what a service returned, what a device reported, where a file landed:
SeaGlassReadout(label: 'Resolved path', value: await Sea.file.absolute(path));
An empty or null value renders nothing at all, which is what lets a page wire
it straight to a nullable result without a conditional. Monospaced and
selectable, because the point of showing a value is usually that someone will
copy it.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
String? |
required | The value; empty renders nothing |
label |
String? |
null |
Caption above the value |
maxLines |
int? |
null |
Clamp a long value |
SeaGlassTintedIcon #
An iOS settings-row mark: a glyph on its own tinted rounded square. The tint colours the glyph and its background together, so a row cannot end up with a blue icon on a green square.
SeaGlassListTile(
leading: const SeaGlassTintedIcon(
icon: CupertinoIcons.bell,
color: CupertinoColors.systemOrange,
),
title: const Text('Notifications'),
trailing: SeaGlassListTile.chevron(context),
onTap: open,
)
| Parameter | Type | Default | Description |
|---|---|---|---|
icon |
IconData |
required | The glyph |
color |
Color? |
app primary | Tint of glyph and square |
size |
double |
32.0 |
Edge of the square |
SeaGlassButtonWrap #
A run of buttons that wraps instead of overflowing — try every variant of one control, where the number of buttons is a fact about the API rather than a layout decision:
SeaGlassButtonWrap(children: [
SeaGlassButton(label: 'Primary', onTap: () {}),
SeaGlassButton(label: 'Secondary', onTap: () {}),
]);
| Parameter | Type | Default | Description |
|---|---|---|---|
children |
List<Widget> |
required | The buttons |
spacing |
double |
8.0 |
Gap between and between lines |
SeaAppPage #
The base widget of a fast_sea app. One page, one glass shell, one scroll
view, and the iOS 27 chrome that goes with it — the glass background, the
navigation bar and its materialisation, the page gutter, and the clearance a
floating bar needs. The shape a page used to pick by choosing one of two
scaffold widgets is now a parameter — style: SeaAppPageStyle.large or
.compact — so one widget serves both:
// Root of the stack — a 34pt title that collapses into the bar on scroll.
SeaAppPage(
style: SeaAppPageStyle.large,
title: 'Messages',
subtitle: 'App Store-style line under the title',
children: [section1, section2],
);
// Pushed on top of it — the default, so nothing has to be passed: a 17pt
// centred bar title, a back control labelled with the page you came from,
// and glass on scroll.
SeaNavigator.push(
context,
SeaAppPage(
title: 'Thread',
children: [section],
),
// The label the pushed page's back control will show.
backLabel: 'Messages',
);
// Nothing but its content — no title, no style.
SeaAppPage(children: [hero]);
| Parameter | Type | Default | Description |
|---|---|---|---|
title |
String? |
null |
Page title; omit it and the page draws no title |
titleWidget |
Widget? |
null |
Custom compact-bar title, for example a live WebView title |
style |
SeaAppPageStyle |
compact |
large (stack root) or compact (pushed route) |
subtitle |
String? |
null |
Under the title when large; the lead paragraph when compact |
leading |
Widget? |
SeaGlassBackButton on any poppable page |
Leading bar control |
actions |
List<Widget> |
const [] |
Trailing bar controls |
children |
List<Widget>? |
null |
Content: gutter, gaps and bottom clearance handled |
slivers |
List<Widget> |
const [] |
Content as slivers, when you need them |
body |
Widget? |
null |
Custom full-height body; mutually exclusive with children / slivers |
childGap |
double |
20.0 |
Gap between children |
searchBar |
Widget? |
null |
In the large title block, or first in a compact body |
background |
Widget? |
null |
Explicit page background |
bottomBar |
Widget? |
null |
Floating bottom bar |
bottomBarHeight |
double |
60.0 |
Height reserved for it |
bodyOverlays |
List<Widget>? |
null |
Above the body, below the bars |
toolbarHeight |
double |
44.0 |
Bar height, excluding the status bar |
physics |
ScrollPhysics? |
bouncing | Scroll physics |
extendBody / edgeFade |
bool |
true |
Body behind the bar / scroll-edge fade |
materialize |
bool |
true |
Grow a glass surface behind the bar as content scrolls under it |
materializeExtent |
double |
52.0 |
Scroll distance over which the glass reaches full strength (compact) |
scrollController |
ScrollController? |
null |
Drive the compact bar from an external controller |
largeTitle* |
largeTitleFontSize / FontWeight / LetterSpacing / Padding / Trailing |
||
titleController |
GlassLargeTitleController? |
null |
For a page whose scroll view you own: pin the large title above it and collapse it against that scroll view — see below |
autoLoad |
bool |
true |
Run onRefresh on the way in — the page's first load |
onRefresh |
SeaCallback? |
null |
Pull-down refresh; setting it (or onLoad) wraps the page in SeaRefreshWidget |
onLoad |
SeaCallback? |
null |
Pull-up load-more; report noMore when the list is done |
loading / error / empty |
bool? |
null |
Overrides for the states the page derives from those callbacks |
loadingWidget / errorWidget / emptyWidget |
Widget? |
standard states | Override any of the three states |
onRetry |
VoidCallback? |
onRefresh |
What a status view's retry does |
SeaPageRetry.of(context) |
VoidCallback? |
— | The page's retry, for a status widget you wrote — see below |
noMoreText |
String? |
locale common_no_more_data |
Footer copy once there is nothing left to load |
enablePullDown |
bool |
true |
Enable the pull-down gesture |
refreshController |
EasyRefreshController? |
null |
Trigger a refresh from code |
headerInset |
double |
0 |
Lift the pull-down spinner by this much — for a reverse: true page, where the header sits at the foot of the screen under a pinned input bar |
Both title and style are optional. style defaults to compact,
because most pages are reached by tapping — so the common page passes neither
and gets the compact title, the back control when it can pop, and the glass on
scroll for free. Pass style: SeaAppPageStyle.large only on the screen that
owns the stack; that is what makes the hierarchy legible, and it is the one
thing you have to ask for.
What the library will not do is infer the shape from the route: whether a screen
owns the stack is a product decision, and a page that silently changes shape when
it is reached a different way — presented instead of pushed, or promoted to the
root — is a layout bug that moves. The one thing read from the route is the
leading control: a compact page with no leading shows a back button when it
can pop, and nothing when it cannot.
A title is optional too. A page that draws its own header — a hero, a custom
title block, an empty state — passes no title and keeps the chrome, the gutter
and the scroll view. On a large page, where the title is what collapses, an
untitled page has nothing to collapse; its bar comes in on the scroll offset
instead of staying transparent forever.
Design your pages around children. Each one gets the page gutter
(SeaPageSliver), childGap between them, and the trailing clearance for a
floating bar (SeaBottomInset) — the whole skeleton of an iOS page, in the
library rather than in every app, so a section cannot be added without the gutter
and a new page cannot ship with its last row under the tab bar. Reach for
slivers only when you need real slivers (a lazily built SliverList); it
places its own insets and is not wrapped twice.
The compact bar is transparent at rest — just its text and controls floating
over the page. As content scrolls beneath it, an edge-to-edge glass surface
materialises with the scroll offset and reaches full strength after
materializeExtent. The surface never eats a tap while it is still transparent.
The large page runs the full native chain instead: large title → scroll
collapse → glass bar → compact title, all driven by the scroll offset, so
reversing restores it.
A large title the page cannot put in its scroll view
A large title is scroll content: it lives in the page's own scroll view, and the
content scrolling past carries it away. That needs a scroll view that runs
top-down, and a bottom-anchored list does not: a conversation keeps its
newest row at the bottom however short it is, and therefore scrolls
reverse: true — and a reversed scroll view lays its slivers out from the bottom
edge up, so a title placed among them lands under the content.
Such a page passes its body and a titleController, and the page pins the
large title above that body instead:
final titles = GlassLargeTitleController(); // one per page
SeaAppPage(
style: SeaAppPageStyle.large,
title: 'Conversations',
titleController: titles,
body: ListView.builder(
reverse: true,
controller: titles.scrollController, // the collapse follows this
itemBuilder: (c, i) => MessageRow(...),
),
);
The controller is the whole contract, and the caller attaches it, because the
caller is the one who owns that scroll view. From there it is shared: the bar
fades its compact title in over the same collapseProgress, and the pinned title
shrinks away over the controller's collapse distance (52pt) while handing its
height to the body below — the conversation grows into the space rather than
being left with a gap where the title was. That is SeaPinnedLargeTitle, with
the same type ramp and fade curve as SeaGlassLargeTitle; the one thing it does
not copy is the overscroll stretch, because the pull that would stretch it is a
conversation's refresh gesture.
The page lays that out as a Stack: the title rides at the bar's edge and the
body is given the box below it — not a column's leftover — so a page can pin
its own controls inside that box and have them stay put while the title
collapses:
SeaAppPage(
style: SeaAppPageStyle.large,
title: 'AI',
titleController: titles,
body: Stack(
children: [
// The conversation: it runs to the bottom edge of the screen and scrolls
// *behind* the input bar, with its own padding keeping the newest message
// clear of it.
Positioned.fill(child: messages),
// The input, where it belongs.
Positioned(left: 0, right: 0, bottom: 0, child: input),
],
),
);
Two things come with the shape. The title is a single line and takes no
subtitle: the page has to reserve the title's room before the title is laid
out, so a second line would be room it cannot account for (the page asserts on
it). And the room is taken as a Padding rather than by shortening the box, so
a Positioned(bottom: 0) inside the body stays on the bottom edge of the screen
exactly while the title is collapsing above it.
A page that brought a body and no controller gets no large title — there is
nowhere to put one. That is not a silent default: the page cannot reach into a
scroll view it did not build.
Loading is the page's own business
Every page that shows fetched data needs the same things: a spinner while it
waits, an empty state when the answer was nothing, an error state with a retry
when the request failed, and pull-down / pull-up once there is a list. Those are
what SeaPageMixin / SeaStatusMixin produce and what SeaRefreshWidget
drives — and SeaAppPage aggregates them, so a page passes two callbacks and
nothing else:
SeaAppPage(
style: SeaAppPageStyle.large,
title: 'Feed',
onRefresh: controller.seaRefresh, // the value it returns is the result
onLoad: controller.seaLoadMore,
slivers: [
SliverList.builder(
itemCount: controller.seaData.length,
itemBuilder: (context, index) => row(controller.seaData[index]),
),
],
);
The page opens by running onRefresh — the first frame is already a loading one
— and then believes what the callback reports back. SeaRefreshWidget used
to read one bit out of that return value, "is there more?", because that is all a
footer indicator needs; a page that draws its own states needs the count and the
failure as well, and it cannot get them by watching: seaRefresh catches the
throw, logs it and returns normally, so "it failed" and "it worked" arrive down
the same path. So the answer travels in a SeaLoadResult:
Future<SeaLoadResult> seaRefresh() async {
final rows = await repository.list();
return SeaLoadResult(count: rows.length, noMore: rows.length < pageSize);
}
The mixins return exactly that, having known the count and caught the throw all
along. SeaLoadResult.of is what makes the contract forgiving — a hand-written
callback may return a SeaLoadResult, or an Iterable / a number (read as a
count), or a bare bool (the original "no more"), or nothing at all, and the page
reads whatever it can:
| The callback returns | The page reads |
|---|---|
SeaLoadResult(count: 0) |
empty state |
SeaLoadResult(count: 12) |
content |
SeaLoadResult(error: e) |
error state, retry wired to onRefresh |
['a', 'b'] (any Iterable) |
count = 2 |
true / false |
just "no more" — no empty state is invented |
nothing (void, null) |
nothing: the caller's content is left alone |
loading,errorandemptyremain, as overrides. Pass one when the page knows better than its callbacks — and they are the only way to draw a state beforeonRefreshhas ever run.autoLoad: falseis the other half of that escape hatch: for a page whose controller still refreshes from its ownonInit, so one screen is not two requests.- Precedence is the mixins':
errorfirst, thenloadingwhile there is nothing to show, thenempty. A failed refresh shows the error however much data is already on screen — a stale list under a silent failure is worse than an honest one under a retry button. A failed load-more deliberately does not: the footer indicator already shows it, and blanking a list the reader is halfway down is worse than the failure. - A count is what draws the empty state, and
nullis not a count. A loader that only reports "no more" has said nothing about how much data there is, and reading silence as "nothing" would put an empty state over a list it simply did not describe. - The status is a sliver of the same scroll view, not a replacement for it: a loading page keeps its large title, its search field and its materialising bar, and a failed page stays pullable — the retry is a button, but the gesture the reader tries first still works.
- Say nothing and nothing happens. No
onRefresh/onLoadand the page is not wrapped in a refresh view at all — no third-party physics, no indicator — and with no callback that reports state it draws no status view either.
onRetry defaults to onRefresh, so a page that only passes the refresh
callback still gets a working retry.
The two indicators are placed for you, because both of EasyRefresh's
defaults are wrong on a page whose body runs behind the bars. The pull-down
indicator is pinned to the top of the viewport — over the status bar, above
the large title — so the page puts a HeaderLocator above the title and
lands the spinner in the gap a pull opens, which is the only gap a page like
this has. A little room is reserved there so the title cannot grow into it: the
large title scales up to 1.12x on overscroll, anchored at its bottom edge, so a
wrapping title paints upward past its own layout box. The load-more indicator is
anchored to the bottom of the viewport, which is where the tab bar is, so the
page lifts it by the bar's own clearance. A page inside a shell — a tab root
that owns the tab bar with the pages as plain bodies — needs to pass nothing:
the page reports no bar of its own and the inset falls through to the shell's
published metrics. Only a page that puts up a bar of its own is measured against
that bar, so a bar that grows does not need every page edited. A
reverse: true page is the one that swaps the two ends: the load-more indicator
lands at the top of the viewport, in the strip a compact page draws its
toolbar over, and the page reserves that strip the same way — unless its title
is pinned, whose layout has reserved it already.
A status widget you write yourself can borrow that same retry, which is worth doing whenever the button matters: the retry is the page's refresh, not the raw callback, so a retry that runs through it also moves the loading and empty states the page derives.
SeaAppPage(
onRefresh: controller.load,
// An empty feed is not a failure, but it is worth a button.
emptyWidget: Builder(
builder: (context) => SeaErrorWidget(
seaIcon: Icons.school_outlined,
seaTitle: 'Nothing here yet',
seaOnRetry: SeaPageRetry.of(context),
),
),
slivers: [SliverList.builder(...)],
);
SeaPageRetry.of(context) is null outside a SeaAppPage — and null when the
page has neither onRetry nor onRefresh — so a status widget used elsewhere
draws without a button rather than with a dead one.
SeaPage — a page, its controller, and everything under it #
SeaAppPage describes a page; SeaPage binds one controller to it, runs its
loads, draws its three states and repaints when the controller changes. Inherit
it, write build, and every widget below — however deep — reads that controller
without it being threaded down:
class ChatPage extends SeaPage<ChatController> {
ChatPage({super.key});
@override
Widget build(BuildContext context) => seaPage(
style: SeaAppPageStyle.large,
title: 'Chat',
onRefresh: controller.load,
slivers: const [SeaPageSliver(child: _Conversation())],
);
}
class _Conversation extends StatelessWidget {
const _Conversation();
@override
Widget build(BuildContext context) {
final chat = context.seaPage<ChatController>(); // no parameter in sight
return TextButton(onPressed: chat.sendMessage, child: const Text('Send'));
}
}
One class is the whole page. build runs on the page and this is that
page, so there is no createState, no _ChatPageState, and no second class to
keep in step with the first.
| Piece | What it is for |
|---|---|
SeaPage<T> |
The page. build is what you write; controller: is optional |
SeaPage.seaPage(…) |
The page skeleton, with the page's controller and states already wired |
SeaPage.controller |
The resolved controller |
SeaPage.seaNormal / .otherWidget |
The branch, for a page that owns its scroll view |
SeaPage.seaInitState / .seaDispose |
The page's own lifecycle |
SeaPage.setState / .mounted / .context |
What a State would have given it, and has |
SeaPlainPage |
A SeaPage for a screen with no controller of its own |
context.seaPage<T>() |
The page's controller, from any descendant |
SeaPageScope.of<T>(context) |
The same, when a BuildContext extension is unwelcome |
SeaObs<T>(seaBuilder: …) |
Repaints a leaf when the obs values it reads change |
SeaListController<T> |
Pagination a controller does not have to write |
SeaListPager<T> / SeaListHost |
The same, for a screen with several lists on one controller |
The page is seaPage
A page never builds a SeaAppPage — seaPage(…) builds it, taking every one
of that widget's parameters and meaning the same thing by each, so the two are
one API with two front doors. The skeleton, the bars, the gutter and the refresh
view all come with it, which is why a page that wants pull-to-refresh says
onRefresh: and gets the indicator, the gesture and the physics — it never
reaches for SeaRefreshWidget itself.
onRefresh and onLoad are wrapped on the way through, which is what lets the
states below answer for the same loads the indicators are showing: a load the
page did not run is a load whose result the page would never learn.
Repainting is the controller's update()
The page subscribes to its controller and calls setState when the controller
notifies — which is what get's own update() does, and what
SeaListController calls after every load:
controller.selectedFilter = 'words';
controller.update(); // the page rebuilds, reading the new value
So a page reads its controller's plain fields directly and never wraps itself
in an Obx. Rx values are still there for anything that wants its own
subscription, and the split is worth keeping straight:
- The page follows its controller:
update()→ rebuild. - A leaf that follows one value is
SeaObs<T>, which is narrower than repainting the page — a bubble that grows a token at a time, a badge reading one counter.Obxdoes the same job when the widget already holds its controller as a parameter. - A source that is not the page's controller — a global theme, a service —
is an
Obxon that source;SeaObsonly reaches the page's own controller.
A page that would rather own its reactivity outright overrides seaAutoUpdate
to false.
The page is created once
A StatefulWidget is normally rebuilt by its parent — a new widget object every
time — and the State is what outlives it. A page has no State to outlive it:
it is both halves, so the instance the page was created with is the one it
keeps. build runs on it, setState repaints it, and a parent's rebuild
neither re-runs the constructor nor resets a field.
Two things come with that, and both are worth knowing before they are met:
-
Constructor arguments are read once, when the page is first built. A page that means to be a different page — another session, another filter — is another page: a
ValueKeythrows the old one away and builds the new one. -
A page is not
const, and the field it keeps of its own is the one place the framework's@immutableis honestly silenced — in the page's own file, with the reason next to it:// A page is its own state, so this one keeps a field that changes. // ignore: must_be_immutable class LearnPage extends SeaPage<LearnController> {Anything that changes can also live in a final field of a small holder object, which needs no ignore and costs one
.per read.
Below a page the old trick still works: hold the pages in a field of the page
above them, as MainPage holds its four tabs, and the identity is stable because
the field is.
The three states are seaNormal and otherWidget
The page owns its loading / error / empty states — derived from what the two
callbacks report, exactly as SeaAppPage derives them — and offers them as one
branch:
seaNormal ? _messages() : otherWidget
seaNormal is false while there is nothing to show yet, and otherWidget is
then whichever of the three applies: the error with its retry, the spinner, or
the empty state. It is SizedBox.shrink() when seaNormal is true, so the
branch is safe to read either way.
A page that hands over slivers: or children: does not need either one —
seaPage draws the state for it, in the page's own scroll view, which is what
keeps the large title and the materialising bar on screen while it waits.
seaNormal is for the page that brings its own body:, and therefore its own
scroll view: a conversation, or a list the page pins a control against.
An explicit state widget — loadingWidget / errorWidget / emptyWidget — is
still the page's, and its retry reaches the page through
SeaPageRetry.of(context), so a retry moves the page's own spinner rather than a
controller the page never hears from again.
A screen with no controller
SeaPlainPage is a SeaPage with nothing to publish: a splash screen, a camera
preview, an entry detail that loads itself. It has no controller type to name, so
it takes SeaNoController and publishes no scope — everything else is the same.
class CameraPage extends SeaPlainPage {
CameraPage({super.key});
@override
Widget build(BuildContext context) =>
seaPage(title: 'Camera', body: const _Preview());
}
The controller is passed in, or found
SeaPage(controller: …) is the explicit form — a page that constructs its own
controller, or a test that hands one over. Leaving it out falls back to
Get.find<T>(), which is the shape a route binding expects: the page names no
controller, and the binding supplies the one it runs on.
It is resolved once, on first use, and kept for the life of the page. A page
that means to belong to a different controller is a different page — give it a
ValueKey, the same idiom a filtered list uses to reload when the filter
changes:
FeedPage(key: ValueKey('feed.$filter'), controller: …)
Why a scope rather than reaching for Get.find everywhere: Get.find works
anywhere, so a widget that calls it says nothing about which page it belongs
to, and two pages of the same controller type cannot coexist. The scope answers
with the page the widget is actually inside, and a widget moved elsewhere
follows its new page instead of the one that registered first. Reading a
controller that is not above you is an error naming the type, not a null.
Lifecycle
build is the only method a page has to write, and the lifecycle around it is
the page's own: seaInitState runs with controller already resolved and the
page subscribed to it, seaDispose runs on the way out, and mounted,
context and setState are there for everything in between — the same words a
State uses, because they are the same things.
class LearnPage extends SeaPage<LearnController> {
TabController? _tabs;
@override
void seaInitState() =>
_tabs = TabController(length: 4, vsync: this); // the page is the vsync
@override
void seaDispose() => _tabs?.dispose();
}
A page is a TickerProvider, so vsync: this reads here as it reads on a
State: the element owns the tickers a page asks for, and reports one still
running when the page is torn down — which is what makes seaDispose the place
to let them go.
One caveat worth stating plainly: the analyzer's async-gap rule knows
State.mounted, and a page is not a State. A page that reads context after
an await and guards it with if (!mounted) return; is guarded correctly and
told otherwise — silence that one lint with the reason rather than rearranging
the code around it.
Pagination — SeaListController<T>
Every paginated screen has the same five things to get right — the list, the page
the next request asks for, whether the source ran out, one load at a time, and
repainting when a page arrives — and they are the same five on every screen.
SeaListController<T> is them, once, on the controller:
class FavoritesController extends SeaListController<Favorite> {
final _repository = ProfileRepository();
@override
Future<List<Favorite>> seaLoadData(int page) async {
final result = await _repository.getFavorites(
limit: seaPageCount,
offset: page * seaPageCount,
);
return switch (result) {
SeaApiSuccess(:final data) => data.favorites,
SeaApiFailure(:final error) => throw error,
};
}
}
The page then hands the two loads straight to seaPage and indexes the list:
@override
Widget build(BuildContext context) => seaPage(
title: 'Favorites',
onRefresh: controller.seaRefresh,
onLoad: controller.seaLoadMore,
slivers: [
SliverList.builder(
itemCount: controller.seaData.length,
itemBuilder: (context, i) => _Tile(favorite: controller.seaData[i]),
),
],
);
| Member | What it is |
|---|---|
seaData |
The list, and the page's to index — seaData.length, seaData[i] |
seaLoadData(int page) |
The only method you write. Throw to report a failure |
seaPageCount |
How many items one page asks for (default 20) |
seaHasMore(items) |
Whether another page follows; default is "the page came back full" |
seaItemKey(item) |
Identity of an item, for a source that can serve the same row twice |
seaRefresh() / seaLoadMore() |
The page's two callbacks, wired straight to onRefresh / onLoad |
seaPage / seaNoMore / seaLoading |
The paging state, if the page wants to read it |
seaResult |
What the last load reports: count and noMore |
seaSetData / seaRemoveWhere / seaResetPaging |
Edit the list in place, notifying the page |
seaOnError / seaDataAdded |
The app's own hooks around a load |
The page keeps no flag and no copy — a list the page maintained as well would be
a second copy of the same truth, and the one that missed an append. It does not
have to be told a page arrived either: seaRefresh and seaLoadMore call
update() when they are done, which is the notification SeaPage
subscribes to, so the frame comes on its own.
A failed refresh reports no count while the list is empty, so the page shows its
error state rather than an empty one over a list the reader is about to get back.
A failed load-more keeps its place: the count rides along and seaNoMore is left
alone, so the list the reader is halfway down is not blanked and pulling again
retries the same page.
Several lists on one controller — SeaListPager<T>
A screen with two feeds has two lists and one controller, so the controller
cannot be either of them — it owns both. Take SeaListHost as well and let it
do the owning:
class HomeController extends GetxController with SeaListHost {
static const _pageSize = 20;
late final feed = seaPager<Post>(
(page) => _repository.feed(limit: _pageSize, offset: page * _pageSize),
seaPageCount: _pageSize,
);
late final recommended = seaPager<Post>(
(page) => _repository.recommended(offset: page * 5),
seaPageCount: 5,
);
@override
void onInit() {
super.onInit();
feed.seaRefresh();
recommended.seaRefresh();
}
}
Each pager carries its own list, its own page and its own seaNoMore; seaPager
wires every one of them to the controller's own update(), so a page that
follows the controller follows whichever list moved. It also closes them all when
the controller is disposed — a pager must not report to a controller that has
gone away, and that is a rule no screen should have to remember. late final is
the shape to reach for: the initializer runs on first read, which is what lets it
call seaPager — and therefore this — at all.
The page then names the list it is drawing, and indexes that one:
onRefresh: controller.feed.seaRefresh,
onLoad: controller.feed.seaLoadMore,
// …
itemCount: controller.feed.seaData.length,
| Piece | What it is |
|---|---|
SeaListPager<T> |
One list among several — the same members as SeaListController, as a value |
SeaListHost |
The mixin that owns them: seaPager(…), and closing every pager on onClose |
SeaListPaging<T> |
The behaviour both shapes share, for a host of your own |
SeaListPager takes seaHasMore and seaItemKey as constructor arguments,
because a pager is a value rather than a class to inherit. A source that needs
more than that — a cursor it holds, a failure it also reports — extends the class
and overrides what it needs, seaLoadData included; a subclass that overrides
that one does not pass seaLoad at all:
class _FeedPager extends SeaListPager<Post> {
String? _cursor;
@override
Future<List<Post>> seaLoadData(int page) async {
final feed = await _repository.feed(cursor: page == 0 ? null : _cursor);
_cursor = feed.nextCursor;
return feed.items;
}
@override
bool seaHasMore(List<Post> items) => _cursor != null;
}
A SeaListController can mix SeaListHost in as well, for the screen whose
second list is not the one the page is built around:
class LearnController extends SeaListController<MeanGroup> with SeaListHost {
late final recommended = seaPager<MeanGroup>((page) => _repository.top(page));
}
SeaGlassBackButton #
The back control of a pushed page: a contained, icon-only glass button.
iOS 26 replaced the labelled back control with a contained icon button. Where iOS 18 drew a chevron plus a breadcrumb naming the previous screen, the system now draws a single circular glass button — the same shape as every other bar button — and the breadcrumb is gone. A wide "‹ Previous" pill beside a centred title is the fastest way for a screen to look like it was designed for an older release.
The previous page's title is not discarded: it becomes the control's tooltip and accessibility label, so VoiceOver still announces where back goes.
SeaNavigator.push(context, const DetailPage(), backLabel: 'Inbox');
The label travels on the pushed route's RouteSettings (as a SeaBackLabel), so
nothing global is involved.
| Parameter | Type | Default | Description |
|---|---|---|---|
label |
String? |
null |
Overrides the label carried by the route |
onTap |
VoidCallback? |
pops the route | Tap handler |
showsTitle |
bool |
false |
Draw the title next to the chevron, as a capsule |
labelLimit |
int |
12 |
Characters before ellipsis, when showsTitle is on |
Set showsTitle: true for an app that has not adopted the iOS 26 toolbar, or for a
hierarchy deep enough that naming the parent is worth the width.
SeaGlassNavigationBar #
Glass app bar with large title support:
SeaGlassNavigationBar(
title: Text('My App'),
leading: BackButton(),
actions: [SeaGlassIconButton(icon: CupertinoIcons.search, onPressed: () {})],
)
| Parameter | Type | Default | Description |
|---|---|---|---|
title |
Widget? |
null |
Title widget |
leading |
Widget? |
null |
Leading widget |
actions |
List<Widget>? |
null |
Action buttons |
centerTitle |
bool |
true |
Centre the title. iOS 26 puts a bar's principal item in the middle (.principal is centred by default); the bar slides it to the leading edge by itself only when the trailing controls leave no room. Pass false to pin it to the leading edge |
largeTitleController |
GlassLargeTitleController? |
null |
Large title controller |
SeaGlassTabBar #
Bottom tab bar navigation — the iOS 26 floating capsule. Three shapes, all on the same iOS 26 metrics so a bar cannot come out 104pt tall by accident:
// A pill of tabs, optionally with a trailing island.
SeaGlassTabBar(
tabs: [
SeaGlassTab(
label: 'Home',
icon: CupertinoIcons.house,
activeIcon: CupertinoIcons.house_fill,
),
SeaGlassTab(label: 'Files', icon: CupertinoIcons.folder),
SeaGlassTab(label: 'Settings', icon: CupertinoIcons.gear_alt),
],
selectedIndex: 0,
onTabSelected: (index) => switchTab(index),
);
// The iOS 26 search bar: tapping the trailing island morphs the pill into a
// search field and collapses the tabs. The results replace the body.
SeaGlassTabBar.searchable(
tabs: tabs,
selectedIndex: index,
onTabSelected: switchTab,
isSearchActive: searching,
searchConfig: GlassSearchBarConfig(
hintText: 'Search',
onSearchToggle: (active) => setState(() => searching = active),
onChanged: (q) => setState(() => query = q),
),
);
// The scroll behaviour: the pill shrinks to the selected tab while the page
// scrolls and springs back when it stops.
SeaGlassTabBar.minimizable(
tabs: tabs,
selectedIndex: index,
onTabSelected: switchTab,
minimizeController: minimizeController, // fed from the page's scroll offset
);
| Parameter | Type | Default | Description |
|---|---|---|---|
tabs |
List<SeaGlassTab> |
required | Tab definitions |
selectedIndex |
int |
required | Active tab |
onTabSelected |
ValueChanged<int> |
required | Tab tap handler |
extraButton |
GlassTabBarExtraButton? |
null |
Trailing island (search, compose) |
searchConfig / searchController / isSearchActive |
— | — | SeaGlassTabBar.searchable only |
minimizeController / isMinimized |
— | — | SeaGlassTabBar.minimizable only |
selectedIconColor / selectedLabelColor |
Color? |
accent | Selected tint |
Give a tab an activeIcon and iOS marks the selection with the filled glyph
against outline glyphs for the rest. Two filled glyphs make the selection read as
colour-only, which is the first thing to disappear in a low-contrast glass bar.
The bar is 72pt tall (barHeightPill 56 + 2 × 8) — the system's 49–56pt range,
floating 8pt above the home indicator. Pages never restate that number: they
reserve clearance through SeaInsets / SeaBottomInset, which read the height the
bar publishes. SeaGlassTabBar.barHeight exposes the measured value.
SeaSystemUi #
The system chrome style for a fast_sea app: both system bars transparent, with only the icon brightness following the theme.
A page in this library always paints its own background — gradient, glow blobs,
whatever SeaApp was given — and everything else floats above it. A status-bar
colour of any kind, including Android's own contrast scrim, draws an opaque band
across the top of that background and makes the floating navigation bar look like
it is sitting under a lid. On iOS the bar has always been transparent, which is why
this only ever showed up on Android; it is now set explicitly for both so the two
cannot drift.
SeaApp, SeaGlassScaffold and SeaGlassPage install it for you. Reach for it
directly only when you draw your own chrome:
AnnotatedRegion<SystemUiOverlayStyle>(
value: SeaSystemUi.of(context),
child: child,
);
| Member | Description |
|---|---|
SeaSystemUi.of(context) |
Transparent style resolved from the theme brightness |
SeaSystemUi.resolve(context, style) |
Transparent style with the icon brightness from a GlassStatusBarStyle |
SeaSystemUi.lightIcons / darkIcons |
The two constant styles |
SeaGlassScaffold.statusBarStyle therefore only picks the icon brightness;
GlassStatusBarStyle.none means "take it from the theme", not "leave the system
alone", because there is always a background behind the bar worth showing.
SeaGlassSegmentedControl #
Segmented control selector:
SeaGlassSegmentedControl(
labels: ['All', 'Active', 'Done'],
selectedIndex: _selectedIndex,
onSegmentSelected: (index) => setState(() => _selectedIndex = index),
)
SeaGlassSwitch #
Toggle switch:
SeaGlassSwitch(
value: isEnabled,
onChanged: (value) => setState(() => isEnabled = value),
activeColor: SeaColors.primary,
)
SeaGlassSlider #
Slider control with glass effect:
SeaGlassSlider(
value: volume,
min: 0.0,
max: 1.0,
divisions: 10,
onChanged: (value) => setState(() => volume = value),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
double |
required | Current value |
onChanged |
ValueChanged<double>? |
required | Value change callback |
min |
double |
0.0 |
Minimum value |
max |
double |
1.0 |
Maximum value |
divisions |
int? |
null |
Discrete divisions |
label |
String? |
null |
Label above thumb |
activeColor |
Color? |
SeaColors.primary |
Active track color |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
useOwnLayer |
bool |
false |
Use independent glass layer |
SeaGlassBadge #
Notification badge / dot indicator:
// Count badge
SeaGlassBadge(
count: 5,
child: Icon(CupertinoIcons.mail),
)
// Dot badge (status indicator)
SeaGlassBadge.dot(
dotColor: Colors.green,
child: AvatarWidget(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Target widget |
count |
int |
0 |
Badge count |
position |
BadgePosition |
topRight |
Badge position |
backgroundColor |
Color? |
SeaColors.danger |
Badge background |
showZero |
bool |
false |
Show when count is 0 |
maxCount |
int |
99 |
Max count before "+" |
SeaGlassChip #
Filter / tag chip:
SeaGlassChip(
label: 'Technology',
icon: Icon(CupertinoIcons.tag),
selected: true,
onTap: () => toggleFilter(),
)
SeaGlassChip(
label: 'Remove',
onDeleted: () => removeTag(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
label |
String |
required | Chip text |
icon |
Widget? |
null |
Leading icon |
onTap |
VoidCallback? |
null |
Tap handler |
onDeleted |
VoidCallback? |
null |
Delete handler (shows X) |
selected |
bool |
false |
Selected state |
selectedColor |
Color? |
SeaColors.primary |
Selected color |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
SeaGlassTextField #
Text input field with glass effect:
SeaGlassTextField(
placeholder: 'Email',
prefixIcon: Icon(CupertinoIcons.mail),
keyboardType: TextInputType.emailAddress,
onChanged: (value) => updateEmail(value),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
controller |
TextEditingController? |
null |
Text controller |
placeholder |
String? |
null |
Placeholder text |
prefixIcon |
Widget? |
null |
Leading icon |
suffixIcon |
Widget? |
null |
Trailing icon |
obscureText |
bool |
false |
Password mode |
maxLines |
int |
1 |
Max lines |
enabled |
bool |
true |
Enabled state |
onChanged |
ValueChanged<String>? |
null |
Text change callback |
onSubmitted |
ValueChanged<String>? |
null |
Submit callback |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
SeaGlassSearchBar #
Search bar with glass effect:
SeaGlassSearchBar(
placeholder: 'Search messages',
showsCancelButton: true,
onChanged: (query) => performSearch(query),
onCancel: () => clearSearch(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
controller |
TextEditingController? |
null |
Text controller |
placeholder |
String |
'Search' |
Placeholder text |
onChanged |
ValueChanged<String>? |
null |
Text change callback |
onSubmitted |
ValueChanged<String>? |
null |
Submit callback |
onCancel |
VoidCallback? |
null |
Cancel callback |
showsCancelButton |
bool |
false |
Show cancel button |
autofocus |
bool |
false |
Auto focus |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
SeaGlassDivider #
Glass divider line:
SeaGlassDivider()
SeaGlassDivider.vertical(indent: 8, endIndent: 8)
| Parameter | Type | Default | Description |
|---|---|---|---|
thickness |
double |
0.5 |
Line thickness |
indent |
double |
0.0 |
Leading indent |
endIndent |
double |
0.0 |
Trailing indent |
color |
Color? |
null |
Line color |
height |
double? |
null |
Divider height |
axis |
Axis |
horizontal |
Horizontal or vertical |
SeaGlassProgressIndicator #
Circular or linear progress indicator:
// Circular loading spinner
SeaGlassProgressIndicator.circular()
// Circular with progress
SeaGlassProgressIndicator.circular(value: 0.7, size: 40, strokeWidth: 4)
// Linear progress bar
SeaGlassProgressIndicator.linear(value: 0.5)
SeaGlassStepper #
Numeric stepper (+/−):
SeaGlassStepper(
value: quantity,
min: 0,
max: 99,
step: 1,
onChanged: (value) => setState(() => quantity = value),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
double |
required | Current value |
onChanged |
ValueChanged<double>? |
required | Value change callback |
min |
double |
0.0 |
Minimum value |
max |
double |
100.0 |
Maximum value |
step |
double |
1.0 |
Step increment |
wraps |
bool |
false |
Wrap around at bounds |
autoRepeat |
bool |
true |
Auto-repeat on hold |
SeaGlassPicker #
Picker field that opens a bottom sheet:
SeaGlassPicker(
value: selectedCategory,
placeholder: 'Select Category',
onTap: () => showCategoryPicker(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
String? |
null |
Selected value text |
onTap |
VoidCallback? |
null |
Tap handler |
placeholder |
String |
'Select' |
Placeholder text |
icon |
Widget? |
null |
Trailing icon |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
SeaGlassToolbar #
Toolbar container for action buttons:
SeaGlassToolbar(
children: [
SeaGlassIconButton(icon: CupertinoIcons.bold, onPressed: () {}),
SeaGlassIconButton(icon: CupertinoIcons.italic, onPressed: () {}),
SeaGlassIconButton(icon: CupertinoIcons.underline, onPressed: () {}),
],
)
SeaGlassButtonGroup #
Segmented icon button group:
SeaGlassButtonGroup(
children: [
SeaGlassIconButton(icon: CupertinoIcons.bold, onPressed: () {}),
SeaGlassIconButton(icon: CupertinoIcons.italic, onPressed: () {}),
SeaGlassIconButton(icon: CupertinoIcons.underline, onPressed: () {}),
],
)
| Parameter | Type | Default | Description |
|---|---|---|---|
children |
List<Widget> |
required | Button widgets |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
SeaGlassContainer #
Generic glass container with customizable radius:
SeaGlassContainer(
padding: EdgeInsets.all(16),
borderRadius: 12,
child: Text('Content'),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget? |
null |
Content widget |
padding |
EdgeInsetsGeometry? |
null |
Inner padding |
margin |
EdgeInsetsGeometry? |
null |
Outer margin |
width |
double? |
null |
Fixed width |
height |
double? |
null |
Fixed height |
borderRadius |
double |
20 |
Corner radius |
settings |
LiquidGlassSettings? |
null |
Custom glass settings |
SeaGlassPageControl #
Dot indicator for PageView:
SeaGlassPageControl(
count: 4,
currentPage: _pageIndex,
onPageChanged: (index) => setState(() => _pageIndex = index),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
count |
int |
required | Total pages |
currentPage |
int |
0 |
Current page index |
onPageChanged |
ValueChanged<int>? |
null |
Page change callback |
SeaGlassMaterialize #
Fade-in/out animation wrapper:
SeaGlassMaterialize(
visible: _isVisible,
child: SeaGlassCard(child: Text('Content')),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Target widget |
visible |
bool |
true |
Visibility state |
duration |
Duration |
400ms |
Animation duration |
curve |
Curve |
easeInOut |
Animation curve |
SeaGlassNavigationShell #
Glass page transition wrapper:
SeaGlassNavigationShell(
child: YourContent(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Content widget |
SeaGlassPage #
Glass page with background sampling:
SeaGlassPage(
child: SafeArea(child: YourContent()),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Page content |
statusBarStyle |
SystemUiOverlayStyle? |
null |
Status bar style |
navigationBarStyle |
SystemUiOverlayStyle? |
null |
Nav bar style |
SeaLiquidGlassScope #
Provides liquid glass scope for child widgets:
SeaLiquidGlassScope(
child: YourGlassWidgets(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Child widgets |
useOwnLayer |
bool |
false |
Independent glass layer |
SeaGlassProgressiveBlur #
Progressive blur overlay:
SeaGlassProgressiveBlur(
maxSigma: 18,
direction: BlurDirection.topToBottom,
)
| Parameter | Type | Default | Description |
|---|---|---|---|
maxSigma |
double |
18 |
Maximum blur sigma |
minSigma |
double |
0 |
Minimum blur sigma |
direction |
BlurDirection |
topToBottom |
Blur gradient direction |
falloff |
BlurFalloff |
linear |
Blur falloff curve |
SeaGlassPasswordField #
Password input with visibility toggle:
SeaGlassPasswordField(
placeholder: 'Password',
onChanged: (value) => updatePassword(value),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
controller |
TextEditingController? |
null |
Text controller |
placeholder |
String? |
null |
Placeholder text |
onChanged |
ValueChanged<String>? |
null |
Text change callback |
onSubmitted |
ValueChanged<String>? |
null |
Submit callback |
focusNode |
FocusNode? |
null |
Focus node |
autofocus |
bool |
false |
Auto focus |
enabled |
bool |
true |
Enabled state |
SeaGlassFormField #
Labeled form field wrapper:
SeaGlassFormField(
label: 'Email',
child: SeaGlassTextField(placeholder: 'Enter email'),
helperText: "We'll never share your email",
errorText: hasError ? 'Invalid email' : null,
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Input widget |
label |
String? |
null |
Field label |
helperText |
String? |
null |
Helper text below |
errorText |
String? |
null |
Error text (red) |
SeaGlassTextArea #
Multiline text input:
SeaGlassTextArea(
placeholder: 'Write a message...',
maxLines: 5,
minLines: 3,
onChanged: (value) => updateMessage(value),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
controller |
TextEditingController? |
null |
Text controller |
placeholder |
String? |
null |
Placeholder text |
maxLines |
int |
5 |
Maximum lines |
minLines |
int |
1 |
Minimum lines |
onChanged |
ValueChanged<String>? |
null |
Text change callback |
enabled |
bool |
true |
Enabled state |
SeaGlassMenu #
Glass popup menu:
SeaGlassMenu(
trigger: SeaGlassButton(label: 'Menu', onTap: () {}),
items: [
SeaGlassMenuItem(icon: Icon(CupertinoIcons.share, size: 16), title: 'Share', onTap: () => share()),
SeaGlassMenuItem(icon: Icon(CupertinoIcons.copy, size: 16), title: 'Copy', onTap: () => copy()),
SeaGlassMenuItem(icon: Icon(CupertinoIcons.trash, size: 16), title: 'Delete', isDestructive: true, onTap: () => delete()),
],
)
| Parameter | Type | Default | Description |
|---|---|---|---|
trigger |
Widget? |
null |
Trigger widget |
items |
List<Widget> |
required | Menu items |
menuAlignment |
GlassMenuAlignment? |
null |
Menu alignment |
menuWidth |
double |
200 |
Menu width |
SeaGlassPopover #
Glass popover with flexible content:
SeaGlassPopover(
trigger: SeaGlassButton(label: 'Open', onTap: () {}),
contentBuilder: (context) => Padding(
padding: EdgeInsets.all(16),
child: Text('Popover content'),
),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
trigger |
Widget |
required | Trigger widget |
contentBuilder |
WidgetBuilder |
required | Content builder |
alignment |
GlassPopoverAlignment? |
null |
Popover alignment |
SeaGlassPullDownButton #
Pull-down action menu button:
SeaGlassPullDownButton(
label: 'Actions',
icon: Icon(CupertinoIcons.ellipsis_circle),
items: [
SeaGlassMenuItem(icon: Icon(CupertinoIcons.pencil, size: 16), title: 'Edit', onTap: () => edit()),
SeaGlassMenuItem(icon: Icon(CupertinoIcons.doc_on_clipboard, size: 16), title: 'Copy', onTap: () => copy()),
],
)
| Parameter | Type | Default | Description |
|---|---|---|---|
label |
String? |
null |
Button label |
icon |
Widget? |
null |
Button icon |
items |
List<Widget> |
required | Menu items |
onSelected |
ValueChanged<String>? |
null |
Selection callback |
SeaGlassActionSheet #
Plain confirmations and destructive choices use the centred alert form, the way iOS 26/27 presents an action sheet with no anchor to attach to. Operational or selection flows that want the docked bottom glass sheet opt in explicitly:
showSeaGlassActionSheet(
title: 'Choose Action',
message: 'Select an option below',
actions: [
SeaGlassActionSheetAction(label: 'Share', onPressed: () => share()),
SeaGlassActionSheetAction(label: 'Delete', isDestructive: true, onPressed: () => delete()),
],
cancelLabel: 'Cancel',
barrierDismissible: true,
// style: SeaActionSheetStyle.bottom, // opt in to the docked sheet
)
| Parameter | Type | Default | Description |
|---|---|---|---|
context |
BuildContext |
required | Build context |
title |
String? |
null |
Sheet title |
message |
String? |
null |
Sheet message |
actions |
List<SeaGlassActionSheetAction> |
required | Action items |
cancelLabel |
String |
'Cancel' |
Cancel button text |
showCancelButton |
bool |
true |
Show cancel button |
barrierDismissible |
bool |
true |
Dismiss on tap outside |
style |
SeaActionSheetStyle |
centered |
centered is the iOS 26/27 alert-like form (default); bottom opts in to the docked glass sheet for operational/selection flows |
SeaGlassModalSheet #
Modal bottom sheet with a drag handle. By default it sizes to its content, up
to the available screen height. To get a fractional-height sheet that can be
dragged between detents (useful for media controls and collapsible previews),
pass halfSize, initialState, or mode. showSeaGlassSheet is the direct
content-sized API.
showSeaGlassModalSheet(
// Omit detent options for a content-sized sheet.
builder: (context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
Text('Modal Sheet'),
Text('This is a glass modal sheet.'),
],
),
)
To opt into fractional-height detents:
showSeaGlassModalSheet(
halfSize: 0.45,
builder: (context) => const NowPlayingPanel(),
)
SeaGlassSheetScaffold #
SeaGlassModalSheet is the glass surface and nothing else: a caller building on
it has to invent its own padding, header and way out, which is how four sheets
in one app end up with four sets of margins. This is the frame that goes inside
one — the layout SeaGlassDialogSheet.show was already assuming in showConfirm
and in the action and selection sheets.
SeaGlassDialogSheet.show<String>(
builder: (sheetContext) => SeaGlassSheetScaffold(
title: 'Rename project',
actions: [
SeaGlassSheetAction(
label: 'Save',
isPrimary: true,
result: 'saved',
),
],
child: SeaGlassTextField(placeholder: 'Project name'),
),
);
Or let it present itself — the same frame through SeaGlassDialogSheet.show:
final answer = await SeaGlassSheetScaffold.show<String>(
title: 'Rename project',
actions: [SeaGlassSheetAction(label: 'Save', result: 'saved')],
child: SeaGlassTextField(placeholder: 'Project name'),
);
| Parameter | Default | What it does |
|---|---|---|
title / subtitle / closeLabel / onClose |
— | The centred title header, the line under it (what the answer means), and its close control; onClose pops when unset, so a titled panel always offers a way out |
leading / trailing |
— | The controls beside the title. The close ✕ owns the right; a second control (refresh, filter) goes in leading, on the left. trailing is for a label — a live count — that sits left of the ✕ |
leadingIcon / trailingIcon / on*IconTap |
— | Corner icons instead of a header row; trailingIcon takes the right corner and the ✕ steps aside |
header |
— | Replaces the title header outright |
child / children |
— | The content, in the family's SeaSpacing.lg gutter |
primaryAction |
— | The one bottom button: full width, primary. primaryAction.enabled = false greys it out (the "nothing to save yet" state). A sheet carries either this or actions |
actions |
— | Action rows under the content (SeaSpacing.sm apart, so Cancel/Save never read as one split button); tapping one pops the sheet with its result |
fillHeight |
false |
Gives the content the height the sheet has left — for a list or a long settings pane |
padding |
only(top: 8, bottom: 16) |
The sheet-level inset; horizontal gutters belong to the rows, which is what puts a row's edge at the same 24pt the action sheet measures |
contentInset / gap |
SeaSpacing.lg |
Left/right inset of the content and the bottom button, and the space between the content and that button. Selection sheets pass sm, so their rows are wider than a plain panel's |
Long content scrolls; it does not overflow. When fillHeight is false the
content sits in a loose Flexible, not a fixed box: a ListView or a long
Column inside a SingleChildScrollView gets a bounded height and scrolls
within the sheet, while short content still sizes the panel to itself. Before
that it was a plain child, so a 12-row "max concurrent downloads" panel drew
53pt past the bottom edge and the last row was unreachable.
Which sheet to reach for: a list of choices is SeaGlassSelectionSheet.showSingle
/ showMultiple, operational choices are showSeaGlassActionSheet, and
anything else with a title and an answer is this.
| Parameter | Type | Default | Description |
|---|---|---|---|
context |
BuildContext |
required | Build context |
builder |
WidgetBuilder |
required | Sheet content builder |
halfSize |
double? |
null |
Fractional-height detent; setting it enables detent mode |
initialState |
GlassSheetState? |
null |
Initial detent; setting it enables detent mode |
mode |
GlassSheetMode? |
null |
Detent interaction mode; setting it enables detent mode |
isDismissible |
bool |
true |
Dismiss by drag/tap outside |
SeaGlassBackground #
Gradient background with glow blobs:
// Default background
SeaGlassBackground(child: YourContent())
// Custom gradient
SeaGlassBackground(
lightGradient: [Color(0xFFE8F5E9), Color(0xFFE3F2FD)],
darkGradient: [Color(0xFF0D1B0E), Color(0xFF0D1B2A)],
child: YourContent(),
)
// Custom glow blobs
SeaGlassBackground(
glowBlobs: [
SeaGlowBlob(
top: -100, left: -50, size: 300,
lightColor: Color(0x4D20BFA9),
darkColor: Color(0x4720BFA9),
),
SeaGlowBlob(
bottom: -80, right: -60, size: 280,
lightColor: Color(0x385856D6),
darkColor: Color(0x385856D6),
),
],
child: YourContent(),
)
SeaGlowBlob #
Glow blob configuration for SeaGlassBackground:
| Parameter | Type | Default | Description |
|---|---|---|---|
top |
double |
NaN |
Top position (NaN = not set) |
left |
double |
NaN |
Left position |
right |
double |
NaN |
Right position |
bottom |
double |
NaN |
Bottom position |
size |
double |
required | Blob diameter |
lightColor |
Color |
required | Color in light mode |
darkColor |
Color |
required | Color in dark mode |
Dialogs & Sheets #
SeaGlassDialog #
Glass morphism dialog:
// Custom dialog
SeaGlassDialog.show(
title: 'Confirm',
message: 'Are you sure?',
actions: [
SeaDialogAction(label: 'Cancel', onPressed: () => Navigator.pop(context)),
SeaDialogAction(label: 'OK', isPrimary: true, onPressed: () => handleOk()),
],
);
// Confirm dialog shortcut
SeaGlassDialog.showConfirm(
title: 'Delete Item',
message: 'This action cannot be undone.',
isDestructive: true,
onConfirm: () => deleteItem(),
);
SeaGlassSheet #
The glass surface a bottom sheet is drawn on. Docked flush with the bottom edge
it keeps its bottom corners square and rounds only the top, at
SeaRadius.sheet (28pt); give it a margin that leaves a gap and the bottom
corners round themselves.
SeaGlassSheet(
child: Column(
children: [
SeaGlassSheetHeader(title: 'Options'),
SeaGlassListTile(title: const Text('Option 1'), onTap: () {}),
SeaGlassListTile(title: const Text('Option 2'), onTap: () {}),
],
),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget |
required | Sheet content |
topBorderRadius |
double |
SeaRadius.sheet |
Top corner radius |
bottomBorderRadius |
double? |
null |
Bottom radius; auto — 0 when docked, rounded when floating |
margin |
EdgeInsetsGeometry |
8pt sides + bottom | Outer margin |
padding |
EdgeInsetsGeometry? |
null |
Content padding, below the drag indicator |
showDragIndicator |
bool |
true |
Drag pill at the top |
isScrollable |
bool |
true |
Let the content scroll inside the sheet |
settings |
LiquidGlassSettings? |
null |
Glass settings for this surface |
enableInteractionGlow |
bool |
false |
Tap haptic on the glass — off, because a tap must not buzz |
showSeaGlassSheet(context, builder: ...) pushes the same surface as a route
and hands it the drag-to-dismiss behaviour. It sizes to the content (up to the
available screen height), so use it for a presented short panel and the widget
when you are building the surface yourself. Use showSeaGlassModalSheet when
the sheet should rest at and move between fractional-height detents.
enableInteractionGlow is false on both paths (and on
showSeaGlassModalSheet / SeaGlassModalSheet). The vendor couples the tap
haptic to the same flag that draws the finger-following specular glint, so
turning it back on buys the glint at the price of a vibration — the saturation
pulse is a separate flag and stays on either way, so touch feedback never goes
fully silent.
showSeaGlassModalSurface #
The route every glass modal in the library is presented through — a centred alert, a dialog, a permission prompt. It resolves the surface with iOS 26's materialize transition instead of fading it.
showSeaGlassModalSurface<void>(
builder: (context) => MyGlassPanel(),
);
| Parameter | Type | Default | Description |
|---|---|---|---|
context |
BuildContext |
required | Build context |
builder |
WidgetBuilder |
required | The surface to present |
barrierDismissible |
bool |
false |
Dismiss by tapping the dim |
barrierLabel |
String? |
Cupertino default | Accessibility label for the barrier |
useRootNavigator |
bool |
true |
Present above the whole app |
scaleFrom |
double |
1.12 |
Scale the surface resolves in from; 1.0 for a full-bleed surface |
Use this rather than showCupertinoDialog for anything containing glass.
showCupertinoDialog fades its route in, and a backdrop glass pass cannot be
faded — the surface spends the fade looking flat and then snaps to glass.
Toast & Loading #
Sea (Unified API) #
Global toast and loading indicators with iOS 27 glass style:
// Loading
Sea.loading.show();
Sea.loading.show('Loading data...');
// Progress
Sea.loading.progress(0.5, 'Downloading...');
// Toast
Sea.toast.show('Hello World');
Sea.toast.success('Saved successfully');
Sea.toast.error('Something went wrong');
Sea.toast.info('Tip: swipe to delete');
// Dismiss
Sea.loading.dismiss();
// Check if showing
if (Sea.loading.isShowing) { ... }
SeaGlassToast #
Glass overlay toast with type indicators:
SeaGlassToast.show(
// context is optional: the ambient overlay is used when omitted.
context,
title: 'Success',
message: 'Data saved successfully',
type: SeaToastType.success,
duration: Duration(seconds: 3),
// Where it lands: .center (the default HUD), .top / .bottom (banners).
position: SeaToastPosition.center,
);
// Types: SeaToastType.info, .success, .warning, .danger
// Positions: SeaToastPosition.top, .center, .bottom
Refresh & Pagination #
SeaRefreshWidget #
Pull-down refresh & pull-up load more:
SeaRefreshWidget(
onRefresh: () async {
final rows = await loadData();
return SeaLoadResult(count: rows.length); // or `true` / just nothing
},
onLoad: () async {
final hasMore = await loadMoreData();
return hasMore;
},
noMore: isNoMore,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) => ItemWidget(items[index]),
),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget? |
null |
Scrollable content |
childBuilder |
Widget Function(BuildContext, ScrollPhysics)? |
null |
Builds the scrollable, handing it the physics the indicator drives — use it when the scroll view is not yours to wrap (SeaAppPage does this) |
onRefresh |
SeaCallback? |
null |
Pull-down refresh callback |
onLoad |
SeaCallback? |
null |
Pull-up load more callback |
noMore |
bool |
false |
No more data flag |
noMoreText |
String? |
null |
Shown under the footer once there is nothing left to load |
footerInset |
double |
0 |
Lifts the load-more indicator off the bottom of the viewport — pass SeaInsets.bottom so it clears a floating tab bar instead of settling under it |
headerInset |
double |
0 |
Lifts the pull-down indicator by this much — the mirror of footerInset, for a reverse: true scroll view, where the header is anchored to the bottom of the viewport |
footerTopInset |
double |
0 |
Holds the load-more indicator clear of the top of the viewport — which is where a reverse: true scroll view puts it, and the strip a compact page draws its toolbar over. Padding the top is what carries it down; SeaAppPage fills the value in for you |
enablePullDown |
bool |
true |
Enable pull-down (only wired up when there is an onRefresh) |
locateHeader |
bool |
false |
Positions the pull-down indicator with a HeaderLocator you placed in the scroll view, instead of pinning it to the top of the viewport (SeaAppPage does this, and documents why) |
controller |
EasyRefreshController? |
null |
External controller |
header |
Header? |
CupertinoHeader() |
Custom header |
footer |
Footer? |
CupertinoFooter() |
Custom footer |
What the callbacks return is read as a SeaLoadResult — and it is what tells
the indicator to settle on "no more" or on a failure, because a callback that
catches its own throw (every mixin's refresh) has no other way to report one.
Return a SeaLoadResult, or anything SeaLoadResult.of can read: an Iterable
or a number (a count), a bool (the original "no more"), or nothing.
SeaPageMixin #
Mixin for paginated data loading, on the page:
class MyPage extends StatefulWidget {
@override
State<MyPage> createState() => _MyPageState();
}
class _MyPageState extends State<MyPage> with SeaPageMixin<Item, MyPage> {
@override
int seaInitializePage = 1; // Start from page 1
@override
int seaPageCount = 20; // Items per page
@override
Future<List<Item>> seaLoadData(int page) async {
final response = await api.getItems(page: page, size: seaPageCount);
return response.items;
}
@override
Widget build(BuildContext context) {
if (seaLoading && seaData.isEmpty) {
return const Center(child: SeaLoadingWidget());
}
if (seaError && seaData.isEmpty) {
return Center(child: Text('Error loading data'));
}
return SeaRefreshWidget(
seaOnRefresh: seaRefresh,
seaOnLoad: seaLoadMore,
seaChild: ListView.builder(
itemCount: seaData.length,
itemBuilder: (context, index) => ItemWidget(seaData[index]),
),
);
}
}
Prefer
SeaListController<T>in new code. The mixin keeps its paging state on the page, so the page still owns the list and still has tosetState.SeaListController<T>moves the same five things onto the controller — where the list is generic overT, the pages arrive without a manualsetState, and the page is left indexingseaData— and is what aSeaPageis built to pair with. This mixin stays for the pages that are notSeaPages.
| Property | Type | Default | Description |
|---|---|---|---|
seaData |
List<T> |
[] |
Loaded data list |
seaPage |
int |
seaInitializePage |
Current page |
seaLoading |
bool |
false |
Loading state |
seaNoMore |
bool |
false |
No more data |
seaError |
bool |
false |
Error state |
seaInitializePage |
int |
0 |
Starting page number |
seaPageCount |
int |
20 |
Items per page |
seaAutoNoMore |
bool |
true |
Auto-detect no more |
| Method | Returns | Description |
|---|---|---|
seaLoadData(page) |
Future<List<T>> |
Abstract: fetch data for page |
seaRefresh() |
Future<SeaLoadResult> |
Refresh from first page |
seaLoadMore() |
Future<SeaLoadResult> |
Load next page |
seaDataAdded(isRefresh) |
void |
Override: after data added |
seaOnError(e) |
void |
Override: handle errors |
seaIsNormal |
bool |
!seaError && !seaLoading && seaData.isNotEmpty |
seaIsEmpty |
bool |
seaData.isEmpty |
seaOtherWidget |
Widget |
Error → loading → empty, resolved for you |
seaErrorWidget() / seaEmptyWidget() / seaLoadingWidget() |
Widget |
Override: the three state views |
Both loads report the state they have just put the mixin in — count is
data.length, noMore is the flag the last page decided, and a caught throw
comes back as error — which is exactly what a SeaAppPage needs to draw the
spinner, the empty state and the error.
SeaStatusMixin #
Mixin for loading / error / empty three-state page management with built-in iOS 27 glass widgets:
class MyPage extends StatefulWidget {
@override
State<MyPage> createState() => _MyPageState();
}
class _MyPageState extends State<MyPage> with SeaStatusMixin<MyPage> {
late DataModel data;
@override
Future<dynamic> loadData() async {
data = await api.fetchData();
}
@override
bool get empty => data == null;
@override
Widget build(BuildContext context) {
if (!isNormal) return otherWidget; // auto handles loading/error/empty
return ContentView(data);
}
}
Built-in widgets (all overridable):
| Method | Default | Description |
|---|---|---|
errorWidget() |
⚠️ icon + "Something went wrong" + Retry button | Error state |
emptyWidget() |
📭 icon + "No data" | Empty state |
loadingWidget() |
CupertinoActivityIndicator |
Loading state |
otherWidget |
Computed from error/empty/loading |
Auto-selects the right widget |
| Property | Type | Description |
|---|---|---|
loading |
bool |
Loading state |
error |
bool |
Error state |
empty |
bool |
Abstract: is data empty? |
isNormal |
bool |
!error && !empty && !loading |
| Method | Returns | Description |
|---|---|---|
loadData() |
Future<dynamic> |
Abstract: fetch data |
refresh() |
Future<SeaLoadResult> |
Reload data; reports empty as the count |
onError(e) |
void |
Override: handle errors |
Services #
SeaSupabase #
Supabase client wrapper with authentication and database operations:
// Initialize (auto-called by SeaApp with supabaseConfig)
await Sea.supabase.init(
supabaseUrl: 'https://your-project.supabase.co',
supabaseAnonKey: 'your-anon-key',
);
// Authentication
await Sea.supabase.signInWithEmail(email: 'user@example.com', password: 'pass');
await Sea.supabase.signUpWithEmail(email: 'user@example.com', password: 'pass');
await Sea.supabase.signInWithApple();
await Sea.supabase.signInWithGoogle();
await Sea.supabase.signInWithGithub();
await Sea.supabase.signOut();
await Sea.supabase.resetPasswordForEmail('user@example.com');
await Sea.supabase.updatePassword('newPassword');
// State
Sea.supabase.isLoggedIn; // bool
Sea.supabase.currentUser; // User?
Sea.supabase.userId; // String?
Sea.supabase.userEmail; // String?
Sea.supabase.onAuthStateChange; // Stream<AuthState>
// Database
final data = await Sea.supabase.selectAll('users');
final data = await Sea.supabase.selectAll('users', filter: (q) => q.eq('id', '123'));
await Sea.supabase.insert('users', {'name': 'John'});
await Sea.supabase.update('users', {'name': 'Jane'}, column: 'id', value: '123');
await Sea.supabase.delete('users', column: 'id', value: '123');
// Raw client (via SeaSupabase static class)
SeaSupabase.client; // SupabaseClient
SeaSupabase.auth; // GoTrueClient
SeaSupabase.storage; // SupabaseStorageClient
SeaSupabase.from('table'); // SupabaseQueryBuilder
SeaAuthPage #
iOS 27-style authentication page with glass morphism:
SeaAuthPage(
initialMode: SeaAuthMode.login, // .login, .signUp, .forgotPassword
showSocialLogin: true, // Show Apple/Google/GitHub buttons
showForgotPassword: true, // Show "Forgot Password?" link
showSignUp: true, // Show "Sign Up" option
header: Text('Welcome'), // Custom header widget
onLoginSuccess: () => navigateHome(),
onSignUpSuccess: () => navigateHome(),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
initialMode |
SeaAuthMode |
login |
Initial auth mode |
showSocialLogin |
bool |
true |
Show OAuth buttons |
showForgotPassword |
bool |
true |
Show forgot password |
showSignUp |
bool |
true |
Show sign up option |
header |
Widget? |
null |
Custom header |
onLoginSuccess |
VoidCallback? |
null |
Login success callback |
onSignUpSuccess |
VoidCallback? |
null |
Sign up success callback |
defaultEmail |
String |
Sea.appInfoConfig.defaultEmail |
Pre-filled email |
Sea.dialog.loginDialog() — Centered Dialog Mode #
Show authentication in a centered, scrollable glass dialog with a compact layout. The app icon is omitted in this presentation, and Google, Apple and GitHub sign-in options are arranged horizontally:
// Login dialog
Sea.dialog.loginDialog();
// Sign up dialog
Sea.dialog.loginDialog(
initialMode: SeaAuthMode.signUp,
onLoginSuccess: () => navigateHome(),
);
// Forgot password dialog
Sea.dialog.loginDialog(
initialMode: SeaAuthMode.forgotPassword,
showSocialLogin: false,
);
| Parameter | Type | Default | Description |
|---|---|---|---|
context |
BuildContext |
required | Build context |
initialMode |
SeaAuthMode |
login |
Initial auth mode |
showSocialLogin |
bool |
true |
Show OAuth buttons |
showForgotPassword |
bool |
true |
Show forgot password |
showSignUp |
bool |
true |
Show sign up option |
onLoginSuccess |
VoidCallback? |
null |
Login success callback |
onSignUpSuccess |
VoidCallback? |
null |
Sign up success callback |
defaultEmail |
String |
Sea.appInfoConfig.defaultEmail |
Pre-filled email |
SeaAuthPage.showDialog(context, ...) remains available as a compatibility
entry point and uses the same centered dialog presentation.
SeaGlassAboutPage #
Built-in about page with app info, privacy policy, and user agreement links:
// Default — uses SeaAppInfoConfig
Navigator.push(context, CupertinoPageRoute(
builder: (_) => const SeaGlassAboutPage(),
));
// Custom
Navigator.push(context, CupertinoPageRoute(
builder: (_) => SeaGlassAboutPage(
appName: 'My App',
version: '2.0.0',
buildNumber: '42',
copyright: '© 2026 My Company',
extraSections: [myCustomSection],
),
));
| Parameter | Type | Default | Description |
|---|---|---|---|
appName |
String? |
Sea.appInfoConfig.appName ?? Sea.appTitle |
App name |
version |
String? |
Sea.device.fullVersion |
Version string |
buildNumber |
String? |
Sea.device.buildNumber |
Build number |
copyright |
String? |
© year Sea.appTitle |
Copyright text |
extraSections |
List<Widget>? |
null |
Additional sections |
Features:
- Shows app icon from
SeaAppInfoConfig.appIconPath, with a default app glyph when no icon asset is configured or the asset cannot load - Displays device model, OS version
- Displays and opens the configured contact email
- Privacy Policy link → opens in
SeaWebView - User Agreement link → opens in
SeaWebView
SeaAppIcon #
Use the app icon configured once in SeaAppInfoConfig anywhere in the app:
// Configure the app icon once:
const appInfo = SeaAppInfoConfig(
appName: 'My App',
appIconPath: 'assets/icon/app_icon.png',
);
// Reuse it wherever the app identity is displayed:
const SeaAppIcon(size: 72);
Pass the same configuration to SeaApp:
SeaApp(
appInfoConfig: appInfo,
home: const HomePage(),
)
SeaAppIcon uses the configured asset and falls back to the native app glyph
if the path is missing or the image fails to load.
SeaWebView #
iOS-style WebView browser component with navigation controls, a smoothed loading progress bar, and a share button that opens the platform's native share sheet for the current page URL:
SeaWebView(
initialUrl: 'https://www.apple.com',
title: 'Apple',
showAppBar: true,
showProgressBar: true,
javaScriptMode: {JavaScriptMode.unrestricted},
onUrlChanged: (url) => print('URL: $url'),
onTitleChanged: (title) => print('Title: $title'),
onProgress: (progress) => print('Progress: $progress%'),
onPageFinished: (url) => print('Loaded: $url'),
onError: (error) => print('Error: $error'),
)
| Parameter | Type | Default | Description |
|---|---|---|---|
initialUrl |
String |
required | Initial URL to load |
title |
String? |
null |
Page title override |
showAppBar |
bool |
true |
Show navigation bar |
showProgressBar |
bool |
true |
Show loading progress bar |
javaScriptMode |
Set<JavaScriptMode> |
{unrestricted} |
JavaScript mode |
onUrlChanged |
ValueChanged<String>? |
null |
URL change callback |
onTitleChanged |
ValueChanged<String>? |
null |
Title change callback |
onProgress |
ValueChanged<int>? |
null |
Progress callback (0-100) |
onError |
ValueChanged<WebResourceError>? |
null |
Error callback |
onPageStarted |
ValueChanged<String>? |
null |
Page load started |
onPageFinished |
ValueChanged<String>? |
null |
Page load finished |
allowedNavigation |
List<String> |
[] |
Allowed navigation domains |
loadingWidget |
Widget? |
null |
Custom loading widget |
errorWidget |
Widget? |
null |
Custom error widget |
SeaAnalytics #
Firebase Analytics wrapper:
// Initialize (auto-called by SeaApp with firebaseConfig)
await Sea.analytics.init();
// Log events
Sea.analytics.logEvent(name: 'button_click', parameters: {'button': 'submit'});
Sea.analytics.logScreenView(screenName: 'HomePage');
Sea.analytics.setUserId(id: 'user-123');
Sea.analytics.setUserProperty(name: 'plan', value: 'premium');
// State
Sea.analytics.isInitialized; // bool
SeaLog #
Debug logging with toggle:
Sea.log.d('Debug message');
Sea.log.i('Info message');
Sea.log.w('Warning message');
Sea.log.e('Error message');
Sea.log.isEnabled; // bool
SeaDevice #
Device information retrieval:
// Initialize (auto-called by SeaApp with servicesConfig.autoInitDevice)
await Sea.device.init();
Sea.device.deviceModel; // 'iPhone 15 Pro'
Sea.device.osVersion; // '17.0'
Sea.device.manufacturer; // 'Apple'
Sea.device.appName; // 'MyApp'
Sea.device.fullVersion; // '1.0.0+1'
Sea.device.isInitialized; // bool
SeaStorage #
Local key-value storage (SharedPreferences):
// Initialize (auto-called by SeaApp with servicesConfig.autoInitStorage)
await Sea.storage.init();
Sea.storage.setString('key', 'value');
Sea.storage.getString('key'); // 'value'
Sea.storage.setInt('count', 42);
Sea.storage.getInt('count'); // 42
Sea.storage.setBool('dark', true);
Sea.storage.getBool('dark'); // true
Sea.storage.remove('key');
Sea.storage.containsKey('key'); // Future<bool>
Sea.storage.isInitialized; // bool
SeaHttp #
HTTP client wrapper (Dio):
// Initialize
Sea.http.init(baseUrl: 'https://api.example.com', headers: {'Authorization': 'Bearer $token'});
// Requests
final data = await Sea.http.requestGet<List<User>>('/users', fromJson: (json) => (json as List).map(User.fromJson).toList());
final result = await Sea.http.requestPost('/users', data: {'name': 'John'});
Sea.http.isInitialized; // bool
SeaConnectivity #
Network connectivity monitoring:
final online = await Sea.connectivity.isOnline; // bool
final wifi = await Sea.connectivity.isWifi; // bool
final mobile = await Sea.connectivity.isMobile; // bool
SeaPermission #
Permission handling:
await Sea.permission.camera();
await Sea.permission.photos();
await Sea.permission.location();
await Sea.permission.notification();
await Sea.permission.requestIfNeeded(Permission.camera);
await Sea.permission.openSettings();
SeaRating #
In-app review, and the launch-time prompt that decides whether to ask at all:
await Sea.rating.requestReview(); // the system sheet, no prompt of our own
SeaRatingPrompt.maybeShow() is what SeaApp schedules after the first frame.
It is not a "show every launch" nag: the count, the last-prompt time and the
"already rated" flag live in local storage, the thresholds and all of the copy
(rating.title / body / rate / later) come from the remote config with a
built-in fallback per locale. It returns whether it actually showed anything —
announcements use that as a gate, so a low-priority prompt never stacks on top
of a message dialog. Tapping "Rate" tries the in-app sheet first and falls back
to the store page, every step with a timeout, because the review channel simply
does not answer on some ROMs.
SeaMessageCenter — announcements #
// SeaApp calls this for you when the remote config carries a `messages` block
await SeaMessageCenter.maybeShow();
Each entry is version-gated (minVersion / maxVersion), locale-aware, and
carries buttons that can close, open an in-app webview, an external url, a
store page, or a deeplink. The dialog itself is the library's own glass one, so
an announcement looks like the rest of the app instead of like a system alert.
Sea.remote — one hosted JSON for everything #
Sea.hasRemoteConfig; // SeaApp registered the service
final cfg = Sea.remote.value; // the parsed document
cfg.maintenance.active(DateTime.now()); // maintenance window
cfg.update.minSupportedVersion['ios']; // the update gate, per platform
cfg.featureBool('new_search'); // feature flags / rollout
cfg.featureString('search_engine'); // string / number variants too
await Sea.remote.refresh(force: true); // re-fetch now
Sea.remote.launches; // launches so far, incl. this one
Sea.remote.daysSinceInstall;
The document drives all five behaviours an app normally hard-codes: the ad
policy (SeaAdsPolicy), announcements, the update gate, maintenance
mode and feature flags. It is cached to local storage and re-fetched in the
background with an ETag, so a cold start is never blocked on it, and there is a
bundled asset fallback for first launch / offline. Full field reference — every
key, its type and its default: doc/REMOTE_CONFIG.md.
Ready-made Pages #
Two screens (and one card) ship whole, so an app does not rebuild the same settings page and cache browser every time.
SeaGlassSettingsPage #
The settings screen every app needs, with the two boilerplate sections already
in it — Appearance (language + theme, driven by the app-wide controllers) and
More (website + about, fed from SeaAppInfoConfig) — plus whatever the app
puts on top:
SeaGlassSettingsPage(
title: 'Settings', // default: localised "Settings"
appSpecificSections: [
SeaGlassSection(header: const Text('My device'), children: [...]),
SeaGlassSection(header: const Text('Notifications'), children: [...]),
],
aboutVersion: '1.4.0', // shown on the About page
aboutExtraSections: [termsRow], // appended under it
// bannerSize: null, // ad slot inherited from SeaAppPage
);
- No "rate us" row, deliberately. Rating is a launch-time prompt
(
SeaRating, driven by the remote config'sratingblock), so the settings screen carries no tap that lands on a store page. - Do not add your own spacing between groups.
SeaAppPageinsertschildGapbetweenchildrenand appends the bottom clearance; a manualSizedBoxdoubles both. - An app that owns its own
SeaPagewrapper can splice the sections in instead of inheriting the page:SeaGlassSettingsPage.buildAppearanceSection(context),buildStorageSection(context),buildMoreSection(context, appInfoConfig).
SeaFileManagerPage #
A file browser for the directories the app itself owns — cache, temp, or any
Directory list you hand it:
SeaNavigator.push(context, const SeaFileManagerPage());
SeaFileManagerPage(
title: 'Downloads',
directories: [Sea.file.filesDirectory], // default: cache + temp dirs
pageSize: 50, // rows per pull-to-load
);
- Scan once, page in memory. The directories are read on open and on
pull-to-refresh; pull-up appends
pageSizerows, so a cache with thousands of files opens instantly. - Filters are the answers people actually want: all / large (every file ordered by size — "what is eating my storage") / image / video / audio / document / other, with a live total-size row for the current filter.
- Tap a row for open · share · save to Downloads · delete. Long-press enters selection mode (select-all + delete in the bar); leaving it restores tap-to-open.
- Delete asks first — a confirm dialog with the count and total size, and the delete is destructive-coloured. Safe to expose to users.
SeaFileEntry(path,name,size,sizeText,modified,kind,mimeType) is public, so a host can build its own list on the same scan.
SeaQrCodeCard #
The white card that makes a QR code scannable on a glass background. The QR
widget itself is whatever you generate the code with (qr_flutter, a web view,
your backend's PNG) — this only frames it:
SeaQrCodeCard(
qr: QrImageView(data: 'http://10.10.70.4:24680/', size: 200), // your widget
caption: 'Scan to open in a browser',
);
Without the white card a dark-mode QR code is a light-on-dark pattern that many phone cameras refuse to lock onto; the card forces the polarity and adds the quiet zone scanners need.
Ads #
Google Mobile Ads — banner, interstitial, rewarded, app open — behind one
policy (SeaAdsPolicy): cooldown, daily caps, first-launch skip, remove-ads
and the remote kill switch are decided in one place instead of at each call site.
Two ways in #
SeaApp already owns the setup — give it an adsConfig and it initialises the
SDK, asks for ATT on iOS, wires the app-open ad to "the app came back from the
background" and installs SeaRouteAdsObserver on the navigator. A page then only
asks for the shapes it actually uses:
SeaAdsWidget.banner(); // in page content
SeaAdsWidget.showInterstitial(onClosed: () => startServer()); // at a natural break
await SeaAdsWidget.loadRewardAd(context, provider, onReward: () => grant());
The page banner slot — never hand-place a second one #
SeaAppPage and SeaGlassSettingsPage already reserve a banner slot above
the content and fill it themselves, so a page never has to know about ad units:
SeaAppPage(title: 'Downloads', children: [...]); // one banner
SeaAppPage(title: 'Downloads', bannerSize: null, children: [...]); // no ad here
SeaAppPage(title: 'Downloads', bannerSize: AdSize.largeBanner, ...); // 320×100
SeaAppPage(title: 'Downloads', banner: myBanner, children: [...]); // yours wins
Two consequences that have bitten real apps:
- Adding
SeaAdsWidget.banner()tochildrenstacks a second ad under the slot — the page shows two banners, one right under the other. - Per-page
bannerSizemakes one app mix sizes. Leave it at the default (AdSize.banner, 320×50) unless the whole app moves to the large size; a mix of 320×100 and 320×50 in the same app reads as a layout bug.
SeaAdsWidget.banner() collapses to zero height whenever there is nothing
to show — not configured, premium (removeAds), switched off remotely, no fill,
still loading — and applies its margin only once an ad is actually on screen.
So do not wrap it in your own Padding: that padding survives the collapse and
leaves a gap.
Interstitial, rewarded, app open #
// Interstitial — onClosed is called EXACTLY once: ad watched, no fill,
// premium, SDK not ready, cooldown, daily cap. Put "what happens after the ad"
// in it (iDownload starts its LAN server there); an early return that skipped
// the callback would mean that work never runs.
SeaAdsWidget.showInterstitial(onClosed: () => navigateNext());
// Rewarded
await SeaAdsWidget.loadRewardAd(context, provider, onReward: () => grantReward());
// App open — called by SeaApp when the app returns from background, once per
// foreground session, after the policy's cooldown. Not for pages to call.
await SeaAdsWidget.loadAppOpenAd(provider, onClose: () => continueApp());
// Low-level (prefer showInterstitial: it applies the policy and reads
// currentProvider itself)
await SeaAdsWidget.loadPageAd(context, provider, onClosed: () => navigateNext());
| Static | What it tells you |
|---|---|
SeaAdsWidget.ready |
ValueNotifier<bool> — the SDK is really initialised. A banner created before this is true never loads; pages that build their own ad should wait on it |
SeaAdsWidget.currentProvider |
The merged provider SeaApp installed (null when the app has no ads — web, unconfigured). Read it so a hand-built ad follows the remote switches and removeAds |
SeaAdsWidget.init(provider) |
Done by SeaApp; call it yourself only when you are not using SeaApp |
SeaAdsWidget.requestAttPermission() |
iOS ATT prompt, once, at a moment you choose |
SeaAdsPolicy — every frequency knob in one object #
SeaAdsWidget.showInterstitial() and the app-open path both consult
SeaAdsPolicy.current, which is the merged result of the ads block in the
remote config (see doc/REMOTE_CONFIG.md) and the
adsConfig passed to SeaApp:
| Field | Meaning |
|---|---|
bannerEnabled / bannerDelayLaunches |
Banner kill switch, and how many launches to skip before the first |
interstitialEnabled / interstitialIntervalActions |
Kill switch; "one opportunity every N page pushes" (1 = every push) |
interstitialCooldownSeconds |
Minimum gap between two interstitials, foreground time only — backgrounding pauses the clock and closing the app does not consume the cooldown |
interstitialInitialDelaySeconds |
How long the user must have been in the app before the first interstitial can show |
interstitialDailyLimit |
Cap per calendar day |
appOpenEnabled / appOpenSkipFirstLaunches / appOpenCooldownSeconds / appOpenDailyLimit |
Same set for the app-open ad |
rewardEnabled |
Whether the rewarded entry point is offered at all |
Navigation-driven interstitials need nothing from you: SeaApp puts
SeaRouteAdsObserver on navigatorObservers, and it counts page pushes only
— the first route (the home screen) is skipped, dialogs and bottom sheets are
not a "page", and fullscreenDialog routes count.
SeaAdsProvider #
The ad-unit record. SeaApp merges it with the remote config before installing
it; refresh is called when removeAds flips so the UI can rebuild:
typedef SeaAdsProvider = ({
bool removeAds, // Hide all ads (e.g. premium user)
String googleBannerKey, // Banner ad unit ID
String googleAppOpenKey, // App Open ad unit ID
String googleRewardKey, // Rewarded ad unit ID
String googlePageKey, // Interstitial ad unit ID
void Function() refresh, // State refresh callback
});
The widget's own constructor is still there for a page that wants an explicitly sized, explicitly configured banner outside the page slot:
SeaAdsWidget(provider: provider, size: AdSize.mediumRectangle)
(size: null — the default — asks for an anchored adaptive banner: the width
follows the container and the SDK picks the height, which is why a fixed 320×50
looks wrong on a tablet and overflows on a narrow phone.)
Full API Reference #
| Component | Wraps / key members | Category |
|---|---|---|
SeaApp |
the whole setup: config objects, theme, background, bootstrap | Core |
Sea |
theme glass remote locale log device storage http connectivity permission rating analytics supabase file toast loading dialog auth keyboard clipboard haptics url format validators inputFormatters config appInfo appName appVersion isReady servicesReady hasRemoteConfig loadingTask<T>() |
Core |
SeaConfig |
instance, maybeInstance |
Core |
SeaAppInfoConfig |
appName, appIconPath, privacyPolicyUrl, userAgreementUrl, defaultEmail |
Core |
SeaAdsConfig · SeaFirebaseConfig · SeaSupabaseConfig · SeaGlassConfig · SeaServicesConfig · SeaLocaleConfig · SeaFileConfig |
the SeaApp constructor objects |
Core |
SeaThemeController |
themeMode (Rx), toggle(), setLight(), setDark(), setSystem() |
Core |
SeaGlassController |
gradientBackgroundEnabled, setGradientBackgroundEnabled() |
Core |
SeaSpacing · SeaRadius · SeaSizes · SeaMotion · SeaCurves · SeaOpacity · SeaInsets |
design tokens (the only numbers a page should restate) | Theme |
SeaColors |
palette, light / dark / of(context) |
Theme |
SeaColorScheme |
— | Theme |
SeaTextStyles |
iOS type ramp | Theme |
SeaGlassStyle |
LiquidGlassSettings |
Theme |
SeaGlassTheme |
GlassThemeData, settingsFor(context) |
Theme |
SeaSystemUi |
status / navigation bar styling | Theme |
SeaGlassBackground · SeaGlowBlob |
the app background | Layout |
SeaGlassScaffold |
GlassScaffold |
Layout |
SeaGlassContainer · SeaGlassContent · SeaGlassPage |
GlassContainer / GlassPage / content plumbing |
Layout |
SeaGlassCard · SeaGlassSection · SeaGlassDivider |
GlassCard / GlassGroupedSection / GlassDivider |
Layout |
SeaGlassListTile |
GlassListTile |
Layout |
SeaLiquidGlassScope · SeaGlassProgressiveBlur |
LiquidGlassScope / GlassProgressiveBlur |
Layout |
SeaPageSliver · SeaBottomInset · SeaBarMetrics · SeaBarMetricsScope |
page gutter, trailing clearance, bar geometry | Layout |
SeaGlassNavigationBar · SeaGlassAppBar · SeaGlassToolbar |
GlassAppBar |
Navigation |
SeaGlassLargeTitle · SeaPinnedLargeTitle · SeaGlassNavBarLargeTitle |
GlassLargeTitle + the pinned variant |
Navigation |
SeaGlassTabBar |
GlassTabBar |
Navigation |
SeaGlassNavigationShell |
GlassNavigationShell |
Navigation |
SeaGlassBackButton · SeaBackLabel |
the back control and its label | Navigation |
SeaNavigator |
push / replace / pop helpers |
Navigation |
SeaAppPage |
GlassScaffold + SeaRefreshWidget: the iOS page skeleton |
Navigation |
SeaPage · SeaPlainPage (typedef) · SeaNoController · SeaPageScope · SeaObs · SeaPageRetry |
a page, its controller and its wiring | Navigation |
SeaGlassSettingsPage · SeaGlassAboutPage · SeaFileManagerPage · SeaGlassDebugPage |
whole screens | Navigation |
SeaFileEntry |
one row of a directory scan | Navigation |
SeaGlassButton · SeaGlassIconButton · SeaGlassButtonGroup · SeaGlassButtonWrap |
GlassButton |
Interactive |
SeaGlassFloatingActionButton · SeaGlassSpeedDial |
FAB + its item fan-out | Interactive |
SeaGlassSegmentedControl |
GlassSegmentedControl |
Interactive |
SeaGlassFilterBar |
the chip row above a list | Interactive |
SeaGlassSwitch · SeaGlassSlider · SeaGlassStepper |
GlassSwitch / GlassSlider / GlassStepper |
Interactive |
SeaGlassChip · SeaGlassBadge · SeaGlassPageControl |
GlassChip / GlassBadge / GlassPageControl |
Interactive |
SeaGlassMaterialize |
GlassMaterialize |
Interactive |
SeaGlassTextField · SeaGlassPasswordField · SeaGlassTextArea · SeaGlassFormField |
GlassTextField family |
Input |
SeaGlassSearchBar |
GlassSearchBar |
Input |
SeaGlassPicker · SeaGlassDatePicker · SeaGlassColorPicker · SeaGlassToggleGroup |
selection controls | Input |
SeaGlassProgressIndicator · SeaLoadingWidget · SeaEmptyWidget · SeaErrorWidget |
status views | Feedback |
SeaGlassDialog · SeaGlassAlert |
GlassDialog |
Overlay |
SeaGlassSheet · SeaGlassModalSheet · SeaGlassActionSheet · SeaGlassShareSheet |
GlassSheet family |
Overlay |
SeaGlassSheetScaffold · SeaGlassSheetAction · SeaGlassSheetHeader |
the frame inside a bottom sheet | Overlay |
SeaGlassSelectionSheet · SeaSelectionItem · SeaSelectionMark |
single / multi select | Overlay |
SeaGlassSheetActionTile · SeaGlassSheetChoiceTile |
rows for the above | Overlay |
SeaGlassMenu · SeaGlassPopover · SeaGlassContextMenu · SeaGlassPullDownButton |
GlassMenu / GlassPopover |
Overlay |
SeaGlassTooltip · SeaGlassInlineTooltip · SeaGlassNotification · SeaGlassPermissionPrompt |
one-line surfaces | Overlay |
SeaGlassToast |
GlassContainer, drawn by Sea.toast |
Overlay |
SeaImageWidget · SeaAppIcon |
cached_network_image |
Display |
SeaGlassAvatar · SeaGlassAvatarGroup · SeaGlassRating |
identity + review display | Display |
SeaGlassExpansionTile · SeaGlassAccordion · SeaAccordionItem |
disclosure | Display |
SeaGlassCarousel · SeaGlassCountdownTimer · SeaGlassProgressIndicator |
display | Display |
SeaGlassCodeBlock · SeaGlassReadout · SeaGlassTintedIcon · SeaGlassBadge |
read-only display | Display |
SeaQrCodeCard |
frames any QR widget, white and quiet-zoned | Display |
SeaRefreshWidget · SeaGetRefreshWidget · SeaLoadResult |
EasyRefresh |
Refresh |
SeaListController · SeaListPager · SeaListHost · SeaListPaging |
pagination behaviour | Controller |
SeaAdsWidget · SeaAdsProvider |
google_mobile_ads |
Ads |
SeaAdsPolicy · SeaAdsRemote · SeaAppOpenPolicy · SeaBannerPolicy · SeaInterstitialPolicy |
ad frequency, merged from remote config | Ads |
SeaRouteAdsObserver |
one interstitial opportunity per page push | Ads |
SeaRemoteConfig · SeaRemoteConfigService (Sea.remote) |
the hosted JSON: ads, messages, update, maintenance, rating, features | Remote |
SeaMessageCenter · SeaMessage · SeaMessageButton |
announcements | Remote |
SeaRatingPrompt · SeaRating |
launch-time rating prompt / in_app_review |
Remote |
SeaLocaleService · SeaTranslations |
on-demand locale JSON, 300+ locales | i18n |
SeaSupabase · SeaAuthPage · Sea.dialog.loginDialog() |
supabase_flutter |
Auth & Database |
SeaWebView · SeaWebViewColors |
webview_flutter |
WebView |
SeaAnalytics |
firebase_analytics |
Analytics |
SeaLog · SeaLogEntry · SeaLogPrinter |
logger |
Services |
SeaDevice |
device_info_plus |
Services |
SeaStorage |
shared_preferences |
Services |
SeaHttp · SeaApiSuccess · SeaApiFailure · SeaHttpErrorInfo |
dio |
Services |
SeaConnectivity |
connectivity_plus |
Services |
SeaPermission |
permission_handler |
Services |
SeaHaptics (via Sea.haptics) · SeaHapticCallback |
HapticFeedback, gated by one switch |
Services |
SeaClipboard (via Sea.clipboard) · SeaUrlLauncher (via Sea.url) · SeaKeyboard |
platform channels | Services |
SeaFormat · SeaValidators · SeaInputFormatters |
helpers behind Sea.format / .validators / .inputFormatters |
Utils |
SeaDebounce · SeaThrottle · SeaDelay |
timing helpers | Utils |
SeaPageMixin · SeaStatusMixin · SeaGetPageMixin · SeaGetStatusMixin |
mixins | Mixin |
Dependencies #
fast_sea re-exports get, easy_refresh, dio and the glass primitives, so an
app depends on this package and not on them.
| Package | Version | Purpose |
|---|---|---|
liquid_glass_widgets |
^1.14.2 | Glass morphism widgets (re-exported) |
get |
^4.7.3 | State management & navigation (re-exported) |
easy_refresh |
^3.4.0 | Pull refresh / load more (re-exported) |
dio |
^5.8.0 | HTTP client (re-exported) |
flutter_easyloading |
>=4.0.2 <5 | Glass HUD / toast host |
google_mobile_ads |
>=6.0.0 <10.0.0 | Ads — any 6.x–9.x works |
app_tracking_transparency |
>=2.0.6 <3 | iOS ATT prompt |
flutter_fgbg |
>=0.7.1 <0.9.0 | Foreground/background events (app-open ads) |
firebase_core · firebase_analytics |
>=3.13 <5 · >=11.6 <13 | Analytics |
supabase_flutter |
>=2.18 <3 | Supabase (needs publishableKey:) |
shared_preferences |
^2.5.3 | Local storage |
device_info_plus |
>=13.2 <14 | Device information |
package_info_plus |
^10.2.1 | App version |
connectivity_plus |
>=6.0 <7 | Network connectivity |
permission_handler |
>=11.3 <12 | Runtime permissions |
in_app_review |
^2.0.10 | In-app rating |
webview_flutter |
>=4.8 <5 | In-app browser |
url_launcher |
>=6.1 <7 | External links (about, store, mail, tel) |
file_picker · image_picker · file_saver |
>=12 <14 · ^1.2.3 · ^0.4.0 | Picking / camera / save panel |
media_store_plus |
^0.1.3 | saveToDownloads on Android |
path_provider · path · mime · uuid · cross_file |
— | File plumbing |
share_plus |
>=13 <14 | System share sheet |
open_filex |
^4.7.0 | Open a file with the OS handler |
cached_network_image |
>=3.3.1 <4 | SeaImageWidget |
logger · font_awesome_flutter · cupertino_icons |
— | Logging & icons |
Requirements #
- Flutter >= 3.41.0 / Dart ^3.11.0 — the same floor
liquid_glass_widgetsandfile_saveralready impose, so this is not an extra constraint - iOS 15+ / Android API 24+ — Flutter's own defaults on the SDK above; a plugin in your app may ask for higher
- Ads: add the AdMob app id to
AndroidManifest.xml/Info.plist saveToDownloads: no storage permission on Android 10+ (MediaStore); on Android 9 and below the plugin's own folder permission applies