Here is the code:
• Interactive blob that stretches, rotates, and scales with gestures.
• Customizable behavior for elastic scaling and distance.
• Built using CustomPainter and ClipPath.
https://github.com/meeziest/elastic_blob/tree/main
#github #code
• Interactive blob that stretches, rotates, and scales with gestures.
• Customizable behavior for elastic scaling and distance.
• Built using CustomPainter and ClipPath.
https://github.com/meeziest/elastic_blob/tree/main
#github #code
🔥8
I’ve noticed that many devs believe they can only deconstruct object classes and records starting from Dart 3. However, Dart’s pattern matching you can also deconstruct nested maps and lists.
This destructuring also works with complex nested data. For example, if your map contains other maps or complex data structures, you can easily unpack them.
Don’t forget to utilize this when needed to make your code more elegant.
#tip
Map patterns match values that implement Map, and then recursively match its subpatterns against the map's keys to destructure them
A list pattern matches values that implement List, and then recursively matches its subpatterns against the list's elements to destructure them by position
This destructuring also works with complex nested data. For example, if your map contains other maps or complex data structures, you can easily unpack them.
Don’t forget to utilize this when needed to make your code more elegant.
#tip
❤5😍4👍2
Media is too big
VIEW IN TELEGRAM
Recently, I decided to set myself a challenge: creating an animated solar system explorer. The app isn’t quite finished yet, but here is the progress.
In this project, I’m working on simulating planetary orbits, experimenting with animations, and refining proper zooming options with perspective transformations.
In this project, I’m working on simulating planetary orbits, experimenting with animations, and refining proper zooming options with perspective transformations.
🔥20🤯3
Dart&Flutter with mizu
Recently, I decided to set myself a challenge: creating an animated solar system explorer. The app isn’t quite finished yet, but here is the progress. In this project, I’m working on simulating planetary orbits, experimenting with animations, and refining…
If you’d like to track the progress and see the code behind it, here it is. And if you have any ideas or fixes for the project, I’m open to feedback! I’ll keep you updated as the app evolves.
https://github.com/meeziest/solar_system
#github #code
https://github.com/meeziest/solar_system
#github #code
🔥9❤🔥2
Dart&Flutter with mizu
Could you identify any potential issues? #interview #question
The problem is in Closures. Closures can unintentionally capture references to short-lived object (such as a BuildContext). In that case, it prevents the garbage collector from reclaiming that memory as long as the closure exists.
Capturing a BuildContext would prevent the context from being garbage collected, potentially leading to a memory leak if the closure outlives the widget's lifecycle.
Now, the next question is - How to prevent BuildContext not being garbage collected, without breaking the logic of printPrevRouteName?
#interview #question
Capturing a BuildContext would prevent the context from being garbage collected, potentially leading to a memory leak if the closure outlives the widget's lifecycle.
Now, the next question is - How to prevent BuildContext not being garbage collected, without breaking the logic of printPrevRouteName?
#interview #question
Dart&Flutter with mizu
The problem is in Closures. Closures can unintentionally capture references to short-lived object (such as a BuildContext). In that case, it prevents the garbage collector from reclaiming that memory as long as the closure exists. Capturing a BuildContext…
To avoid this issue - It’s better to avoid directly capturing context in the closure. Instead, you can use values that are safe for long-term storage.
In the solution provided above, capturing a long-lived object like ModalRoute is safe. ModalRoute is retrieved once and stored in a variable, which is then used inside the closure. Now, the handler closure no longer contains a reference to context, preventing a potential memory leak.
In the solution provided above, capturing a long-lived object like ModalRoute is safe. ModalRoute is retrieved once and stored in a variable, which is then used inside the closure. Now, the handler closure no longer contains a reference to context, preventing a potential memory leak.
I recently came across an interesting post about animation in Flutter – the RGB Split Distortion effect! This technique creates a mesmerizing distortion with an interactive visual flair that’s instantly eye-catching. The author used GLSL fragment shaders along with Flutter’s CustomPainter.
🤫 Link to the article: The Magical RGB Split Distortion Effect in Flutter
Please open Telegram to view this post
VIEW IN TELEGRAM
Medium
The Magical RGB Split Distortion Effect in Flutter
In this post 16 lines of code resulting in a stunning RGB Split Distortion effect and the integration in Flutter are explained.
🔥5
When importing icons into your Flutter app, it’s essential to consider visual alignment and icon's optical weight, not just technical centering. Icons are usually centered within their rectangular bounding box by default, but this often doesn’t look visually balanced within buttons.
Image 1: Default Centering
In this example, the icon is centered based on its bounding box. This is technically accurate, but it doesn’t look visually balanced. The triangle appears slightly off, creating a sense of imbalance within the button.
Image 2: Adjusted for Visual Balance
Here, we’ve adjusted the triangle’s position slightly to the right. This small offset makes the icon look more balanced within the circle, creating a better visual effect.
#ui
Image 1: Default Centering
In this example, the icon is centered based on its bounding box. This is technically accurate, but it doesn’t look visually balanced. The triangle appears slightly off, creating a sense of imbalance within the button.
Image 2: Adjusted for Visual Balance
Here, we’ve adjusted the triangle’s position slightly to the right. This small offset makes the icon look more balanced within the circle, creating a better visual effect.
#ui
👍4❤3
Dart&Flutter with mizu
When importing icons into your Flutter app, it’s essential to consider visual alignment and icon's optical weight, not just technical centering. Icons are usually centered within their rectangular bounding box by default, but this often doesn’t look visually…
How to align icon with optical weight within a button?
For example: A simple shape with symmetry, like a triangle for a “Play” button, is usually centered within a circle by designers. To achieve a balanced look, they align the circle itself according to the outer boundaries of its container. This careful positioning ensures the icon feels balanced within the button.
As a Flutter developer we can export the icon with correct positioning applied beforehand by designers. However, if the icon doesn’t have the proper positioning, we can use
This is called optical balance and takes into account the icon's optical weight within the button.
#ui
For example: A simple shape with symmetry, like a triangle for a “Play” button, is usually centered within a circle by designers. To achieve a balanced look, they align the circle itself according to the outer boundaries of its container. This careful positioning ensures the icon feels balanced within the button.
As a Flutter developer we can export the icon with correct positioning applied beforehand by designers. However, if the icon doesn’t have the proper positioning, we can use
Padding
widget or if you need more precise control over a complex shape icons, you can use Transform.translate
. Adjusting the position by a few pixels can often make the button feel more balanced, even if it’s technically off-center. This is called optical balance and takes into account the icon's optical weight within the button.
#ui
👍7🔥1
I just came across an insightful article on leveraging real-time frequency extraction in Flutter.
🤫 Check out the article here: Master Real-Time Frequency Extraction in Flutter to Elevate Your App Experience
Please open Telegram to view this post
VIEW IN TELEGRAM
Medium
Master Real-Time Frequency Extraction in Flutter to Elevate Your App Experience
Master real-time frequency extraction in Flutter and elevate your app’s experience with adaptive shaders similar to Apple Intelligence
👍7👀2
Please open Telegram to view this post
VIEW IN TELEGRAM
X (formerly Twitter)
Daniel Korpai (@danielkorpai) on X
Sticker Wall – Creating the holo effect in SwiftUI ✨
The holo effect is a linear gradient layer, which changes its offset values depending on the relative pitch position and its rotation depending on the relative roll position of the iPhone.
Here are the…
The holo effect is a linear gradient layer, which changes its offset values depending on the relative pitch position and its rotation depending on the relative roll position of the iPhone.
Here are the…
🔥6😱1
I really enjoyed this talk from apple on animating with springs! Especially the math part.
Animate with springs
In Flutter we have simular api which applies physics simulation to our widgets -> link
Animate with springs
In Flutter we have simular api which applies physics simulation to our widgets -> link
Apple Developer
Animate with springs - WWDC23 - Videos - Apple Developer
Discover how you can bring life to your app with animation! We'll show you how to create amazing animations when you take advantage of...
💯5
Stunning effect that uses hundreds of colorful particles that respond dynamically to touch, forming interactive experience.
https://x.com/philipcdavis/status/1562092691558735873
While this is iOS, animations like this can inspire developers across platforms. For Flutter devs, recreating something similar is totally doable with CustomPainter and animations. Imagine adding this to your next project😳
Btw, i have seen simular animation before with many particles but in Flutter written by PlugFox. Check out this Sunflower pattern -> https://dartpad.dev/?sample=sunflower
https://x.com/philipcdavis/status/1562092691558735873
While this is iOS, animations like this can inspire developers across platforms. For Flutter devs, recreating something similar is totally doable with CustomPainter and animations. Imagine adding this to your next project
Btw, i have seen simular animation before with many particles but in Flutter written by PlugFox. Check out this Sunflower pattern -> https://dartpad.dev/?sample=sunflower
Please open Telegram to view this post
VIEW IN TELEGRAM
X (formerly Twitter)
Philip Davis (@philipcdavis) on X
Here’s an animation for a color picker I made in SwiftUI
🔥3👍1
Just a heads up that I’ll soon be posting a Flutter version of this water wavy progress bar animation. Stay tuned if you’re interested in learning how to replicate this effect in your Flutter apps. I’ll share all the details with you soon! 😎
Please open Telegram to view this post
VIEW IN TELEGRAM
codepen.io
wavePercent
...
🐳10
Dart&Flutter with mizu
Just a heads up that I’ll soon be posting a Flutter version of this water wavy progress bar animation. Stay tuned if you’re interested in learning how to replicate this effect in your Flutter apps. I’ll share all the details with you soon! 😎
For more details-including the math, code and reasoning behind this effect, check out my Medium article:
Complex Animations in Flutter: Creating a Dynamic Circular Water-Ripple Progress Bar
#medium
Complex Animations in Flutter: Creating a Dynamic Circular Water-Ripple Progress Bar
#medium
Medium
Complex Animations in Flutter: Creating a Dynamic Circular Water-Ripple Progress Bar
I’ve come across some mesmerizing circular water-ripple animations on CodePen and was inspired to try implementing a similar effect in…
🔥5
I just hit 💯 subscribers! Thank you for your support and interest. There’s plenty more to come, so stick around for more tutorials, deep-dives, and creative projects in Flutter!
Please open Telegram to view this post
VIEW IN TELEGRAM
💯12
Dart&Flutter with mizu
For more details-including the math, code and reasoning behind this effect, check out my Medium article: Complex Animations in Flutter: Creating a Dynamic Circular Water-Ripple Progress Bar #medium
painter: Content drawn here appears beneath the child widget.
foregroundPainter: Content drawn here appears above the child widget.
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥5
Dart&Flutter with mizu
Here’s a quick preview of how it looks: #widget #animation
This media is not supported in your browser
VIEW IN TELEGRAM
Btw while writing this demo, I encountered unexpected repainting with multiple CustomPainters 🤨 . On the same page, there are multiple CustomPaint widgets, and the repainting of one of them (triggered by the paint() method of its CustomPainter instance) causes another widget to repaint.
If you face simular behavior you can temporarily solve this by wrapping the RepaintBoundary widget around to isolate the repainting area.
video example -> https://dartpad.dev/?id=7645ea5154a4bb24b5254f284cdbfb90
If you face simular behavior you can temporarily solve this by wrapping the RepaintBoundary widget around to isolate the repainting area.
video example -> https://dartpad.dev/?id=7645ea5154a4bb24b5254f284cdbfb90
Please open Telegram to view this post
VIEW IN TELEGRAM
🤨5😁2