fix : Différentes erreurs

This commit is contained in:
Yaël Perret
2026-05-14 16:05:08 +02:00
parent 09219b8ca1
commit a812a70b1d
14 changed files with 26 additions and 460 deletions

View File

@@ -10,10 +10,10 @@ class NoticeSheet extends StackedView<NoticeSheetModel> {
final Function(SheetResponse)? completer;
final SheetRequest request;
const NoticeSheet({
Key? key,
super.key,
required this.completer,
required this.request,
}) : super(key: key);
});
@override
Widget builder(

View File

@@ -5,13 +5,12 @@ import 'package:flutter/material.dart';
class ReadMoreText extends StatefulWidget {
const ReadMoreText(
this.text, {
Key? key,
super.key,
this.trimLines = 2,
this.collapsedText = '... read more',
this.expandedText = ' read less',
this.textStyle,
}) : assert(text != null),
super(key: key);
}) : assert(text != null);
final String text;
final int trimLines;
@@ -69,7 +68,7 @@ class ReadMoreTextState extends State<ReadMoreText> {
textSize.height,
));
endIndex = textPainter.getOffsetBefore(pos.offset);
var textSpan;
TextSpan textSpan;
if (textPainter.didExceedMaxLines) {
textSpan = TextSpan(
text: _readMore

View File

@@ -14,7 +14,7 @@ class AnimatorWidget extends StatefulWidget {
final double? aspectRatio; // Nouveau paramètre pour le ratio (largeur/hauteur)
const AnimatorWidget({
Key? key,
super.key,
required this.authorName,
required this.authorImageUrl,
this.publishDate,
@@ -26,7 +26,7 @@ class AnimatorWidget extends StatefulWidget {
this.onComment,
this.onShare,
this.aspectRatio, // null = ratio naturel de l'image, ex: 16/9, 4/3, 1/1
}) : super(key: key);
});
@override
State<AnimatorWidget> createState() => _AnimatorWidgetWidgetState();

View File

@@ -15,7 +15,7 @@ class PostCardWidget extends StatelessWidget {
final VoidCallback? onShare;
const PostCardWidget({
Key? key,
super.key,
required this.title,
required this.content,
required this.authorName,
@@ -28,7 +28,7 @@ class PostCardWidget extends StatelessWidget {
this.onLike,
this.onComment,
this.onShare,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {
@@ -109,7 +109,7 @@ class PostCardWidget extends StatelessWidget {
// Images avec boutons d'action si présentes
if (imageUrls != null && imageUrls!.isNotEmpty)
Container(
SizedBox(
//margin: const EdgeInsets.symmetric(vertical: 12.0),
height: 200,
child: Stack(

View File

@@ -18,7 +18,7 @@ class PostCardWidget extends StatefulWidget {
final double? aspectRatio; // Nouveau paramètre pour le ratio (largeur/hauteur)
const PostCardWidget({
Key? key,
super.key,
required this.title,
required this.content,
required this.authorName,
@@ -32,7 +32,7 @@ class PostCardWidget extends StatefulWidget {
this.onComment,
this.onShare,
this.aspectRatio, // null = ratio naturel de l'image, ex: 16/9, 4/3, 1/1
}) : super(key: key);
});
@override
State<PostCardWidget> createState() => _PostCardWidgetState();
@@ -129,7 +129,7 @@ class _PostCardWidgetState extends State<PostCardWidget> {
builder: (context, snapshot) {
final imageHeight = snapshot.data ?? 200.0; // Hauteur par défaut si pas encore calculée
return Container(
return SizedBox(
height: imageHeight,
child: Stack(
children: [

View File

@@ -13,10 +13,10 @@ class InfoAlertDialog extends StackedView<InfoAlertDialogModel> {
final Function(DialogResponse) completer;
const InfoAlertDialog({
Key? key,
super.key,
required this.request,
required this.completer,
}) : super(key: key);
});
@override
Widget builder(

View File

@@ -8,7 +8,7 @@ import 'package:bahla_front/ui/common/post_card_widget.dart';
class EventDetailsView extends StackedView<EventDetailsViewModel> {
final int eventId;
const EventDetailsView({Key? key, required this.eventId}) : super(key: key);
const EventDetailsView({super.key, required this.eventId});
@override
Widget builder(
@@ -32,7 +32,7 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
SliverToBoxAdapter(
child: Column(
children: [
Container(
SizedBox(
width: double.infinity,
height: MediaQuery.of(context).size.width * 9 / 16,
child: const Image(
@@ -56,7 +56,7 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
),
const SizedBox(height: 16),
Center(
child: Container(
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.8,
child: Table(
columnWidths: const {
@@ -153,7 +153,7 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Align(
alignment: Alignment.centerLeft,
child: Container(
child: SizedBox(
width: 40,
height: 40,
child: Image.asset(

View File

@@ -5,7 +5,7 @@ import 'package:intl/intl.dart';
import 'home_viewmodel.dart';
class HomeView extends StackedView<HomeViewModel> {
const HomeView({Key? key}) : super(key: key);
const HomeView({super.key});
@override
Widget builder(
@@ -14,7 +14,7 @@ class HomeView extends StackedView<HomeViewModel> {
Widget? child,
) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
body: ListView.builder(
itemCount: viewModel.events.length,
itemBuilder: (context, index) {

View File

@@ -7,7 +7,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'main_viewmodel.dart';
class MainView extends StackedView<MainViewModel> {
const MainView({Key? key}) : super(key: key);
const MainView({super.key});
@override
Widget builder(
@@ -30,7 +30,7 @@ class MainView extends StackedView<MainViewModel> {
],
),
centerTitle: false,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
shape: Border(
bottom: BorderSide(
color: Theme.of(context).colorScheme.outline,
@@ -38,10 +38,10 @@ class MainView extends StackedView<MainViewModel> {
),
),
),
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
currentIndex: viewModel.currentIndex,
onTap: viewModel.setIndex,
showSelectedLabels: false,

View File

@@ -6,7 +6,7 @@ import 'package:bahla_front/ui/common/ui_helpers.dart';
import 'startup_viewmodel.dart';
class StartupView extends StackedView<StartupViewModel> {
const StartupView({Key? key}) : super(key: key);
const StartupView({super.key});
@override
Widget builder(