253 lines
7.5 KiB
Dart
253 lines
7.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
import 'firebase_options.dart';
|
|
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await Firebase.initializeApp(
|
|
options: DefaultFirebaseOptions.currentPlatform,
|
|
);
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Trainer App',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.pink),
|
|
useMaterial3: true,
|
|
),
|
|
home: const HomeScreen(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class HomeScreen extends StatelessWidget {
|
|
const HomeScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
const Center(
|
|
child: Text(
|
|
'Hallo Trainer!',
|
|
style: TextStyle(
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.pink,
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 20),
|
|
// Next Training Card
|
|
Container(
|
|
height: 200,
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(12),
|
|
image: const DecorationImage(
|
|
image: AssetImage('images/training_bg.jpg'),
|
|
fit: BoxFit.cover,
|
|
colorFilter: ColorFilter.mode(
|
|
Colors.black26,
|
|
BlendMode.darken,
|
|
),
|
|
),
|
|
),
|
|
child: const Center(
|
|
child: Text(
|
|
'Dein nächstes Training',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 20),
|
|
// Favorites Section
|
|
const Text(
|
|
'Favoriten',
|
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
|
),
|
|
const SizedBox(height: 10),
|
|
SizedBox(
|
|
height: 100,
|
|
child: ListView(
|
|
scrollDirection: Axis.horizontal,
|
|
children: const [
|
|
CategoryCircle(
|
|
title: 'Kondition',
|
|
icon: Icons.directions_run,
|
|
),
|
|
CategoryCircle(title: 'Wurf', icon: Icons.sports_handball),
|
|
CategoryCircle(
|
|
title: 'Passen',
|
|
icon: Icons.sports_volleyball,
|
|
),
|
|
CategoryCircle(
|
|
title: 'Torhüter',
|
|
icon: Icons.sports_soccer,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 20),
|
|
// Suggestions Section
|
|
const Text(
|
|
'Vorschläge',
|
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
|
),
|
|
const SizedBox(height: 10),
|
|
SizedBox(
|
|
height: 180,
|
|
child: PageView(
|
|
children: const [
|
|
ExerciseCard(
|
|
title: 'Wurf',
|
|
category: 'Wurf',
|
|
icon: Icons.sports_handball,
|
|
),
|
|
ExerciseCard(
|
|
title: 'Doppelpass',
|
|
category: 'Passen',
|
|
icon: Icons.sports_volleyball,
|
|
),
|
|
ExerciseCard(
|
|
title: 'Torhüter Training',
|
|
category: 'Torhüter',
|
|
icon: Icons.sports_soccer,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
type: BottomNavigationBarType.fixed,
|
|
items: const [
|
|
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
|
|
BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Suche'),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.favorite_border),
|
|
label: 'Favoriten',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.calendar_today),
|
|
label: 'Kalender',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.person_outline),
|
|
label: 'Profil',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class CategoryCircle extends StatelessWidget {
|
|
final String title;
|
|
final IconData icon;
|
|
|
|
const CategoryCircle({super.key, required this.title, required this.icon});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.only(right: 16.0),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
width: 70,
|
|
height: 70,
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: Icon(
|
|
icon,
|
|
color: Theme.of(context).colorScheme.primary,
|
|
size: 35,
|
|
),
|
|
),
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
title,
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ExerciseCard extends StatelessWidget {
|
|
final String title;
|
|
final String category;
|
|
final IconData icon;
|
|
|
|
const ExerciseCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.category,
|
|
required this.icon,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: 180,
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(icon, size: 60, color: Theme.of(context).colorScheme.primary),
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
title,
|
|
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
const SizedBox(height: 8),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: Text(
|
|
category,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Theme.of(context).colorScheme.primary,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|