Returning data from .pop() to use it anywhere

I have written a code that return bool type variables. Whether you like the movie. If you like the movie then it returns true, if you don’t like the movie then it returns false. But since the .pop() method works in ElevatedButton, I cannot reach it from another class. How can I reach the value?… Read More Returning data from .pop() to use it anywhere

i cant add function to onchanged The argument type 'void Function(Language)' can't be assigned to the parameter type 'void Function(Language?)?'

I’m trying to make an Internationalizing app with this youtube movie: https://www.youtube.com/watch?v=yX0nNHz1sFo&list=PLyHn8N5MSsgEfPAxCytQDPATDlHwpP5rE&index=4 When I add a function to DropDownButton’s onChanged I get the error: The argument type ‘void Function(Language)’ can’t be assigned to the parameter type ‘void Function(Language?)?’ Here is the code class GeneralList extends StatefulWidget { GeneralList({super.key}); @override State<GeneralList> createState() => _GeneralListState(); } class… Read More i cant add function to onchanged The argument type 'void Function(Language)' can't be assigned to the parameter type 'void Function(Language?)?'

Flutter – Radio List Tile not selecting the radio button inside bottom sheet

I am using flutter RadioListTile for radio button selection and having issue while trying to checked. i.e, not selecting the button but value is receiving after checked. can any one help on this? Below is the sample code, var _selectedLanguageRadioIndex = 0; List<String> languageTitle = ["English","हिंदी","ಕನ್ನಡ"]; List<String> languageType = ["en","hi","ka"]; _languageOptions(){ showModalBottomSheet( isScrollControlled: true, shape:… Read More Flutter – Radio List Tile not selecting the radio button inside bottom sheet

How to remove divider line between ddrawer and the list

How to remove divider line between ddrawer and the list? I have next code: @override Widget build(BuildContext context) { return Drawer( child: ListView( children: [ const DrawerHeader( decoration: BoxDecoration( color: Colors.blueGrey, borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40), ), ), child: Text(‘Settings’), ), ListTile( leading: const Icon(Icons.settings), title: const Text("Blue Print"), ), ], ), ); that… Read More How to remove divider line between ddrawer and the list

I want to use Provider in InitState() but got an exception: Null check operator used on a null value

Hi I’m new to flutter. I am using Provider and want to use the data I get from it as the initial value of textfield. So I decided to define the controller as a nullable value and put the text to it in initState(). Here is the code. … TextEditingController? _lastNameController; TextEditingController? _firstNameController; @override void… Read More I want to use Provider in InitState() but got an exception: Null check operator used on a null value

How to align items in Row with ListView.builder()

I have been trying to make design similar to this: But getting this as the output: below is my code that I implemented: Row( children: [ Expanded( flex: 5, child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.vertical, itemCount: interests.length, itemBuilder: (context, index) { return interests[index]; }, ), ), ], ), here interests is the list: like this:… Read More How to align items in Row with ListView.builder()