Another exception was thrown: type 'Map<String, bool>' is not a subtype of type…
- User
Another exception was thrown: type '_Map<String, bool>' is not a subtype of type 'Map<String, String>' in type cast. import 'package:flutter/material.dart'; import 'package:supabase_flutter/supabase_flutter.dart';
import 'package:sae_mobile/views/signout.dart';
import 'package:sae_mobile/models/User.dart' as user_model;
final SupabaseClient supabaseClient = Supabase.instance.client;
class ProfileView extends StatefulWidget { final user_model.User user; const ProfileView({super.key, required this.user});
@override State createState() => _ProfileState(); }
class _ProfileState extends State { @override Widget build(BuildContext context) { return Column( children: [ Text('Profile'), Text('Email: {widget.user.username}'), const SignOut(), SizedBox(height: 20), // Add your buttons ElevatedButton( style: ElevatedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), minimumSize: Size(double.infinity, 50), ), onPressed: () { Navigator.pushNamed(context, '/annonces', arguments: { 'isUserAnnonces': false, 'isReponduAnnonces': true }); }, child: Text('Mes Reservations'), ), SizedBox(height: 10), ElevatedButton( style: ElevatedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), minimumSize: Size(double.infinity, 50), ), onPressed: () { Navigator.pushNamed(context, '/annonces', arguments: { 'isUserAnnonces': true, 'isReponduAnnonces': false }); }, child: Text('Mes Annonces'), ), ], ); } } import 'package:flutter/material.dart'; import 'package:sae_mobile/models/Builder.dart' as builder_model; import 'package:sae_mobile/views/annonceTile.dart'; import 'package:sae_mobile/models/annonce.dart'; import 'package:supabase_flutter/supabase_flutter.dart';
- Assistant
The error you're encountering,
Another exception was thrown: type '_Map<String, bool>' is not a subtype of type 'Map<String, String>' in type cast,suggests that somewhere in your code you are attempting to treat a map with values () as a map with values (). Unfortunately, Dart is a statically typed language, which means it does not allow this type of implicit casting without explicit conversion. - User
est ce a cause de category id et category name ? je ne les mentionne pas dans profil : const AnnoncesView( {Key? key, required this.categoryId, required this.categoryName, this.isUserAnnonces = false, this.isReponduAnnonces = false}) : super(key: key); et dans profil.dart : import 'package:flutter/material.dart'; import 'package:supabase_flutter/supabase_flutter.dart';
import 'package:sae_mobile/views/signout.dart';
import 'package:sae_mobile/models/User.dart' as user_model;
final SupabaseClient supabaseClient = Supabase.instance.client;
- Assistant
Based on the additional context you've provided, it appears the initial problem identified is indeed unrelated to and . The error relates to the handling of the passed to , not to the or fields in .
- User
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.