skip to Main Content

Flutter – ToggleButton not changing state

I have three toggle button in my page. When I click either one of the toggle button, it remain unchanged. class EditInvoiceDetailsScreen extends HookWidget { final Invoice invoice; EditInvoiceDetailsScreen(this.invoice, {super.key}); @override Widget build(BuildContext context) { final isSelected = useState(<bool>[true, false,…

VIEW QUESTION

flutter make get request before displaying app

I have a pretty simple problem. I have a code snippet that looks like this: class home_page extends StatefulWidget { @override State<StatefulWidget> createState() => Main(); } class Main extends State<home_page> { void initState() { super.initState(); } @override Widget build(BuildContext context)…

VIEW QUESTION

How to sort model data received from JSON using flutter_bloc?

I have a model: import 'dart:convert'; Forecast forecastFromJson(String str) => Forecast.fromJson(json.decode(str)); String forecastToJson(Forecast data) => json.encode(data.toJson()); class Forecast { List<ListElement> list; Forecast({ required this.list, }); factory Forecast.fromJson(Map<String, dynamic> json) => Forecast( list: List<ListElement>.from(json["list"].map((x) => ListElement.fromJson(x))), ); Map<String, dynamic> toJson() =>…

VIEW QUESTION

Icons.remove_red_eye Hide Show – Flutter

I would like it to show and hide when eyes are clicked TextFormField( keyboardType: TextInputType.visiblePassword, obscureText: true, decoration: const InputDecoration( labelText: "Entrez votre mot de passe", border: OutlineInputBorder(), prefixIcon: Icon(Icons.lock), suffixIcon: Icon(Icons.remove_red_eye), ), ) I would like it to show…

VIEW QUESTION
Back To Top
Search