Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,57 +1,48 @@


import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'screens/splash_screen.dart';
import 'screens/home/home_screen.dart';
import 'screens/chat/chat_screen.dart';
import 'services/navigation_service.dart';
import 'services/supabase_service.dart';
import 'services/ai_service.dart';
import 'theme/theme_controller.dart';
import 'theme/app_themes.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();

try {
await SupabaseService().initialize();

await AIService().initialize();
} catch (e) {
debugPrint('Error initializing services: $e');
}

runApp(const MyApp());

final themeController = await ThemeController.create();

runApp(
ChangeNotifierProvider<ThemeController>.value(
value: themeController,
child: const MyApp(),
),
);
}

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

@override
Widget build(BuildContext context) {
final themeController = context.watch<ThemeController>();
return MaterialApp(
title: 'Ell-ena',
debugShowCheckedModeBanner: false,
navigatorKey: NavigationService().navigatorKey,
navigatorObservers: <NavigatorObserver>[AppRouteObserver.instance],
theme: ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
primaryColor: Colors.green.shade400,
scaffoldBackgroundColor: const Color(0xFF1A1A1A),
colorScheme: ColorScheme.dark(
primary: Colors.green.shade400,
secondary: Colors.green.shade700,
surface: const Color(0xFF2A2A2A),
background: const Color(0xFF1A1A1A),
),
textTheme: const TextTheme(
displayLarge: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
letterSpacing: 1.2,
),
bodyLarge: TextStyle(fontSize: 16, letterSpacing: 0.5),
),
),
theme: lightTheme,
darkTheme: darkTheme,
themeMode: themeController.flutterThemeMode,
home: const SplashScreen(),
onGenerateRoute: (settings) {
if (settings.name == '/') {
Expand Down
17 changes: 12 additions & 5 deletions lib/screens/auth/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,23 @@ class _LoginScreenState extends State<LoginScreen>
// OR divider
Row(
children: [
Expanded(child: Divider(color: Colors.grey.shade700)),
Expanded(
child:
Divider(color: Theme.of(context).dividerColor)),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'OR',
style: TextStyle(
color: Colors.grey.shade500,
color:
Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w600,
),
),
),
Expanded(child: Divider(color: Colors.grey.shade700)),
Expanded(
child:
Divider(color: Theme.of(context).dividerColor)),
],
),
const SizedBox(height: 24),
Expand All @@ -250,7 +255,7 @@ class _LoginScreenState extends State<LoginScreen>
),
),
style: OutlinedButton.styleFrom(
foregroundColor: Colors.white,
foregroundColor: Theme.of(context).colorScheme.onSurface,
side: BorderSide(color: Colors.green.shade400, width: 2),
padding: const EdgeInsets.symmetric(
vertical: 16,
Expand All @@ -267,7 +272,9 @@ class _LoginScreenState extends State<LoginScreen>
children: [
Text(
'Don\'t have an account? ',
style: TextStyle(color: Colors.grey.shade400),
style: TextStyle(
color:
Theme.of(context).colorScheme.onSurfaceVariant),
),
TextButton(
onPressed: () {
Expand Down
10 changes: 5 additions & 5 deletions lib/screens/auth/signup_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class _SignupScreenState extends State<SignupScreen>
Tab(text: 'Create the Team'),
],
labelColor: Colors.green.shade400,
unselectedLabelColor: Colors.grey,
unselectedLabelColor: Theme.of(context).colorScheme.onSurfaceVariant,
indicatorColor: Colors.green.shade400,
indicatorSize: TabBarIndicatorSize.tab,
),
Expand Down Expand Up @@ -403,18 +403,18 @@ class _SignupScreenState extends State<SignupScreen>
// OR divider
Row(
children: [
Expanded(child: Divider(color: Colors.grey.shade700)),
Expanded(child: Divider(color: Theme.of(context).dividerColor)),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'OR',
style: TextStyle(
color: Colors.grey.shade500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w600,
),
),
),
Expanded(child: Divider(color: Colors.grey.shade700)),
Expanded(child: Divider(color: Theme.of(context).dividerColor)),
],
),
const SizedBox(height: 24),
Expand All @@ -434,7 +434,7 @@ class _SignupScreenState extends State<SignupScreen>
),
),
style: OutlinedButton.styleFrom(
foregroundColor: Colors.white,
foregroundColor: Theme.of(context).colorScheme.onSurface,
side: BorderSide(color: Colors.green.shade400, width: 2),
padding: const EdgeInsets.symmetric(
vertical: 16,
Expand Down
51 changes: 30 additions & 21 deletions lib/screens/auth/team_selection_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,40 +125,42 @@ class _TeamSelectionDialogState extends State<TeamSelectionDialog> {
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
backgroundColor: const Color(0xFF2A2A2A),
title: const Text(
backgroundColor: Theme.of(context).colorScheme.surface,
title: Text(
'Team Created Successfully!',
style: TextStyle(color: Colors.white),
style: Theme.of(context).textTheme.titleLarge,
),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
Text(
'Your Team ID is:',
style: TextStyle(color: Colors.grey),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant),
),
const SizedBox(height: 16),
Container(
padding:
const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
decoration: BoxDecoration(
color: const Color(0xFF1A1A1A),
color: Theme.of(context).colorScheme.surfaceContainerLow,
borderRadius: BorderRadius.circular(8),
),
child: Text(
teamId,
style: const TextStyle(
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
letterSpacing: 2,
color: Colors.white,
color: Theme.of(context).colorScheme.onSurface,
),
),
),
const SizedBox(height: 16),
const Text(
Text(
'Share this ID with your team members so they can join your team.',
style: TextStyle(color: Colors.grey),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant),
textAlign: TextAlign.center,
),
],
Expand All @@ -183,21 +185,22 @@ class _TeamSelectionDialogState extends State<TeamSelectionDialog> {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async => false, // Prevent dismissal
return PopScope(
canPop: false,
child: AlertDialog(
backgroundColor: const Color(0xFF2A2A2A),
title: const Text(
backgroundColor: Theme.of(context).colorScheme.surface,
title: Text(
'Complete Your Setup',
style: TextStyle(color: Colors.white),
style: Theme.of(context).textTheme.titleLarge,
),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
Text(
'Choose how you want to proceed:',
style: TextStyle(color: Colors.grey),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant),
),
const SizedBox(height: 24),
// Toggle between Join and Create
Expand Down Expand Up @@ -315,9 +318,11 @@ class _OptionCard extends StatelessWidget {
decoration: BoxDecoration(
color: isSelected
? Colors.green.withOpacity(0.2)
: const Color(0xFF1A1A1A),
: Theme.of(context).colorScheme.surfaceContainerLow,
border: Border.all(
color: isSelected ? Colors.green : Colors.grey.shade800,
color: isSelected
? Colors.green
: Theme.of(context).colorScheme.outline,
width: 2,
),
borderRadius: BorderRadius.circular(12),
Expand All @@ -327,14 +332,18 @@ class _OptionCard extends StatelessWidget {
children: [
Icon(
icon,
color: isSelected ? Colors.green : Colors.grey,
color: isSelected
? Colors.green
: Theme.of(context).colorScheme.onSurfaceVariant,
size: 32,
),
const SizedBox(height: 8),
Text(
title,
style: TextStyle(
color: isSelected ? Colors.white : Colors.grey,
color: isSelected
? Theme.of(context).colorScheme.onSurface
: Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
fontSize: 14,
),
Expand Down
Loading