Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to arrange the row() in the button of the screen ( i want to put screen navigating icon in the button )

Column(
                    crossAxisAlignment: CrossAxisAlignment.end,
                    mainAxisAlignment: MainAxisAlignment.end,
                    children: <Widget>[
                      Row(
                        //    crossAxisAlignment: CrossAxisAlignment.end,
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        children: <Widget>[
                          FloatingActionButton(
                            onPressed: () {
                              //ClearSession();
                              if (Navigator.canPop(context)) {
                                Navigator.pop(context, true);
                              }
                              Navigator.pushReplacement(
                                  context,
                                  MaterialPageRoute(
                                      builder: (context) =>
                                          Home(22.0, 22.0)));
                            }
                            // Add your onPressed code here!
                            ,
                            backgroundColor: Colors.green,
                            child: const Icon(Icons.home),
                          ),
                          FloatingActionButton(
                            onPressed: () {
                              //ClearSession();
                              if (Navigator.canPop(context)) {
                                Navigator.pop(context, true);
                              }
                              Navigator.pushReplacement(
                                  context,
                                  MaterialPageRoute(
                                      builder: (context) =>
                                          const Calender()));
                            }
                            // Add your onPressed code here!
                            ,
                            backgroundColor: Colors.green,
                            child: const Icon(Icons.calendar_month),
                          ),
                          FloatingActionButton(
                            onPressed: () {
                              //ClearSession();
                              if (Navigator.canPop(context)) {
                                Navigator.pop(context, true);
                              }
                              Navigator.pushReplacement(
                                  context,
                                  MaterialPageRoute(
                                      builder: (context) =>
                                          const Community()));
                            },
                            backgroundColor: Colors.green,
                            child: const Icon(Icons.article_rounded),
                          ),
                          FloatingActionButton(
                            onPressed: () {
                              // Add your onPressed code here!
                            },
                            backgroundColor: Colors.green,
                            child: const Icon(
                                Icons.settings_accessibility_sharp),
                          ),
                        ],
                      ),
                    ],
                  ),

it should be compatible with all types of screens regardless of screen size
I don’t want to use padding because it only works for some screen , not for all type of the screen
the icons are in the middle of the screen,

I want to put all of them in the button of the screen

this is  the current position of icons

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

it should be compatible with all types of screens regardless of screen size
I don’t want to use padding because it only works for some screen,not for all type of the screen the icons are in the middle of the screen, I want to put all of them in the button of the screen

>Solution :

use scaffold() and after that put your Row() in floatingActionButton property like this:

Scaffold(
  appBar: ...
  body:...
  floatingActionButton: // your Row()
);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading