tasktracker/lib/main.dart

88 lines
2.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'screens/auth_screen.dart';
import 'package:appwrite/appwrite.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
Client client = Client()
.setEndpoint("https://supab.playpoolstudios.com/v1")
.setProject("tasktracker");
Account account = Account(client);
runApp(TaskTrackerApp(account: account, client: client));
}
class TaskTrackerApp extends StatelessWidget {
final Account account;
final Client client;
const TaskTrackerApp({required this.account, required this.client, 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(account: account, client: client),
);
}
}