Facebook Twitter Instagram
    DeepCrazyWorld
    Facebook Twitter Instagram Pinterest YouTube
    • FLUTTER
      • FLUTTER APP
        • QRCode
        • Quiz App
        • Chat GPT
        • PDF App
        • News App
        • Fitness App
        • Weather App
        • BMI Calculator
        • GAME APP
        • Ecommerce App
        • wallpaper App
        • Finance app
        • Chat App
        • Wallet App
        • Taxi App
        • Quran app
        • Music player app
      • FLUTTER UI
        • Splash Screen
        • Onboarding Screen
        • Login Screen
        • Card Design
        • Drawer
    • PROJECT
      • Android Projects
      • College Projects
      • FLUTTER APP
      • Project Ideas
      • PHP Projects
      • Python Projects
    • SOURCE CODE
    • ANDROID
      • ANDROID APP
      • GAME APP
      • ANDROID STUDIO
    • MCQ
      • AKTU MCQ
        • RPA MCQ
        • COA MCQ
        • HPC MCQ
        • SPM MCQ
        • Renewable Energy All MCQ
        • Data Compression MCQ
        • Data Structure MCQ
        • Digital Image Processing MCQ
        • Software Engineering MCQ
        • Machine Learning MCQ
        • Artificial Intelligence MCQ
      • D PHARMA MCQ
        • Pharmaceutics – I MCQ
        • Pharmacognosy MCQ
        • Pharmaceutical Chemistry MCQ
        • Biochemistry and Clinical Pathology MCQ
        • Human Anatomy and Physiology MCQ
        • Heath Education and Community Pharmacy MCQ
    • INTERVIEW QUESTIONS
      • Flutter Interview Questions
      • INTERVIEW QUESTIONS
      • Python Interview Questions
      • Coding ninjas solution
    • MORE
      • WORDPRESS
        • SEO
        • TOP 10 WORDPRESS THEME
      • PRODUCTIVITY
      • Program
      • QUOTES
    DeepCrazyWorld
    Home»FLUTTER»How to Setup Space Between Elements In Flutter 2023
    FLUTTER

    How to Setup Space Between Elements In Flutter 2023

    DeepikaBy DeepikaMay 9, 2022Updated:February 19, 2023No Comments3 Mins Read

    Row Widget is a widget where you can place multiple widgets in a Row Align Horizontally. so in this article, we will go through How to Set Space Between Elements In Flutter?

    Table of Contents

    Toggle
        • How to Set Space Between Elements In Flutter?
        • Conclusion:
    • Additional Reading
    • READ MORE

    How to Set Space Between Elements In Flutter?

    <img decoding=

    ow to add space between widgets. There are many options available in flutter which you can use to provide space and make UI attractive. If you use Row and Column for arranging widgets, then by default limited options are available for alignment. There are many options available for the spacing of widgets like Padding, Spacer, Fractionally, SizedBox, Expanded, Flexible, etc. Here, we’ll learn about SizedBox, as it is easier to implement, provides more flexibility in alignment, and also easier to understand.

    Row widget has a property called MainAxisAlignment.

    • MainAxisAlignment

    start – Place the children as close to the start of the main axis as possible.

    Start

    end – Place the children as close to the end of the main axis as possible.

    End
    End

    center – Place the children as close to the middle of the main axis as possible.

    Center
    Center

    spaceBetween – Place the free space evenly between the children.

    Space Between
    Space Between

    spaceAround – Place the free space evenly between the children as well as half of that space before and after the first and last child.

    Space Around
    Space Around

    spaceEvenly – Place the free space evenly between the children as well as before and after the first and last child.

    Space Evenly
    Space Evenly

    There are also a few ways to achieve the same. Consider a code as below:

    Use SizedBox Widget if you want to set some specific spaceRow( children: <Widget>[ Text(“1”), SizedBox(width: 50), // give it width Text(“2”), ],)

    We will get output like below:

    SizedBox Widget
    Sized Box Widget

    Use Spacer if you want both to be as far apart as possible.Row( children: <Widget>[ Text(“1”), Spacer(), // use Spacer Text(“2”), ],)

    We will get output like below:

    Spacer Widget Flutter
    Spacer Widget Flutter

    Use mainAxisAlignment according to your needs:Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, // use whichever suits your need children: <Widget>[ Text(“1”), Text(“2”), ],)

    We will get output like below:

    MainAxis Alignment
    MainAxis Alignment

    Use Wrap instead of Row Widget and give some spacing.

    Wrap( spacing: 100, // set spacing here

    children: <Widget>[ Text(“1”), Text(“2”), ],)

    We will get output like below:

    Wrap
    Wrap
    • Use Wrap instead of Row and give it alignment. Wrap( alignment: WrapAlignment.spaceAround, // set your alignment children: <Widget>[ Text(“1”), Text(“2”), ],)We will get output like below:

    Wrap Widget

    • Wrap
    • Widget
    Integrating an API into a Flutter – Working with REST APIs

    Conclusion:

    In this article, We have been through How to Set Space Between Elements In Flutter

    Additional Reading

    • SEO Practices Everyone Should Follow SEO Rules
    • Complete Top SEO Checklist
    • Top 50+ SEO Interview Questions
    • What is a Backlink? How to Get More Backlinks
    • TCS INTERVIEW QUESTIONS – CLICKE HERE
    • Top 20 Interview Program Questions
    • Android Projects with Source Code
    • Python Project With Source Code
    • Python Projects Ideas
    • Machine Learning MCQ Questions
    • Highest Paying Earning Website 
    • School Database Management System 
    • Top 20 Company Interview Questions

    READ MORE

    If you found this post useful, don’t forget to share this with your friends, and if you have any query feel free to comment it in the comment section.

    Thank you 🙂 Keep Learning !

    Share. Facebook Twitter LinkedIn WhatsApp Telegram Pinterest Reddit Email
    Previous ArticleWipro Technical Interview Questions & HR Questions For Freshers 2023
    Next Article Integrating an API into a Flutter – Working with REST APIs

    Related Posts

    Implementing a Dynamic FAQ Screen UI in Flutter Using ExpansionTile

    FLUTTER 5 Mins Read

    Animated Backgrounds in Flutter: A Complete Guide

    FLUTTER 4 Mins Read

    How to make custom BottomNavigationBar in flutter with source code

    BottomNavigationBar 4 Mins Read

    How to Make a ToDo App with Flutter with source Code StepWise in 2024

    FLUTTER 4 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Implementing a Dynamic FAQ Screen UI in Flutter Using ExpansionTile March 29, 2025
    • Creating an Instruction UI Screen in Flutter Application March 29, 2025
    • Animated Backgrounds in Flutter: A Complete Guide March 15, 2025
    • How to make Diary App using flutter stepwise using getx August 31, 2024
    • How to Create Music Player UI screen with fully functional in flutter August 30, 2024
    • How to make ListView Builder Ui in flutter with Source Code August 29, 2024
    • Create a TabBar View in flutter with fully functional stepwise August 28, 2024
    • How to create TabBar view in flutter with source code step wise August 27, 2024
    • How to make Heart rate measure app with Flutter stepwise August 26, 2024
    • How to make ChatGpt App in flutter with source code Stepwise August 25, 2024
    Facebook Twitter Instagram Pinterest YouTube
    • About
    • Contact
    • Disclaimer
    • Privacy Policy
    Copyright by DeepCrazyWorld © 2025

    Type above and press Enter to search. Press Esc to cancel.