Flutter Listview.Builder inside bottom sheet widget not loading data on load

The below code does not display any data when the bottomsheet loads. Once the bottomsheet is loaded if I do a save operation on the code editor it loads the data. What am I missing here? I have a bottomsheet widget which is invoked using a button. _showBottomSheet() { showModalBottomSheet( context: context, builder: (context) {… Read More Flutter Listview.Builder inside bottom sheet widget not loading data on load

ScaffoldMessenger showSnackBar on Navigator.push or .pop?

As simple as it sounds, what’s the current method to display a snackbar through the ScaffoldMessenger after a Navigator.pop into the previous page, where the snackbar is shown on the now current page (previous)? >Solution : To return data to the first screen, use the Navigator.pop() method and then show snackbar ElevatedButton( onPressed: () {… Read More ScaffoldMessenger showSnackBar on Navigator.push or .pop?

Error with different versions of the same package Flutter

How to fix this error? Because syncfusion_flutter_charts >=20.1.55 depends on syncfusion_flutter_core ^20.1.55 and syncfusion_flutter_pdfviewer 19.4.56-beta depends on syncfusion_flutter_core ^19.4.56, syncfusion_flutter_charts >=20.1.55 is incompatible with syncfusion_flutter_pdfviewer 19.4.56-beta. And because no versions of syncfusion_flutter_pdfviewer match >19.4.56-beta <20.0.0, syncfusion_flutter_charts >=20.1.55 is incompatible with syncfusion_flutter_pdfviewer ^19.4.56-beta. So, because admin_m32 depends on both syncfusion_flutter_pdfviewer ^19.4.56-beta and syncfusion_flutter_charts ^20.1.55, version solving… Read More Error with different versions of the same package Flutter

Try correcting to the name of an existing method, or defining a method named 'OutlineButton' in flutter 3.0.0. it isn't defined for the type

i have installed flutter 3.0.0 . now i am getting error that outlinedbutton isn’t defined for the type. Error: Method not found: ‘OutlineButton’. lib/appUtils/app_utility.dart:233 OutlineButton( ^^^^^^^^^^^^^ : Error: Method not found: ‘OutlineButton’. lib/appUtils/app_utility.dart:255 OutlineButton( ^^^^^^^^^^^^^ >Solution : That widget have been changed to OutlinedButton. Old Widget was : OutlineButton Old Theme was : ButtonTheme New… Read More Try correcting to the name of an existing method, or defining a method named 'OutlineButton' in flutter 3.0.0. it isn't defined for the type

How to dispose subscription?

How can I dispose subscription if my class is not in StatefulWidge? Is there any method? class EventNotifier extends ValueNotifier<List<String>> { EventNotifier(List<String> value) : super(value); final List<String> events = [‘add’, ‘delete’, ‘edit’]; final stream = Stream.periodic(const Duration(seconds: 5)); late final streamSub = stream.listen( (event) { value.add( events[Random().nextInt(3)], ); notifyListeners(); }, ); } >Solution : I… Read More How to dispose subscription?

Remove space between widgets in row flutter

I need to remove the space between two or more Text widgets in a Row. This is the code using a Row Row( mainAxisAlignment: MainAxisAlignment.start, // textBaseline: TextBaseline.alphabetic, // crossAxisAlignment: CrossAxisAlignment.baseline, children: [ Text( r’$ ‘ + formatNumber(valueText), style: TextStyle( color: Color(0xff210049), fontSize: smallTextSize, fontFamily: ‘RedHat’, ), ), Text( ‘,00’, style: TextStyle( color: Color(0xff210049), fontSize:… Read More Remove space between widgets in row flutter

How to move a variable outside build?

How do I move a variable that uses a context outside of the build method so that it is created once? class _EventListState extends State<EventList> { @override Widget build(BuildContext context) { final eventNotifier = EventInherited.of(context).eventNotifier; … >Solution : You can use the late modifier. class _EventListState extends State<EventList> { late final eventNotifier = EventInherited.of(context).eventNotifier; @override… Read More How to move a variable outside build?

The named parameter 'title' isn't defined. Issue in flutter

Issue The named parameter ‘title’ isn’t defined. Issue in flutter Code: items: [ BottomNavigationBarItem( icon: Icon(Icons.home), title: Text(‘Home’), backgroundColor: Colors.white, ), BottomNavigationBarItem( icon: Icon(Icons.chat), title: Text( ‘Chat’, ), backgroundColor: Colors.white, ), BottomNavigationBarItem( icon: Icon(Icons.alarm_add), title: Text(‘Reminder’), backgroundColor: Colors.white, ), // BottomNavigationBarItem( // icon: Icon(Icons.supervised_user_circle), // title: Text( // ‘Profile’, // ), // backgroundColor: Colors.white, //… Read More The named parameter 'title' isn't defined. Issue in flutter