Stack and Positioned Widget in Flutter 2022

Flutter, Flutter Crash Course, Flutter UI / UX, Flutter Widgets, UI UX

In this flutter tutorial, we are going to create layout widget in flutter. Stack and positioned widget will be used in this tutorial, whereas stack is used to layout widgets on top of one another and positioned widget is used to position the widgets (childerns of stack) to top, bottom, right and left.

 

Watch Youtube tutorial

 

Stack and Positioned Widget Code

return Scaffold(
      appBar: AppBar(
        title: Text("Stack & Positioned Widget"),
        centerTitle: true,
        backgroundColor: Colors.black38,
      ),
      backgroundColor: Colors.grey.shade800,
      body: Center(
        child: Container(
          padding: const EdgeInsets.all(16),
          constraints: const BoxConstraints.expand(
            width: 330,
            height: 450,
          ),
          decoration: const BoxDecoration(
            boxShadow: [
              BoxShadow(
                  color: Colors.white24,
                  offset: Offset(0, 2),
                  spreadRadius: 5,
                  blurRadius: 10),
            ],
            image: DecorationImage(
              image: AssetImage('images/card1.jpg'),
              fit: BoxFit.cover,
            ),
            borderRadius: BorderRadius.all(
              Radius.circular(10.0),
            ),
          ),

          //CHILD STACK WIDGET
          child: Stack(
            children: [
              Text("Editor's Choice",
                  style: TextStyle(color: Colors.white70, fontSize: 18)),
              Positioned(
                top: 20.0,
                child: Text("The Art of Making a Coffee",
                    style: TextStyle(color: Colors.white, fontSize: 22)),
              ),
              Positioned(
                right: 0,
                bottom: 20,
                child: Text("Learn to make the perfect Coffee",
                    style: TextStyle(color: Colors.white, fontSize: 16)),
              ),
              Positioned(
                bottom: 0,
                right: 0,
                child: Text("Coding with Tea",
                    style: TextStyle(color: Colors.white, fontSize: 16)),
              ),
            ],
          ),
        ),
      ),
    );

Let's Connect

Videos are always a better source for in-depth knowledge. So, connect with me at YouTube.

Download Project

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Latest Courses

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Learn flutter from scratch in 4 hours - Flutter Crash Course - Coding with T

Latest Tutorials

Flutter Profile page UI Design - Flutter app design 2023 - Profile Screen Flutter UI - Flutter 2023
Flutter Firebase phone authentication - Firebase Phone auth tutorial in flutter - Flutter Firebase phone number authentication 2022
Firebase Authentication in flutter - Flutter firebase authentication 2022 - firebase auth tutorial 2022 - firebase flutter auth
How to setup firebase in flutter 2022 - Flutter firebase setup
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Join Our Mailing List

Join our mailing list to receive the latest, Free Courses, Video Tutorials, free codes and updates regarding Tutorials and services. You will also start getting coupons on the related services.

You have Successfully Subscribed!

FLUTTER APP

Learn Flutter App development from scratch. Create LOGIN APP that can be used with any application which requires Login Sign Up functionality.

You can watch it on YouTube or read and get source code from Blog Post.

You have Successfully Subscribed!