feat: official Aira AI Flutter mobile application with sovereign branding, APK launcher icons and permissions

This commit is contained in:
adameehanairagroup committed 2026-11-01 16:41:05 +05:30
commit abbee4b846
28 files changed
+820

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
class AppConfig {
static const String appName = "Aira AI";
static const String appVersion = "3.6.0";
static const String founder = "Er. Adam Eehan";
static const String organization = "Aira Group of Technology";
// Production Web App URL
static const String webUrl = "https://airaai-gamma.vercel.app";
// Custom User Agent to ensure full Google OAuth & WebRTC compatibility
static const String customUserAgent =
"Mozilla/5.0 (Linux; Android 14; Mobile) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.36 AiraApp/3.6";
}
+42
View File
@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'config/app_config.dart';
import 'screens/splash_screen.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
// Set preferred orientations
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
runApp(const AiraAIApp());
}
class AiraAIApp extends StatelessWidget {
const AiraAIApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: AppConfig.appName,
debugShowCheckedModeBanner: false,
themeMode: ThemeMode.dark,
darkTheme: ThemeData(
brightness: Brightness.dark,
scaffoldBackgroundColor: const Color(0xFF09090B),
colorScheme: const ColorScheme.dark(
primary: Color(0xFF3B82F6),
secondary: Color(0xFF2563EB),
surface: Color(0xFF18181B),
background: Color(0xFF09090B),
),
fontFamily: 'Roboto',
useMaterial3: true,
),
home: const SplashScreen(),
);
}
}
+173
View File
@@ -0,0 +1,173 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:permission_handler/permission_handler.dart';
import '../config/app_config.dart';
import 'webview_screen.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({super.key});
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _scaleAnimation;
late Animation<double> _fadeAnimation;
@override
void initState() {
super.initState();
// Set immersive status bar
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Color(0xFF09090B),
systemNavigationBarIconBrightness: Brightness.light,
),
);
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 1400),
);
_scaleAnimation = Tween<double>(begin: 0.85, end: 1.0).animate(
CurvedAnimation(parent: _controller, curve: Curves.easeOutCubic),
);
_fadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(parent: _controller, curve: Curves.easeIn),
);
_controller.forward();
_initializeApp();
}
Future<void> _initializeApp() async {
// Request microphone & camera permissions in advance for voice & multimodal chat
try {
await [
Permission.microphone,
Permission.camera,
].request();
} catch (_) {}
// Wait for animation to finish
await Future.delayed(const Duration(milliseconds: 1800));
if (!mounted) return;
Navigator.of(context).pushReplacement(
PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) =>
const WebViewScreen(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(opacity: animation, child: child);
},
transitionDuration: const Duration(milliseconds: 400),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFF09090B), // Dark sovereign black
body: Center(
child: FadeTransition(
opacity: _fadeAnimation,
child: ScaleTransition(
scale: _scaleAnimation,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Logo Container with soft ambient glow
Container(
width: 110,
height: 110,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: const Color(0xFF2563EB).withOpacity(0.35),
blurRadius: 36,
spreadRadius: 4,
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(28),
child: Image.asset(
'assets/icons/app_icon.png',
fit: BoxFit.cover,
),
),
),
const SizedBox(height: 28),
// App Title
const Text(
AppConfig.appName,
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
letterSpacing: 1.2,
color: Colors.white,
),
),
const SizedBox(height: 6),
// Subtitle
Text(
"SOVEREIGN INTELLIGENCE • ENGINE V3.6",
style: TextStyle(
fontSize: 11,
letterSpacing: 2.0,
fontWeight: FontWeight.w600,
color: Colors.blueAccent.shade100.withOpacity(0.9),
),
),
const SizedBox(height: 48),
// Loader
const SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Color(0xFF3B82F6)),
),
),
const SizedBox(height: 40),
// Founder & Org Footer
Text(
"${AppConfig.organization}\nArchitect: ${AppConfig.founder}",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11,
color: Colors.white.withOpacity(0.4),
height: 1.4,
),
),
],
),
),
),
),
);
}
}
+240
View File
@@ -0,0 +1,240 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter_android/webview_flutter_android.dart';
import 'package:url_launcher/url_launcher.dart';
import '../config/app_config.dart';
class WebViewScreen extends StatefulWidget {
const WebViewScreen({super.key});
@override
State<WebViewScreen> createState() => _WebViewScreenState();
}
class _WebViewScreenState extends State<WebViewScreen> {
late final WebViewController _controller;
bool _isLoading = true;
int _progress = 0;
bool _hasError = false;
String _errorMessage = "";
@override
void initState() {
super.initState();
_initWebViewController();
}
void _initWebViewController() {
late final PlatformWebViewControllerCreationParams params;
if (WebViewPlatform.instance is AndroidWebViewPlatform) {
params = AndroidWebViewControllerCreationParams();
} else {
params = const PlatformWebViewControllerCreationParams();
}
final WebViewController controller =
WebViewController.fromPlatformCreationParams(params);
controller
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0xFF09090B))
..setUserAgent(AppConfig.customUserAgent)
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
if (mounted) {
setState(() {
_progress = progress;
if (progress >= 100) {
_isLoading = false;
}
});
}
},
onPageStarted: (String url) {
if (mounted) {
setState(() {
_isLoading = true;
_hasError = false;
});
}
},
onPageFinished: (String url) {
if (mounted) {
setState(() {
_isLoading = false;
});
}
},
onWebResourceError: (WebResourceError error) {
// Filter out minor subresource errors
if (error.isForMainFrame ?? true) {
if (mounted) {
setState(() {
_hasError = true;
_errorMessage = error.description;
_isLoading = false;
});
}
}
},
onNavigationRequest: (NavigationRequest request) async {
final uri = Uri.parse(request.url);
// Allow all Vercel and Aira domain navigations
if (request.url.contains("vercel.app") ||
request.url.contains("airagroup.in") ||
request.url.contains("accounts.google.com") ||
request.url.contains("googleapis.com")) {
return NavigationDecision.navigate;
}
// Launch external URLs in default device browser
if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
),
);
// Android-specific hardware and permission enhancements
if (controller.platform is AndroidWebViewController) {
final androidController = controller.platform as AndroidWebViewController;
// Auto-grant Camera and Microphone permissions for Voice chat & Image attachments
androidController.setOnPlatformPermissionRequest(
(PlatformWebViewPermissionRequest request) {
request.grant();
},
);
androidController.setMediaPlaybackRequiresUserGesture(false);
}
controller.loadRequest(Uri.parse(AppConfig.webUrl));
_controller = controller;
}
void _reload() {
setState(() {
_isLoading = true;
_hasError = false;
});
_controller.reload();
}
@override
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvokedWithResult: (bool didPop, dynamic result) async {
if (didPop) return;
// Handle Android back button
if (await _controller.canGoBack()) {
await _controller.goBack();
} else {
// If on root page, minimize or prompt exit
SystemNavigator.pop();
}
},
child: Scaffold(
backgroundColor: const Color(0xFF09090B),
body: SafeArea(
bottom: false,
child: Stack(
children: [
// Core WebView
if (!_hasError)
WebViewWidget(controller: _controller),
// Top Loading Progress Bar
if (_isLoading)
Positioned(
top: 0,
left: 0,
right: 0,
child: LinearProgressIndicator(
value: _progress / 100.0,
minHeight: 2.5,
backgroundColor: Colors.transparent,
valueColor: const AlwaysStoppedAnimation<Color>(
Color(0xFF3B82F6),
),
),
),
// Offline / Network Error Screen
if (_hasError)
Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 64,
height: 64,
decoration: BoxDecoration(
color: Colors.redAccent.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.wifi_off_rounded,
size: 32,
color: Colors.redAccent,
),
),
const SizedBox(height: 20),
const Text(
"Connection Issue",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
const SizedBox(height: 8),
Text(
_errorMessage.isNotEmpty
? _errorMessage
: "Unable to reach Aira AI servers. Please check your internet connection.",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13,
color: Colors.white.withOpacity(0.6),
),
),
const SizedBox(height: 24),
ElevatedButton.icon(
onPressed: _reload,
icon: const Icon(Icons.refresh_rounded, size: 18),
label: const Text("Retry Connection"),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2563EB),
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
],
),
),
),
],
),
),
),
);
}
}