From ed22b5fd6c4eab4bcdaa67825ffba8f20203b5bb Mon Sep 17 00:00:00 2001 From: Deep Koluguri Date: Wed, 5 Nov 2025 10:58:24 -0500 Subject: [PATCH] fixed app theme issues --- fix-and-deploy.sh | 36 ++++++++++++++++++++++++ luckychit/lib/core/themes/app_theme.dart | 8 +++--- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 fix-and-deploy.sh diff --git a/fix-and-deploy.sh b/fix-and-deploy.sh new file mode 100644 index 0000000..28d5a9e --- /dev/null +++ b/fix-and-deploy.sh @@ -0,0 +1,36 @@ +#!/bin/bash +############################################################################### +# Fix Theme Issues and Deploy Frontend +############################################################################### + +SERVER_IP="192.168.8.148" +cd /home/luckychit/apps/chitfund/luckychit + +echo "🔧 Fixing theme issues..." +# Fix CardTheme to CardThemeData +sed -i 's/cardTheme: CardTheme(/cardTheme: CardThemeData(/g' lib/core/themes/app_theme.dart + +# Fix DialogTheme to DialogThemeData +sed -i 's/dialogTheme: DialogTheme(/dialogTheme: DialogThemeData(/g' lib/core/themes/app_theme.dart + +echo "✅ Theme fixes applied" + +echo "🔧 Updating API URL..." +sed -i "s|http://localhost:3000/api|http://${SERVER_IP}:3000/api|g" lib/core/services/api_service.dart + +echo "📦 Getting dependencies..." +flutter pub get + +echo "🏗️ Building web app..." +flutter build web --release + +echo "🚀 Deploying..." +mkdir -p /var/www/luckychit +cp -r build/web/* /var/www/luckychit/ +chown -R www-data:www-data /var/www/luckychit + +echo "🔄 Restoring original files..." +git checkout lib/core/services/api_service.dart 2>/dev/null || sed -i "s|http://${SERVER_IP}:3000/api|http://localhost:3000/api|g" lib/core/services/api_service.dart + +echo "✅ Done! Visit: http://${SERVER_IP}" + diff --git a/luckychit/lib/core/themes/app_theme.dart b/luckychit/lib/core/themes/app_theme.dart index 4ca6282..b27de99 100644 --- a/luckychit/lib/core/themes/app_theme.dart +++ b/luckychit/lib/core/themes/app_theme.dart @@ -60,7 +60,7 @@ class AppTheme { ), // Card Theme - cardTheme: CardTheme( + cardTheme: CardThemeData( elevation: 2, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.r), @@ -183,7 +183,7 @@ class AppTheme { ), // Dialog Theme - dialogTheme: DialogTheme( + dialogTheme: DialogThemeData( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.r), ), @@ -241,7 +241,7 @@ class AppTheme { ), // Card Theme - cardTheme: CardTheme( + cardTheme: CardThemeData( elevation: 4, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.r), @@ -364,7 +364,7 @@ class AppTheme { ), // Dialog Theme - dialogTheme: DialogTheme( + dialogTheme: DialogThemeData( backgroundColor: darkSurface, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.r),