skip to Main Content

Flutter – Picked Date Does not Showing

late DateTime datePicked = DateTime.now(); void showDatePickerForUser() { showDatePicker( context: context, initialDate: DateTime.now(), firstDate: DateTime.now(), lastDate: DateTime.now().add(const Duration(days: 365)), ).then((value) { setState(() { datePicked = value!; }); }); } Container( height: MediaQuery.of(context).size.height * 0.08, width: MediaQuery.of(context).size.width * 0.9, decoration: BoxDecoration(…

VIEW QUESTION

Flutter – What is ActivityRef while creating a Provider

The code below is from the article 'Make your first provider/network request' in Riverpod documentation. //activity.dart import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'activity.dart'; // Necessary for code-generation to work part 'provider.g.dart'; /// This will create a provider…

VIEW QUESTION

Flutter – List not updating after item added

I want to add item in list when floatingAction button is clicked. class EditAgentVehiclesListScreen extends HookWidget { final ValueNotifier<List<VehicleItems>> list; const EditAgentVehiclesListScreen(this.list, {super.key}); @override Widget build(BuildContext context) { return Scaffold( floatingActionButton: FloatingActionButton( backgroundColor: AppTheme.light.colorScheme.primary, onPressed: () { Navigator.pushNamed(context, TenancyRoutes.createVehicleItemsScreen) .then(((onValue)…

VIEW QUESTION

How to avoid render box errors while using flexible around text in flutter?

whenever I use Expanded or Flexible in anyway on this Widget buildRadioButton(String label, String value, String? groupValue, Function(String?) onChanged) { return Row( children: [ Radio( value: value, groupValue: groupValue, onChanged: onChanged, activeColor: Theme.of(context).colorScheme.onBackground, fillColor: MaterialStateColor.resolveWith( (states) { if (states.contains(MaterialState.selected)) {…

VIEW QUESTION
Back To Top
Search