اريد تحسين ال appbar من حيث التدرج والايقونات // main.dart import 'dart:async'; import…
- User
اريد تحسين ال appbar من حيث التدرج والايقونات // main.dart import 'dart:async'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:telephony/telephony.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_contacts/flutter_contacts.dart'; import 'package:url_launcher/url_launcher.dart';
// مكتبة الاتصال التلقائي import 'package:flutter_phone_direct_caller/flutter_phone_direct_caller.dart';
// استيراد شاشة الترحيب المنفصلة import 'welcome_screen.dart';
void main() => runApp(const SMSApp());
void onBackgroundMessage(SmsMessage message) { debugPrint("رسالة واردة في الخلفية: ${message.body}"); }
/// ألوان التطبيق المحدثة إلى أزرق جذاب final ColorScheme lightColorScheme = ColorScheme( primary: Color(0xFF1976D2), onPrimary: Colors.white, primaryContainer: Color(0xFFBBDEFB), onPrimaryContainer: Color(0xFF0D47A1), secondary: Color(0xFF0288D1), onSecondary: Colors.white, secondaryContainer: Color(0xFFB3E5FC), onSecondaryContainer: Color(0xFF01579B), tertiary: Color(0xFF64B5F6), onTertiary: Colors.white, tertiaryContainer: Color(0xFFBBDEFB), onTertiaryContainer: Color(0xFF0D47A1), error: Color(0xFFB00020), onError: Colors.white, errorContainer: Color(0xFFFFDAD6), onErrorContainer: Color(0xFF410002), background: Colors.white, onBackground: Colors.black87, surface: Colors.white, onSurface: Colors.black87, surfaceVariant: Color(0xFFE3F2FD), onSurfaceVariant: Color(0xFF90CAF9), outline: Color(0xFF90CAF9), shadow: Colors.black54, inverseSurface: Color(0xFF121212), onInverseSurface: Colors.white, inversePrimary: Color(0xFF82B1FF), brightness: Brightness.light, );
class SMSApp extends StatelessWidget { const SMSApp({super.key});
@override Widget build(BuildContext context) { return MaterialApp( title: 'تحويل رصيد متعدد', debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: lightColorScheme, fontFamily: 'Tajawal', useMaterial3: true, appBarTheme: AppBarTheme( backgroundColor: Colors.transparent, foregroundColor: lightColorScheme.onPrimary, elevation: 0, centerTitle: true, titleTextStyle: const TextStyle( fontSize: 18, fontWeight: FontWeight.w600, letterSpacing: 0.5, ), iconTheme: IconThemeData(color: lightColorScheme.onPrimary, size: 26), toolbarHeight: 80, ), cardTheme: CardTheme( color: lightColorScheme.surface, elevation: 1, margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16), ), surfaceTintColor: Colors.transparent, ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( backgroundColor: lightColorScheme.primary, foregroundColor: lightColorScheme.onPrimary, padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), elevation: 0, textStyle: const TextStyle( fontSize: 16, fontWeight: FontWeight.w600, ), ), ), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( foregroundColor: lightColorScheme.primary, side: BorderSide(color: lightColorScheme.primary, width: 1.5), padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 24), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), textStyle: const TextStyle( fontSize: 16, fontWeight: FontWeight.w600, ), ), ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( foregroundColor: lightColorScheme.primary, textStyle: const TextStyle( fontWeight: FontWeight.w700, fontSize: 16, ), ), ), snackBarTheme: SnackBarThemeData( behavior: SnackBarBehavior.floating, backgroundColor: lightColorScheme.inverseSurface, elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), contentTextStyle: TextStyle( color: lightColorScheme.onInverseSurface, fontWeight: FontWeight.w500, fontSize: 14, ), actionTextColor: lightColorScheme.primaryContainer, ), inputDecorationTheme: InputDecorationTheme( filled: true, fillColor: lightColorScheme.surfaceVariant.withOpacity(0.4), contentPadding: const EdgeInsets.symmetric( horizontal: 16, vertical: 14, ), border: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: BorderSide.none, ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: lightColorScheme.primary, width: 2), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: lightColorScheme.error, width: 1.5), ), labelStyle: TextStyle( color: lightColorScheme.onSurfaceVariant, fontWeight: FontWeight.w500, ), hintStyle: TextStyle( color: lightColorScheme.onSurfaceVariant.withOpacity(0.6), ), prefixIconColor: lightColorScheme.primary, ), dialogTheme: DialogTheme( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), elevation: 0, backgroundColor: lightColorScheme.surface, contentTextStyle: TextStyle( color: lightColorScheme.onSurface, fontSize: 15, ), titleTextStyle: TextStyle( fontWeight: FontWeight.bold, fontSize: 18, color: lightColorScheme.onSurface, ), ), listTileTheme: ListTileThemeData( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), contentPadding: const EdgeInsets.symmetric(horizontal: 16), iconColor: lightColorScheme.primary, textColor: lightColorScheme.onSurface, dense: true, ), chipTheme: ChipThemeData( backgroundColor: lightColorScheme.surfaceVariant, selectedColor: lightColorScheme.primary, secondarySelectedColor: lightColorScheme.primary, disabledColor: lightColorScheme.surfaceVariant.withOpacity(0.4), labelStyle: const TextStyle(fontWeight: FontWeight.w500), secondaryLabelStyle: TextStyle(color: lightColorScheme.onPrimary), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), brightness: Brightness.light, side: BorderSide.none, ), dividerTheme: DividerThemeData( color: lightColorScheme.surfaceVariant, thickness: 1, space: 0, ), progressIndicatorTheme: ProgressIndicatorThemeData( color: lightColorScheme.primary, linearTrackColor: lightColorScheme.surfaceVariant, ), bottomSheetTheme: BottomSheetThemeData( backgroundColor: lightColorScheme.surface, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(20)), ), elevation: 0, ), ), home: const SplashScreen(), routes: {'/home': (context) => const SMSHomePage()}, ); } }
- Assistant
- User
لا اريد هذا الشكل اريد شكل عصري جذاب مع الوان ملائمة
- Assistant
- User
اين بديل هذا الكود appBar: AppBar( toolbarHeight: 100, title: Row( mainAxisSize: MainAxisSize.min, children: [ Icon(Icons.balance, size: 28, color: lightColorScheme.onPrimary), SizedBox(width: 12), Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'تحويل رصيد متعدد', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), ), Text( 'الرصيد: ${_formatWithThousandsSeparator(_currentBalance)}', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), ], ), ], ), actions: [ Tooltip( message: 'إدارة المبالغ المحفوظة', child: CircleAvatar( backgroundColor: lightColorScheme.primaryContainer.withOpacity( 0.7, ), child: IconButton( icon: Icon(Icons.attach_money_rounded, color: Colors.white), onPressed: _showAmountsManagementDialog, ), ), ), SizedBox(width: 12), Tooltip( message: 'إدارة الأرقام المحفوظة', child: CircleAvatar( backgroundColor: lightColorScheme.primaryContainer.withOpacity( 0.7, ), child: IconButton( icon: Icon(Icons.contact_page_rounded, color: Colors.white), onPressed: _showSavedNumbersSelection, ), ), ), SizedBox(width: 12), ], flexibleSpace: Container( decoration: BoxDecoration( gradient: LinearGradient( colors: [ lightColorScheme.primary, lightColorScheme.primaryContainer, ], begin: Alignment.topLeft, end: Alignment.bottomRight, ), borderRadius: BorderRadius.vertical(bottom: Radius.circular(20)), ), ), elevation: 6, shadowColor: lightColorScheme.primary.withOpacity(0.4), ),
- Assistant