tasktracker/lib/main.dart
2025-12-07 15:52:59 +05:30

95 lines
3.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
import 'screens/auth_screen.dart';
import 'screens/home_screen.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
try {
await Supabase.initialize(
url: 'https://pkaerjfdwgquztmsrfhy.supabase.co',
anonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBrYWVyamZkd2dxdXp0bXNyZmh5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAyODU1NjMsImV4cCI6MjA3NTg2MTU2M30.tNl04Rn-GquTF_hse0ea8OKNo9cJKAGVDoXP3ZVLSRg',
);
} catch (e) {
debugPrint('Supabase initialization error: $e');
}
runApp(const TaskTrackerApp());
}
final supabase = Supabase.instance.client;
class TaskTrackerApp extends StatelessWidget {
const TaskTrackerApp({ super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'TaskTracker',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF6366F1), // Indigo color
brightness: Brightness.light,
),
useMaterial3: true,
textTheme: GoogleFonts.poppinsTextTheme(),
appBarTheme: AppBarTheme(
backgroundColor: Colors.transparent,
elevation: 0,
titleTextStyle: GoogleFonts.poppins(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.grey[800],
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
elevation: 2,
shadowColor: Colors.black.withValues(alpha: 0.1),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.grey[300]!),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.grey[300]!),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Color(0xFF6366F1), width: 2),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Colors.red),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Colors.red, width: 2),
),
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
home: AuthScreen(),
routes: {
'/auth': (context) => const AuthScreen(),
'/home': (context) => const HomeScreen(),
},
);
}
}