Skip to main content

fast_sea 0.4.0 copy "fast_sea: ^0.4.0" to clipboard
fast_sea: ^0.4.0 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, ads, Supabase auth, Firebase analytics, and more.

Features #

  • ๐Ÿš€ One Widget Setup โ€” SeaApp widget configures everything: ads, Firebase, Supabase, glass theme, background, loading
  • ๐Ÿซง Glass Widgets โ€” Full wrapping of liquid_glass_widgets 1.3.0 with Sea-prefixed API
  • ๐ŸŽจ Theme System โ€” SeaColors, SeaTextStyles, SeaGlassTheme with light/dark support
  • ๐Ÿž Toast & Loading โ€” Sea.showSuccess(), Sea.showLoading(), Sea.loadingTask() โ€” iOS 27 glass style
  • โšก Loading Task โ€” Sea.loadingTask<T>() wraps async operations with auto loading/dismiss
  • ๐Ÿ”„ Refresh โ€” SeaRefreshWidget with pull-down refresh & pull-up load more
  • ๐Ÿ“„ Page Mixin โ€” SeaPageMixin<T, F> for paginated data loading
  • ๐Ÿ“„ Status Mixin โ€” SeaStatusMixin<T> for loading/error/empty three-state pages
  • ๐Ÿ“ข Ads โ€” SeaAdsWidget with Banner, Interstitial, Rewarded, AppOpen ad support
  • ๐Ÿ” Supabase Auth โ€” SeaSupabase with login, signup, OAuth, password reset, iOS 27-style auth UI
  • ๐Ÿ“Š Firebase Analytics โ€” SeaAnalytics with 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 โ€” SeaAuthPage with glass morphism login/signup/forgot password flows, dialog mode via SeaAuthPage.showDialog()
  • ๐ŸŒ WebView โ€” SeaWebView with iOS-style browser chrome, progress bar, navigation controls
  • ๐Ÿ“‹ About Page โ€” SeaGlassAboutPage with app icon, privacy policy, user agreement links (opens in WebView)
  • โš™๏ธ App Info Config โ€” SeaAppInfoConfig for app name, icon path, privacy/agreement URLs, default email
  • ๐ŸŒ i18n โ€” SeaLocaleService with GetX translations, per-locale on-demand JSON loading, 300+ locales (all world languages), built-in + app-level merge
  • ๐Ÿ“ Files & Cache โ€” Sea.file unified file directory: pick file/image/video/audio, camera capture, save, share, open, cache size & clearing
  • ๐Ÿ–ผ Image โ€” SeaImageWidget with 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.4.0

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,
    ),
    // 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'),
      extraAssetBasePath: 'assets/locale',
    ),
  ));
}

No SeaInit.init(), no SeaAppBuilder, no manual controller registration. SeaApp does it all.

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.showSuccess('Done!');
Sea.showError('Failed');
Sea.showInfo('Tip');
Sea.showToast('Hello');
Sea.showLoading();
Sea.dismiss();

// Loading Task
final data = await Sea.loadingTask(
  task: () => api.fetchItems(),
  error: (e) => Sea.showError('$e'),
);

// 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.removeAds;
Sea.isReady;

// App Info
Sea.appInfo.appName;           // 'My App'
Sea.appInfo.appIconPath;       // 'assets/icon/app_icon.png'
Sea.appInfo.privacyPolicyUrl;  // 'https://...'
Sea.appInfo.userAgreementUrl;  // 'https://...'
Sea.appInfo.defaultEmail;      // 'qifendev@gmail.com'
Sea.appTitle;                  // App title from SeaApp

// 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.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;                                  // 300+ supported locales
SeaLocales.localeDisplayName(Locale('ja', 'JP'));             // 'ๆ—ฅๆœฌ่ชž'

Or manually:

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return SeaApp(
      title: 'My App',
      home: const HomePage(),
    );
  }
}

๐ŸŒ 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+ locales supported via SeaLocales.supportedLocales โ€” covers all world languages
  • 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. under assets/locale/ and declare extraAssetBasePath
  • Parameterized strings โ€” @key placeholders in translations
  • Fallback locale โ€” falls back to fallbackLocale if 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 own 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, imported by the app
โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”œโ”€โ”€ videos/
โ”‚   โ”œโ”€โ”€ audio/
โ”‚   โ”œโ”€โ”€ documents/
โ”‚   โ””โ”€โ”€ others/
โ””โ”€โ”€ cache/                 # disposable (or the OS temp dir, configurable)

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
    useTemporaryForCache: false,  // default: false
  ),
)

Or initialise manually when you are not using SeaApp:

await SeaFile.init(config: const SeaFileConfig());

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);
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
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)

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:io paths and throws UnsupportedError on web.
  • Remember to request the relevant permissions (Sea.permission.photos(), .camera()) before picking on iOS/Android.
  • Set copyPickedFiles: false to keep platform paths (not recommended: they can expire).
  • 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.
  • ratio is height / width โ€” the same convention as the original FastImageWidget. Pass ratio: 1 for a square.
  • Migration from fast_code: rename FastImageWidget โ†’ SeaImageWidget; everything else matches.

SeaApp โ€” All-in-One Widget #

SeaApp replaces SeaInit.init() + SeaAppBuilder. 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
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

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

const SeaFirebaseConfig(
  enabled: true,
  analytics: true,
  onReady: null,
)

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,
  glassThemeData: null,
)

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.showSuccess('Saved!');
Sea.showError('Failed');
Sea.showInfo('Tip');
Sea.showToast('Hello');
Sea.showLoading();
Sea.showLoading('Fetching...');
Sea.showProgress(0.5, 'Downloading...');
Sea.dismiss();
Sea.isShow; // bool

Loading Task #

// Simple
final result = await Sea.loadingTask<int>(
  task: () => api.fetchCount(),
);

// With error handling
final data = await Sea.loadingTask<List<Item>>(
  task: () => api.fetchItems(),
  error: (e) => Sea.showError('Failed: $e'),
);

// Without loading indicator
final data = await Sea.loadingTask(
  task: () => api.fetchData(),
  loading: false,
);
Parameter Type Default Description
task FutureOr<T> Function()? null The async operation
loading bool true Show loading indicator
error void Function(dynamic)? null Error callback

Config #

Sea.config.removeAds;
Sea.config.googleBannerKey;
Sea.config.adsProvider;
Sea.config.effectiveGlassThemeData;
Sea.config.effectiveLightGradient;
Sea.config.effectiveDarkGradient;
Sea.isReady; // bool

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)

Glass Widgets #

SeaGlassScaffold #

Main page scaffold with glass background:

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

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

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(),
)
Parameter Type Default Description
leading Widget? null Leading widget
title Widget required Title
subtitle Widget? null Subtitle
trailing Widget? null Trailing widget
onTap VoidCallback? null Tap handler
onLongPress VoidCallback? null Long press handler

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

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 Center title
largeTitleController GlassLargeTitleController? null Large title controller

SeaGlassTabBar #

Bottom tab bar navigation:

SeaGlassTabBar(
  tabs: [
    SeaGlassTab(label: 'Home', icon: CupertinoIcons.house),
    SeaGlassTab(label: 'Search', icon: CupertinoIcons.search),
    SeaGlassTab(label: 'Profile', icon: CupertinoIcons.person),
  ],
  selectedIndex: 0,
  onTabSelected: (index) => switchTab(index),
)

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 #

iOS-style action sheet:

showSeaGlassActionSheet(
  context: context,
  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,
)
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

SeaGlassModalSheet #

Modal bottom sheet with drag handle:

showSeaGlassModalSheet(
  context: context,
  builder: (context) => Column(
    mainAxisSize: MainAxisSize.min,
    children: [
      Text('Modal Sheet'),
      Text('This is a glass modal sheet.'),
    ],
  ),
)
Parameter Type Default Description
context BuildContext required Build context
builder WidgetBuilder required Sheet content builder
isDismissible bool true Dismiss by drag/tap outside

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(
  context: context,
  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(
  context: context,
  title: 'Delete Item',
  message: 'This action cannot be undone.',
  isDestructive: true,
  onConfirm: () => deleteItem(),
);

SeaGlassSheet #

Bottom sheet with glass effect:

SeaGlassSheet.show(
  context: context,
  builder: (context) => Column(
    children: [
      SeaGlassSheetHeader(title: 'Options'),
      SeaGlassListTile(title: Text('Option 1'), onTap: () {}),
      SeaGlassListTile(title: Text('Option 2'), onTap: () {}),
    ],
  ),
);
Parameter Type Default Description
context BuildContext required Build context
builder WidgetBuilder required Sheet content builder
isDismissible bool true Dismiss by drag/tap outside
maxHeightFactor double 0.6 Max height as fraction of screen
resizeToAvoidBottomInset bool false Avoid keyboard

Toast & Loading #

Sea (Unified API) #

Global toast and loading indicators with iOS 27 glass style:

// Loading
Sea.showLoading();
Sea.showLoading('Loading data...');

// Progress
Sea.showProgress(0.5, 'Downloading...');

// Toast
Sea.showToast('Hello World');
Sea.showSuccess('Saved successfully');
Sea.showError('Something went wrong');
Sea.showInfo('Tip: swipe to delete');

// Dismiss
Sea.dismiss();

// Check if showing
if (Sea.isShow) { ... }

SeaGlassToast #

Glass overlay toast with type indicators:

SeaGlassToast.show(
  context,
  title: 'Success',
  message: 'Data saved successfully',
  type: SeaToastType.success,
  duration: Duration(seconds: 3),
);

// Types: SeaToastType.info, .success, .warning, .danger

Refresh & Pagination #

SeaRefreshWidget #

Pull-down refresh & pull-up load more:

SeaRefreshWidget(
  onRefresh: () async {
    await loadData();
  },
  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
onRefresh SeaCallback? null Pull-down refresh callback
onLoad FutureOr<bool> Function()? null Pull-up load more callback
noMore bool false No more data flag
enablePullDown bool true Enable pull-down
controller EasyRefreshController? null External controller
header Header? ClassicHeader() Custom header
footer Footer? ClassicFooter() Custom footer

SeaPageMixin #

Mixin for paginated data loading:

class MyPage extends StatefulWidget {
  @override
  State<MyPage> createState() => _MyPageState();
}

class _MyPageState extends State<MyPage> with SeaPageMixin<Item, MyPage> {
  @override
  int initializePage = 1; // Start from page 1

  @override
  int pageCount = 20; // Items per page

  @override
  Future<List<Item>> loadData(int page) async {
    final response = await api.getItems(page: page, size: pageCount);
    return response.items;
  }

  @override
  Widget build(BuildContext context) {
    if (loading && data.isEmpty) {
      return Center(child: SeaGlassProgressIndicator.circular());
    }
    if (error && data.isEmpty) {
      return Center(child: Text('Error loading data'));
    }
    return SeaRefreshWidget(
      onRefresh: refresh,
      onLoad: loadMore,
      noMore: noMore,
      child: ListView.builder(
        itemCount: data.length,
        itemBuilder: (context, index) => ItemWidget(data[index]),
      ),
    );
  }
}
Property Type Default Description
data List<T> [] Loaded data list
page int 0 Current page
loading bool false Loading state
noMore bool false No more data
error bool false Error state
initializePage int 0 Starting page number
pageCount int 20 Items per page
autoNoMore bool true Auto-detect no more
Method Returns Description
loadData(page) Future<List<T>> Abstract: fetch data for page
refresh() Future<bool> Refresh from first page
loadMore() Future<bool> Load next page
dataAdded(isRefresh) void Override: after data added
onError(e) void Override: handle errors
isNormal bool !error && !loading && data.isNotEmpty
isEmpty bool data.isEmpty

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<void> Reload data
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.appInfo.defaultEmail Pre-filled email

SeaAuthPage.showDialog() โ€” Dialog Mode #

Show authentication as an iOS-style popup dialog instead of a full page:

// Login dialog
SeaAuthPage.showDialog(context);

// Sign up dialog
SeaAuthPage.showDialog(
  context,
  initialMode: SeaAuthMode.signUp,
  onLoginSuccess: () => navigateHome(),
);

// Forgot password dialog
SeaAuthPage.showDialog(
  context,
  initialMode: SeaAuthMode.forgotPassword,
);
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.appInfo.defaultEmail Pre-filled email

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.appInfo.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
  • Displays device model, OS version
  • Privacy Policy link โ†’ opens in SeaWebView
  • User Agreement link โ†’ opens in SeaWebView

SeaWebView #

iOS-style WebView browser component with full navigation controls:

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/rating:

await Sea.rating.requestReview();

Ads #

SeaAdsWidget #

Google Mobile Ads integration (Banner, Interstitial, Rewarded, AppOpen):

// Define provider
final provider = (
  removeAds: isPremium,
  googleBannerKey: 'ca-app-pub-xxx/yyy',
  googleAppOpenKey: 'ca-app-pub-xxx/yyy',
  googleRewardKey: 'ca-app-pub-xxx/yyy',
  googlePageKey: 'ca-app-pub-xxx/yyy',
  refresh: () => setState(() {}),
);

// Initialize (in main or initState)
await SeaAdsWidget.init(provider);

// Banner ad widget
SeaAdsWidget(provider: provider)

// Rewarded ad
SeaAdsWidget.loadRewardAd(
  context,
  provider,
  onReward: () => grantReward(),
);

// Interstitial ad
SeaAdsWidget.loadPageAd(
  context,
  provider,
  onClosed: () => navigateNext(),
);

// App Open ad
SeaAdsWidget.loadAppOpenAd(
  provider,
  onClose: () => continueApp(),
);

SeaAdsProvider #

Record type for ad configuration:

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
});

Full API Reference #

Component Wraps Category
SeaApp โ€” Core
Sea theme, log, device, storage, http, connectivity, permission, rating, analytics, supabase, appInfo, appTitle, showSuccess(), loadingTask() Core
SeaConfig current Core
SeaAppInfoConfig appName, appIconPath, privacyPolicyUrl, userAgreementUrl, defaultEmail Core
SeaThemeController to, toggle(), setLight(), setDark(), setSystem() Core
SeaColors โ€” Theme
SeaColorScheme โ€” Theme
SeaTextStyles โ€” Theme
SeaGlassStyle LiquidGlassSettings Theme
SeaGlassTheme GlassThemeData Theme
SeaGlassBackground โ€” Layout
SeaGlowBlob โ€” Layout
SeaGlassScaffold GlassScaffold Layout
SeaGlassNavigationBar GlassAppBar Navigation
SeaGlassNavBarLargeTitle GlassLargeTitle Navigation
SeaGlassTabBar GlassTabBar Navigation
SeaGlassNavigationShell GlassNavigationShell Navigation
SeaGlassCard GlassCard Container
SeaGlassSection GlassGroupedSection Container
SeaGlassListTile GlassListTile Container
SeaGlassDivider GlassDivider Container
SeaGlassContainer GlassContainer Container
SeaGlassPage GlassPage Container
SeaLiquidGlassScope LiquidGlassScope Container
SeaGlassProgressiveBlur GlassProgressiveBlur Container
SeaGlassButton GlassButton Interactive
SeaGlassIconButton GlassIconButton Interactive
SeaGlassButtonGroup GlassButtonGroup Interactive
SeaGlassSegmentedControl GlassSegmentedControl Interactive
SeaGlassSwitch GlassSwitch Interactive
SeaGlassSlider GlassSlider Interactive
SeaGlassBadge GlassBadge Interactive
SeaGlassChip GlassChip Interactive
SeaGlassStepper GlassStepper Interactive
SeaGlassToolbar GlassToolbar Interactive
SeaGlassPageControl GlassPageControl Interactive
SeaGlassMaterialize GlassMaterialize Interactive
SeaGlassTextField GlassTextField Input
SeaGlassSearchBar GlassSearchBar Input
SeaGlassPicker GlassPicker Input
SeaGlassPasswordField GlassPasswordField Input
SeaGlassFormField GlassFormField Input
SeaGlassTextArea GlassTextArea Input
SeaGlassProgressIndicator GlassProgressIndicator Feedback
SeaGlassDialog GlassDialog Overlay
SeaGlassSheet GlassSheet Overlay
SeaGlassActionSheet GlassActionSheet Overlay
SeaGlassModalSheet GlassModalSheet Overlay
SeaGlassMenu GlassMenu Overlay
SeaGlassPopover GlassPopover Overlay
SeaGlassPullDownButton GlassPullDownButton Overlay
SeaGlassSheetHeader โ€” Overlay
SeaGlassToast GlassContainer Overlay
SeaHUD EasyLoading (legacy, use Sea) Feedback
SeaRefreshWidget EasyRefresh Refresh
SeaAdsWidget google_mobile_ads Ads
SeaSupabase supabase_flutter Auth & Database
SeaAuthPage โ€” Auth UI
SeaGlassAboutPage โ€” About Page
SeaWebView webview_flutter WebView
SeaAnalytics firebase_analytics Analytics
SeaLog โ€” Services
SeaDevice device_info_plus Services
SeaStorage shared_preferences Services
SeaHttp dio Services
SeaConnectivity connectivity_plus Services
SeaPermission permission_handler Services
SeaRating in_app_review Services
SeaPageMixin โ€” Mixin
SeaStatusMixin โ€” Mixin

Dependencies #

Package Version Purpose
liquid_glass_widgets ^1.3.0 Glass morphism widgets
get ^4.7.3 State management & navigation
easy_refresh ^3.4.0 Pull refresh / load more
flutter_easyloading ^4.0.2 Toast & loading indicators
google_mobile_ads ^9.1.0 Google ads SDK
app_tracking_transparency ^2.0.6 iOS ATT permission
flutter_fgbg ^0.8.0 Foreground/background events
supabase_flutter ^2.8.0 Supabase auth & database
firebase_core ^3.13.0 Firebase core
firebase_analytics ^11.6.0 Firebase analytics
dio ^5.8.0 HTTP client
shared_preferences ^2.5.3 Local storage
device_info_plus ^11.4.0 Device information
connectivity_plus ^6.1.4 Network connectivity
permission_handler ^11.3.1 Runtime permissions
in_app_review ^2.0.9 In-app rating
package_info_plus ^8.3.0 Package info
webview_flutter ^4.10.0 In-app browser WebView

Requirements #

  • Flutter >= 3.10.0
  • Dart >= 3.7.2
  • iOS 12+ / Android API 21+