Initial commit: Project documentation and git setup

This commit is contained in:
Tomas Dvorak
2026-01-03 18:35:35 +01:00
commit 1639de69d4
51 changed files with 5005 additions and 0 deletions
@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import '../../features/auth/presentation/auth_gate.dart';
import '../../features/onboarding/presentation/onboarding_intro_screen.dart';
import '../../features/countdown/presentation/home_countdown_screen.dart';
import '../../features/goals/presentation/goals_list_screen.dart';
import '../../features/social/presentation/social_feed_screen.dart';
import '../../features/profile/presentation/profile_screen.dart';
import '../../features/settings/presentation/settings_home_screen.dart';
final appRouterProvider = Provider<GoRouter>((ref) {
return GoRouter(
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (context, state) => const AuthGate(),
),
GoRoute(
path: '/onboarding',
builder: (context, state) => const OnboardingIntroScreen(),
),
GoRoute(
path: '/home',
builder: (context, state) => const HomeCountdownScreen(),
),
GoRoute(
path: '/goals',
builder: (context, state) => const GoalsListScreen(),
),
GoRoute(
path: '/social',
builder: (context, state) => const SocialFeedScreen(),
),
GoRoute(
path: '/profile',
builder: (context, state) => const ProfileScreen(),
),
GoRoute(
path: '/settings',
builder: (context, state) => const SettingsHomeScreen(),
),
],
errorBuilder: (context, state) => Scaffold(
body: Center(
child: Text('Error: ${state.error}'),
),
),
);
});
+4
View File
@@ -0,0 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
final themeModeProvider = StateProvider<ThemeMode>((ref) => ThemeMode.system);
+161
View File
@@ -0,0 +1,161 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class AppTheme {
static const Color primaryColor = Color(0xFF6366F1);
static const Color secondaryColor = Color(0xFF8B5CF6);
static const Color accentColor = Color(0xFFEC4899);
static const Color backgroundColor = Color(0xFFFAFAFA);
static const Color surfaceColor = Color(0xFFFFFFFF);
static const Color errorColor = Color(0xFFEF4444);
static const Color warningColor = Color(0xFFF59E0B);
static const Color successColor = Color(0xFF10B981);
static const ColorScheme lightColorScheme = ColorScheme(
brightness: Brightness.light,
primary: primaryColor,
onPrimary: Color(0xFFFFFFFF),
secondary: secondaryColor,
onSecondary: Color(0xFFFFFFFF),
error: errorColor,
onError: Color(0xFFFFFFFF),
surface: surfaceColor,
onSurface: Color(0xFF1F2937),
background: backgroundColor,
onBackground: Color(0xFF1F2937),
);
static const ColorScheme darkColorScheme = ColorScheme(
brightness: Brightness.dark,
primary: primaryColor,
onPrimary: Color(0xFFFFFFFF),
secondary: secondaryColor,
onSecondary: Color(0xFFFFFFFF),
error: errorColor,
onError: Color(0xFFFFFFFF),
surface: Color(0xFF1F2937),
onSurface: Color(0xFFF9FAFB),
background: Color(0xFF111827),
onBackground: Color(0xFFF9FAFB),
);
static ThemeData get light {
return ThemeData(
useMaterial3: true,
colorScheme: lightColorScheme,
appBarTheme: const AppBarTheme(
backgroundColor: surfaceColor,
foregroundColor: Color(0xFF1F2937),
elevation: 0,
systemOverlayStyle: SystemUiOverlayStyle.dark,
),
cardTheme: CardThemeData(
color: surfaceColor,
elevation: 2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: primaryColor,
foregroundColor: Color(0xFFFFFFFF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
),
),
textTheme: const TextTheme(
displayLarge: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Color(0xFF1F2937),
),
displayMedium: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Color(0xFF1F2937),
),
headlineLarge: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
),
headlineMedium: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
),
bodyLarge: TextStyle(
fontSize: 16,
color: Color(0xFF4B5563),
),
bodyMedium: TextStyle(
fontSize: 14,
color: Color(0xFF6B7280),
),
),
);
}
static ThemeData get dark {
return ThemeData(
useMaterial3: true,
colorScheme: darkColorScheme,
appBarTheme: const AppBarTheme(
backgroundColor: Color(0xFF1F2937),
foregroundColor: Color(0xFFF9FAFB),
elevation: 0,
systemOverlayStyle: SystemUiOverlayStyle.light,
),
cardTheme: CardThemeData(
color: const Color(0xFF374151),
elevation: 2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: primaryColor,
foregroundColor: Color(0xFFFFFFFF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
),
),
textTheme: const TextTheme(
displayLarge: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Color(0xFFF9FAFB),
),
displayMedium: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Color(0xFFF9FAFB),
),
headlineLarge: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w600,
color: Color(0xFFF9FAFB),
),
headlineMedium: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Color(0xFFF9FAFB),
),
bodyLarge: TextStyle(
fontSize: 16,
color: Color(0xFFD1D5DB),
),
bodyMedium: TextStyle(
fontSize: 14,
color: Color(0xFF9CA3AF),
),
),
);
}
}
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
class PrimaryButton extends StatelessWidget {
final String text;
final VoidCallback onPressed;
final bool isLoading;
final bool isDisabled;
final Color? backgroundColor;
final Color? foregroundColor;
final double? width;
final double? height;
const PrimaryButton({
super.key,
required this.text,
required this.onPressed,
this.isLoading = false,
this.isDisabled = false,
this.backgroundColor,
this.foregroundColor,
this.width,
this.height,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height ?? 48,
child: ElevatedButton(
onPressed: (isLoading || isDisabled) ? null : onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor,
foregroundColor: foregroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: isLoading
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
foregroundColor ?? Theme.of(context).colorScheme.onPrimary,
),
),
)
: Text(text),
),
);
}
}