Add drone logo + change color off battery + drone + flight logo

This commit is contained in:
2025-07-09 22:13:48 +02:00
parent 906abad2ba
commit 6318e60351
3 changed files with 56 additions and 41 deletions

View File

@ -16,7 +16,7 @@ import 'package:rtime/pages/flight_detail_page.dart';
import 'package:provider/provider.dart';
import 'package:rtime/providers/color_provider.dart';
import 'package:rtime/widgets/page_transition_animations.dart';
import 'package:flutter_svg/flutter_svg.dart'; // <-- Ajoutez cet import pour SvgPicture
import 'package:flutter_svg/flutter_svg.dart';
class HomePage extends StatefulWidget {
const HomePage({super.key});
@ -65,14 +65,13 @@ class _HomePageState extends State<HomePage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Nouveau: Ajoutez le SvgPicture ici
SvgPicture.asset(
'assets/images/rtimelogo.svg', // Chemin vers votre SVG
height: 48, // Ajustez la taille selon vos préférences
width: 48, // Ajustez la taille selon vos préférences
colorFilter: ColorFilter.mode(customAccentColor, BlendMode.srcIn), // Appliquez la couleur d'accentuation
'assets/images/rtimelogo.svg',
height: 48,
width: 48,
colorFilter: ColorFilter.mode(customAccentColor, BlendMode.srcIn),
),
const SizedBox(width: 8), // Petit espace entre le logo et le titre
const SizedBox(width: 8),
Text(
l10n.appTitle,
style: TextStyle(
@ -82,7 +81,7 @@ class _HomePageState extends State<HomePage> {
fontFamily: 'Montserrat',
),
),
const Spacer(), // Cela poussera l'icône de réglages à l'extrémité
const Spacer(),
IconButton(
icon:
const Icon(Icons.settings, size: 30, color: Colors.white70),
@ -136,7 +135,7 @@ class _HomePageState extends State<HomePage> {
const SizedBox(height: 10),
Text(l10n.addDrone,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)), // Texte blanc
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)),
],
),
),
@ -170,7 +169,7 @@ class _HomePageState extends State<HomePage> {
const SizedBox(height: 10),
Text(l10n.addDrone,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)), // Texte blanc
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)),
],
),
),
@ -238,7 +237,7 @@ class _HomePageState extends State<HomePage> {
const SizedBox(height: 10),
Text(l10n.addBattery,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)), // Texte blanc
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)),
],
),
),
@ -272,7 +271,7 @@ class _HomePageState extends State<HomePage> {
const SizedBox(height: 10),
Text(l10n.addBattery,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)), // Texte blanc
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white)),
],
),
),
@ -340,7 +339,8 @@ class _HomePageState extends State<HomePage> {
contentPadding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 12),
leading: Icon(Icons.flight_takeoff,
color: Colors.orangeAccent, size: 32),
color: customAccentColor, // Use the user's accent color here
size: 32),
title: Text(
'${flight.name} - ${DateTime.fromMillisecondsSinceEpoch(flight.startTimestamp * 1000).toLocal().toString().split(' ')[0]}',
style: Theme.of(context).textTheme.titleMedium,
@ -375,9 +375,9 @@ class _HomePageState extends State<HomePage> {
},
label: Text(
l10n.newFlight,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.white), // Texte blanc
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.white),
),
icon: const Icon(Icons.add_to_photos, size: 28, color: Colors.white), // Icône blanche
icon: const Icon(Icons.add_to_photos, size: 28, color: Colors.white),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
);