<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammad Fallah on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Fallah on Medium]]></description>
        <link>https://medium.com/@mmohammadmfallahm02?source=rss-a1dcea1b6ea7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JrcGNHGevsB1QFV-1TGOLQ.jpeg</url>
            <title>Stories by Mohammad Fallah on Medium</title>
            <link>https://medium.com/@mmohammadmfallahm02?source=rss-a1dcea1b6ea7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:56:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mmohammadmfallahm02/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Elevate Your Flutter UI with Stunning Glass Effects: A Step-by-Step Guide.]]></title>
            <link>https://medium.com/@mmohammadmfallahm02/elevate-your-flutter-ui-with-stunning-glass-effects-a-step-by-step-guide-c831ab9c3d04?source=rss-a1dcea1b6ea7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c831ab9c3d04</guid>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Mohammad Fallah]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 23:47:12 GMT</pubDate>
            <atom:updated>2023-07-07T23:47:12.760Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this comprehensive guide, we’ll delve into the fascinating world of glass effects in Flutter app development. Glass effects add a touch of elegance and modernity to user interfaces, creating a visually stunning experience for your app users. Whether you want to achieve a frosted glass effect, a blurred glass effect, or a translucent glass effect, this article will provide you with step-by-step instructions on how to implement these effects in your Flutter projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wzwwN4YXqv9OR6mYZEwR1g.png" /><figcaption><a href="https://dribbble.com/shots/14992113-Card-in-the-dark">Designed by Kimia Rafiee</a></figcaption></figure><p>I was browsing the internet when I came across an inspiring picture that motivated me to create a glamorous design with stunning glass effects in Flutter. Let’s embark on this journey together!</p><h3>Step1</h3><p>In this tutorial, we won’t rely on any Flutter packages. To start, create a new project and add an assets folder. Update the<strong> pubspec.yaml </strong>file to include the assets directory. Then, place the required assets files for this tutorial into the assets folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IhRbIZCFlLMPrMlgHkk75A.png" /><figcaption>add assets files</figcaption></figure><h3>Step2</h3><p>On the home screen, return a Scaffold widget and set the background color. Use a Stack widget as the body to layer the elements. Center the first container widget, which represents a card. Set its width, height, border radius, and color.To achieve the glass effect, wrap the container with a BackdropFilter widget and specify the filter parameter with ImageFilter.blur, adjusting the sigmaX and sigmaY values to control the blur intensity</p><pre>import &#39;dart:ui&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br><br>class HomeScreen extends StatelessWidget {<br>  const HomeScreen({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xff1C1760),<br>      body: Stack(<br>        children: [<br>          Center(<br>            child: BackdropFilter(<br>              filter:  ImageFilter.blur(sigmaX: 30, sigmaY: 30),<br>              child: Container(<br>                width: 450,<br>                height: 250,<br>                decoration: const BoxDecoration(<br>                    color: Colors.grey.withOpacity(0.1),<br>                    borderRadius: BorderRadius.all(Radius.circular(25))),<br>              ),<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><p>The filter includes the entire page!! Why? because The filter will be applied to all the areas within its parent or ancestor widget’s clip. If there’s no clip, the filter will be applied to the full screen. so to fix this you should wrap your container with another widget such as <strong>ClipRRect. </strong>The ClipRRect ensures that the container and its child are clipped with rounded corners, while the BackdropFilter applies the blur effect.</p><pre>import &#39;dart:ui&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br><br>class HomeScreen extends StatelessWidget {<br>  const HomeScreen({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xff1C1760),<br>      body: Stack(<br>        children: [<br>          Center(<br>            child: ClipRRect(<br>              borderRadius:BorderRadius.all(Radius.circular(25)),<br>              child: BackdropFilter(<br>                filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),<br>                child: Container(<br>                  width: 450,<br>                  height: 250,<br>                  decoration: BoxDecoration(<br>                      color: Colors.grey.withOpacity(0.1),<br>                      borderRadius:<br>                          const BorderRadius.all(Radius.circular(25))),<br>                ),<br>              ),<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><h3>Step3</h3><p>To enhance the design, add a positioned widget with a circular shape and a gradient color at a specific position.</p><pre>import &#39;dart:ui&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br><br><br>class HomeScreen extends StatelessWidget {<br>  const HomeScreen({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xff1C1760),<br>      body: Stack(<br>        children: [<br>          Positioned(<br>              top: 130,<br>              left: 220,<br>              child: Container(<br>                width: 300,<br>                height: 300,<br>                decoration: const BoxDecoration(<br>                    shape: BoxShape.circle,<br>                    gradient: LinearGradient(colors: [<br>                      Color(0xff744ff9),<br>                      Color(0xff8369de),<br>                      Color(0xff8da0cb)<br>                    ])),<br>              )),<br>          Center(<br>            child: ClipRRect(<br>              borderRadius: const BorderRadius.all(Radius.circular(25)),<br>              child: BackdropFilter(<br>                filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),<br>                child: Container(<br>                  width: 450,<br>                  height: 250,<br>                  decoration: BoxDecoration(<br>                      color: Colors.grey.withOpacity(0.1),<br>                      borderRadius:<br>                          const BorderRadius.all(Radius.circular(25))),<br>                ),<br>              ),<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><p>Duplicate the circular widget, change its size and position, and wrap it with a Transform widget to rotate it. To fix the color gradient issue, wrap the second container with the Transform.rotate widget.</p><pre>import &#39;dart:ui&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br><br>class HomeScreen extends StatelessWidget {<br>  const HomeScreen({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xff1C1760),<br>      body: Stack(<br>        children: [<br>          Positioned(<br>              top: 130,<br>              left: 220,<br>              child: Container(<br>                width: 300,<br>                height: 300,<br>                decoration: const BoxDecoration(<br>                    shape: BoxShape.circle,<br>                    gradient: LinearGradient(colors: [<br>                      Color(0xff744ff9),<br>                      Color(0xff8369de),<br>                      Color(0xff8da0cb)<br>                    ])),<br>              )),<br>          Positioned(<br>              bottom: 250,<br>              right: 150,<br>              child: Transform.rotate(<br>                angle: 8,<br>                child: Container(<br>                  width: 180,<br>                  height: 180,<br>                  decoration: const BoxDecoration(<br>                      shape: BoxShape.circle,<br>                      gradient: LinearGradient(colors: [<br>                        Color(0xff744ff9),<br>                        Color(0xff8369de),<br>                        Color(0xff8da0cb)<br>                      ])),<br>                ),<br>              )),<br>          Center(<br>            child: ClipRRect(<br>              borderRadius: const BorderRadius.all(Radius.circular(25)),<br>              child: BackdropFilter(<br>                filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),<br>                child: Container(<br>                  width: 450,<br>                  height: 250,<br>                  decoration: BoxDecoration(<br>                      color: Colors.grey.withOpacity(0.1),<br>                      borderRadius:<br>                          const BorderRadius.all(Radius.circular(25))),<br>                ),<br>              ),<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*eXugwy-mb5tQ2uBsViOmZQ.png" /></figure><h3>Step4</h3><p>Incorporate card details into the design. Add the SVG package and use the SvgPicture.asset widget to display SVG images. Style the text and position the elements accordingly.</p><pre>import &#39;dart:ui&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_svg/svg.dart&#39;;<br><br>class HomeScreen extends StatelessWidget {<br>  const HomeScreen({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xff1C1760),<br>      body: Stack(<br>        children: [<br>          Positioned(<br>              top: 130,<br>              left: 220,<br>              child: Container(<br>                width: 300,<br>                height: 300,<br>                decoration: const BoxDecoration(<br>                    shape: BoxShape.circle,<br>                    gradient: LinearGradient(colors: [<br>                      Color(0xff744ff9),<br>                      Color(0xff8369de),<br>                      Color(0xff8da0cb)<br>                    ])),<br>              )),<br>          Positioned(<br>              bottom: 250,<br>              right: 150,<br>              child: Transform.rotate(<br>                angle: 8,<br>                child: Container(<br>                  width: 180,<br>                  height: 180,<br>                  decoration: const BoxDecoration(<br>                      shape: BoxShape.circle,<br>                      gradient: LinearGradient(colors: [<br>                        Color(0xff744ff9),<br>                        Color(0xff8369de),<br>                        Color(0xff8da0cb)<br>                      ])),<br>                ),<br>              )),<br>          Center(<br>            child: ClipRRect(<br>              borderRadius: const BorderRadius.all(Radius.circular(25)),<br>              child: BackdropFilter(<br>                filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),<br>                child: Container(<br>                  width: 450,<br>                  height: 250,<br>                  decoration: BoxDecoration(<br>                      color: Colors.grey.withOpacity(0.1),<br>                      border: Border.all(<br>                          color: Colors.white.withOpacity(0.2), width: 2.5),<br>                      borderRadius:<br>                          const BorderRadius.all(Radius.circular(25))),<br>                  child: Padding(<br>                    padding: const EdgeInsets.fromLTRB(25, 10, 25, 30),<br>                    child: Column(<br>                        crossAxisAlignment: CrossAxisAlignment.start,<br>                        children: [<br>                          Row(<br>                            mainAxisAlignment: MainAxisAlignment.spaceBetween,<br>                            crossAxisAlignment: CrossAxisAlignment.start,<br>                            children: [<br>                              Container(<br>                                  margin: const EdgeInsets.only(top: 40),<br>                                  child: Image.asset(<br>                                    &#39;assets/h.png&#39;,<br>                                    width: 70,<br>                                    height: 70,<br>                                  )),<br>                              SvgPicture.asset(<br>                                &#39;assets/visa.svg&#39;,<br>                                color: Colors.white,<br>                                width: 60,<br>                              ),<br>                            ],<br>                          ),<br>                          const SizedBox(<br>                            height: 10,<br>                          ),<br>                          const Expanded(<br>                            child: Text(<br>                              &#39;6216 6102 0001 6587 010&#39;,<br>                              style: TextStyle(<br>                                  color: Colors.white,<br>                                  fontSize: 25,<br>                                  fontWeight: FontWeight.w100,<br>                                  wordSpacing: 3),<br>                            ),<br>                          ),<br>                          const Row(<br>                            mainAxisAlignment: MainAxisAlignment.spaceBetween,<br>                            children: [<br>                              Text(<br>                                &#39;02/12&#39;,<br>                                style: TextStyle(<br>                                    fontSize: 15, color: Colors.white),<br>                              ),<br>                              Text(<br>                                &#39;GZX&#39;,<br>                                style: TextStyle(<br>                                    fontSize: 15, color: Colors.white),<br>                              )<br>                            ],<br>                          )<br>                        ]),<br>                  ),<br>                ),<br>              ),<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*ZFcFCBJLFjLJUYRfmJvgRw.png" /></figure><p>Additionally, create a container in the corner of the design using the Positioned widget.</p><pre>import &#39;dart:ui&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_svg/svg.dart&#39;;<br><br>class HomeScreen extends StatelessWidget {<br>  const HomeScreen({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xff1C1760),<br>      body: Stack(<br>        children: [<br>          Positioned(<br>              left: -220,<br>              bottom: -200,<br>              child: Container(<br>                width: 400,<br>                height: 400,<br>                decoration: BoxDecoration(<br>                    shape: BoxShape.circle,<br>                    color: const Color(0xff8369de).withOpacity(0.1),<br>                    boxShadow: const [<br>                      BoxShadow(<br>                        color: Color(0xff8369de),<br>                        spreadRadius: 90,<br>                        blurRadius: 100,<br>                      )<br>                    ]),<br>              )),<br>          Positioned(<br>              top: 130,<br>              left: 220,<br>              child: Container(<br>                width: 300,<br>                height: 300,<br>                decoration: const BoxDecoration(<br>                    shape: BoxShape.circle,<br>                    gradient: LinearGradient(colors: [<br>                      Color(0xff744ff9),<br>                      Color(0xff8369de),<br>                      Color(0xff8da0cb)<br>                    ])),<br>              )),<br>          Positioned(<br>              bottom: 250,<br>              right: 150,<br>              child: Transform.rotate(<br>                angle: 8,<br>                child: Container(<br>                  width: 180,<br>                  height: 180,<br>                  decoration: const BoxDecoration(<br>                      shape: BoxShape.circle,<br>                      gradient: LinearGradient(colors: [<br>                        Color(0xff744ff9),<br>                        Color(0xff8369de),<br>                        Color(0xff8da0cb)<br>                      ])),<br>                ),<br>              )),<br>          Center(<br>            child: ClipRRect(<br>              borderRadius: const BorderRadius.all(Radius.circular(25)),<br>              child: BackdropFilter(<br>                filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),<br>                child: Container(<br>                  width: 450,<br>                  height: 250,<br>                  decoration: BoxDecoration(<br>                      color: Colors.grey.withOpacity(0.1),<br>                      border: Border.all(<br>                          color: Colors.white.withOpacity(0.2), width: 2.5),<br>                      borderRadius:<br>                          const BorderRadius.all(Radius.circular(25))),<br>                  child: Padding(<br>                    padding: const EdgeInsets.fromLTRB(25, 10, 25, 30),<br>                    child: Column(<br>                        crossAxisAlignment: CrossAxisAlignment.start,<br>                        children: [<br>                          Row(<br>                            mainAxisAlignment: MainAxisAlignment.spaceBetween,<br>                            crossAxisAlignment: CrossAxisAlignment.start,<br>                            children: [<br>                              Container(<br>                                  margin: const EdgeInsets.only(top: 40),<br>                                  child: Image.asset(<br>                                    &#39;assets/h.png&#39;,<br>                                    width: 70,<br>                                    height: 70,<br>                                  )),<br>                              SvgPicture.asset(<br>                                &#39;assets/visa.svg&#39;,<br>                                color: Colors.white,<br>                                width: 60,<br>                              ),<br>                            ],<br>                          ),<br>                          const SizedBox(<br>                            height: 10,<br>                          ),<br>                          const Expanded(<br>                            child: Text(<br>                              &#39;6216 6102 0001 6587 010&#39;,<br>                              style: TextStyle(<br>                                  color: Colors.white,<br>                                  fontSize: 25,<br>                                  fontWeight: FontWeight.w100,<br>                                  wordSpacing: 3),<br>                            ),<br>                          ),<br>                          const Row(<br>                            mainAxisAlignment: MainAxisAlignment.spaceBetween,<br>                            children: [<br>                              Text(<br>                                &#39;02/12&#39;,<br>                                style: TextStyle(<br>                                    fontSize: 15, color: Colors.white),<br>                              ),<br>                              Text(<br>                                &#39;GZX&#39;,<br>                                style: TextStyle(<br>                                    fontSize: 15, color: Colors.white),<br>                              )<br>                            ],<br>                          )<br>                        ]),<br>                  ),<br>                ),<br>              ),<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><p>By following these steps, you’ll create a stunning glass effect in your Flutter UI. Feel free to download the assets files and the complete source code from my <a href="https://github.com/mmohammadmfallahm02/glass_effects_design">GitHub </a>repository to have a closer look. I hope you enjoyed it and it was useful for you.</p><p>Let’s see the result!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*KRZQZtVTZHO25WzoyDtdKg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c831ab9c3d04" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>