focused border not taking the whole container flutter

Advertisements Here as shown the focused border is not taking the whole space. Can anybody explain why and fix it. Here is the code of the TextField : child: Padding( padding: const EdgeInsets.only(left: 20.0), child: TextField( controller: _emailController, decoration: InputDecoration( hintText: ‘Enter your email’, border: InputBorder.none, focusedBorder: OutlineInputBorder( borderSide: const BorderSide(color: Colors.deepPurple), borderRadius: BorderRadius.circular(12), ),… Read More focused border not taking the whole container flutter

Back Button Not Working when implemented a ListView Builder Widget Flutter

Advertisements I have this code which displays a back button, text, and then a listview builder widget. When I remove the listview builder widget, the back button works fine, but when I add it back the back button breaks. I don’t know why this is happening and need this issue to be fixed pretty quickly.… Read More Back Button Not Working when implemented a ListView Builder Widget Flutter

How to make Container match parent in Sizebox

Advertisements import ‘package:flutter/material.dart’; void main() => runApp(const MyApp()); class MyApp extends StatefulWidget { const MyApp({super.key}); @override State<MyApp> createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( useMaterial3: true, ), home: Scaffold( body: Align( alignment: Alignment.topCenter, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 200,… Read More How to make Container match parent in Sizebox

Flutter, how do I change the color of the sorting icon?

Advertisements Widget DataTable has an built-in icon for sorting indication How can I change the color or even the icon? Scrollbar( controller: _scrollController, child: SingleChildScrollView( controller: _scrollController, scrollDirection: Axis.horizontal, child: DataTable( border: TableBorder.all(width: 0.2), headingRowColor: MaterialStateProperty.resolveWith<Color?>( (Set<MaterialState> states) { return Styles.TableHeaderColor; }), columns: getColumns(TableTitles), rows: getRows(), sortColumnIndex: sortColumnIndex, sortAscending: isAscending, dataRowHeight: 50, headingRowHeight: 40, ),… Read More Flutter, how do I change the color of the sorting icon?

Failing to convert List<Map<String,dynamic>> into List of Object in Flutter in with fromMap Constructor in flutter

Advertisements I have created two class named Movie and Person, where person class contains a list of Movie.. I am using toMap method and fromMap Constructor for converting into map to object and visa versa… But in a Person class i cant understand why following statement not working favmovies:map[‘favmovies’].map((e)=>Movie.fromMap(e)).toList(); i can solve with some other… Read More Failing to convert List<Map<String,dynamic>> into List of Object in Flutter in with fromMap Constructor in flutter

NavigationDrawer custom widget not accepted

Advertisements A few weeks ago I was able to launch a project without errors. Now, I am trying to launch the project again but there are some errors on it. Here you have the code for the widget NavigationDrawer: class NavigationDrawer extends StatefulWidget { const NavigationDrawer({Key? key}) : super(key: key); @override State<NavigationDrawer> createState() => _NavigationDrawerState();… Read More NavigationDrawer custom widget not accepted

What does `g_autoptr(MyApplication) app = my_application_new();` mean

Advertisements I was browsing through a flutter linux application source code and i hit a little snag understanding this method of declaration and if it’s C or C++. // Source code for context #include "my_application.h" int main(int argc, char** argv) { g_autoptr(MyApplication) app = my_application_new(); return g_application_run(G_APPLICATION(app), argc, argv); } I’m familiar with these declaration… Read More What does `g_autoptr(MyApplication) app = my_application_new();` mean

Not able to load a file from flutter

Advertisements I write this code to save an list as csv file generatecsv() async { if (await Permission.storage.request().isGranted) { String dir = (await getExternalStorageDirectory())!.path; String filep = "$dir/csvdatasave.csv"; File f = new File(filep); String csv = const ListToCsvConverter().convert(_logdata); f.writeAsString(csv); print("gen complete"); } else { Map<Permission, PermissionStatus> statuses = await [ Permission.storage, ].request(); } } It… Read More Not able to load a file from flutter

Flutter- Stack takes a lot of height despite the children

Advertisements I’m using Listview.builder to show products. I use mediaQuery to check if screen width is big enough then it would use Grideview.builder() as show in image below but there is a problem with Grideview.builder() only which is this excees Stack Height, i checked with flutter devTools and found the the column inside stack is… Read More Flutter- Stack takes a lot of height despite the children