#!/usr/bin/env bash

# Get the absolute path to the real script location, resolving symlinks
# If SCRIPT_DIR is already set (from parent script), use that instead
if [ -z "$SCRIPT_DIR" ]; then
  SOURCE="${BASH_SOURCE[0]}"
  while [ -h "$SOURCE" ]; do
    DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
    SOURCE="$(readlink "$SOURCE")"
    [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
  done
  SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")/../.." && pwd)"
fi

source "$SCRIPT_DIR/utils/constant/gum_options_strings.sh"

# App setup tools
PKG_App_Icon=(
  "flutter_launcher_icons"
)

PKG_App_SplashScreen=(
  "flutter_native_splash"
)

PKG_App_Onboarding=(
  "introduction_screen"
)

# UI - Animations & Effects
PKG_UI_Animations=(
  "lottie"
  "animate_do"
  "flutter_animate"
  "animated_text_kit"
  "animations"
)

PKG_UI_Indicators=(
  "flutter_slidable"
  "infinite_scroll_pagination"
  "smooth_page_indicator"
  "liquid_pull_to_refresh"
  "action_slider"
  "scroll_to_hide"
)

PKG_UI_BottomNavigation=(
  "google_nav_bar"
  "animated_bottom_navigation_bar"
  "persistent_bottom_nav_bar"
  "persistent_bottom_nav_bar_v2"
  "floating_bottom_navigation_bar"
)

PKG_UI_Utilities=(
  "flutter_spinkit"
  "shimmer"
  "shimmer_animation"
  "skeletonizer"
  "vibration"
  "haptic_feedback"
  "image_picker"
  "audioplayers"
  "video_player"
  "toastification"
  "delightful_toast"
  "cherry_toast"
  "showcaseview"
  "tutorial_coach_mark"
  "restart_app"
)

# App Responsiveness
PKG_UI_Responsive=(
  "flutter_screenutil"
  "responsive_framework"
  "auto_size_text"
)

# App Navigation
PKG_Navigation=(
  "go_router"
)

# State Management
PKG_StateManagement=(
  "bloc"
  "flutter_bloc"
  "hydrated_bloc"
  "provider"
  "equatable"
  "riverpod"
  "flutter_riverpod"
)

# Networking & API
PKG_Networking=(
  "http"
  "dio"
  "pretty_dio_logger"
  "retrofit"
  "cached_network_image"
  "connectivity_plus"
  "internet_connection_checker"
  "internet_connection_checker_plus"
)

# Code Generation & Builders
PKG_CodeGen=(
  "build_runner"
  "json_serializable"
  "json_annotation"
  "freezed"
  "freezed_annotation"
  "retrofit_generator"
  "hive_generator"
)

# Dependency Injection
PKG_Dependency_Injection=(
  "get_it"
)

# Storage / Local DB
PKG_Storage_Local=(
  "shared_preferences"
  "hive"
  "hive_flutter"
  "sqflite"
)

# GraphQL Clients
PKG_Storage_GraphQL=(
  "graphql_flutter"
)

# Cloud Services (Firebase/Supabase)
PKG_Cloud=(
  "firebase_core"
  "firebase_auth"
  "cloud_firestore"
  "firebase_analytics"
  "firebase_crashlytics"
  "firebase_messaging"
  "supabase"
  "supabase_flutter"
)

# Authentication (OAuth/Social)
PKG_Auth_Social=(
  "google_sign_in"
  "sign_in_with_apple"
  "googleapis_auth"
  "flutter_facebook_auth"
)

# Biometric Authentication
PKG_Auth_Biometric=(
  "local_auth"
  "flutter_screen_lock"
  "biometric_signature"
  "passkeys"
)

# Localization and i18n
PKG_Localization=(
  "easy_localization"
  "intl"
  "flutter_localization"
)

# Notifications
PKG_Notifications=(
  "flutter_local_notifications"
  "awesome_notifications"
  "flutter_local_notifications_platform_interface"
)

# System & Utilities
PKG_System_Utilities=(
  "flutter_svg"
  "url_launcher"
  "path_provider"
  "share_plus"
  "package_info_plus"
  "device_info_plus"
)
