Vladimir Romashkin💙 Profile picture
Sep 2, 2021 21 tweets 24 min read Read on X
#Flutter #Dart #CSS
CSS vs Flutter.
How to embed CSS examples in the text widget.
My success story.
Of course, you can find 15 awesome examples below.
🧵👇 Image
1 #Flutter #Dart #CSS
When I found an example, I thought, why not?
Shadows in CSS has this syntax:
// text-shadow: [horizontal offset] [vertical offset] [blur radius] [color];
// text-shadow: 0 2px 1px #747474,
// rgbo: 0px -4px 10px rgba(255,255,255,0.3);
2 #Flutter #Dart #CSS
Each shadow in the Text widget has 5 lines of code.
Shadow(
color: Color(0xFFFFFFFF),
offset: Offset(1.0, 1.0),
blurRadius: 1.0,
),
It's all good, but I broke my head when I found the example with 26 shadows.
WTF... 🤯🤯🤯
3 #Flutter #Dart #CSS
I crashed my computer and said my life is in total lockdown.
26 * 5 = 130 lines of code for each complex shadow?
I looked at the shadow's source code and thought I could write my own one-line widget.
4 #Flutter #Dart #CSS
The widget has two constructors for different hex and RGBO color declarations.
O - opacity.
A - alfa channel. It's opacity too.
I wrote my widget.
Now, under each line of CSS text-shadow, I could write one line of CSSTextShadow widget with the same syntax ImageImage
5 #Flutter #Dart #css
The shadow from this example:
codepen.io/aakhya/pen/pQW…
Shadow 1. ImageImage
6 #Flutter #Dart #css
The shadows in the fluter have stack behavior.
Therefore, sometimes they must be used in reverse order.
But what came out in the usual order looks interesting, too.
Source: codepen.io/aakhya/pen/ZmX…
Shadow 2. ImageImage
10 #Flutter #Dart #css
Sometimes there will be problems with the inner shadows in the fluter. That's why I modified the code a little bit.
Shadow 6. ImageImage
11 #Flutter #Dart #css
Shadow 7. ImageImage
12 #Flutter #Dart #css
Source: codepen.io/aakhya/pen/ZmX…
I modified the code a little bit.
Shadow 8. ImageImage
13 #Flutter #Dart #css
Source: codepen.io/aakhya/pen/KrX…
I modified the code a little bit.
Shadow 9. ImageImage
14 #Flutter #Dart #css
Source: codepen.io/aakhya/pen/MzE…
For this example, you have to specify the shadows in reverse order.
Shadow 10. ImageImage
15 #Flutter #Dart #css
I wrote my implementation of this example:
codepen.io/aakhya/pen/VVM…
For this example, you have to specify the shadows in reverse order.
Shadow 11.
Rainbow. ImageImage
16 #Flutter #Dart #css
Source: codepen.io/aakhya/pen/Oax…
I modified the blur a little bit.
Shadow 12. ImageImage
17 #Flutter #Dart #css
Source: codepen.io/aakhya/pen/pQW…
For this effect, you need to make the main color completely transparent.
Shadow 13. ImageImage
19 #Flutter #Dart #css
Shadow 15. ImageImage
20 #Flutter #Dart #css
If you love Flutter and CSS, follow me and get smarter.
twitter.com/intent/follow?…

Retweet and like this tweet.
Source code on GitHub 👇
github.com/fladago/Flutte…
You can copy the repository with the command:
git clone github.com/fladago/Flutte…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Vladimir Romashkin💙

Vladimir Romashkin💙 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @romashkin_dev

Sep 4, 2021
The best books for app development with #Dart and #Flutter.
English, German, Russian, Italian, French
1
Dart Apprentice by Jonathan Sande @Suragch1 & Matt Galloway @mattjgalloway
Published by raywenderlich.com @rwenderlich
Version: First Edition
Language: Dart 2.12.2
Editor: VS Code 1.54
English | 2021 | ISBN: 978-1950325320 | 295 Pages
raywenderlich.com/books/dart-app…
2
Flutter Cookbook by Simone Alessandria (github.com/simoales), Brian Kayfitz @bkayfitz
English | 2021 | ISBN: 9781838823382 | 646 Pages
Publication date: June 2021
Publisher Packt @PacktPub
packtpub.com/product/flutte…
Read 31 tweets
Aug 29, 2021
#Flutter #Dart #CSS
CSS vs Flutter.
Flutter the containers with shadows.
How to create BoxShadow with CSS box-shadow?
21 amazing containers with CSS box-shadow in Flutter for the next app.
🧵👇
1⃣ #CSS vs #Flutter
CSS box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
2⃣ #CSS vs #Flutter
CSS box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
Read 23 tweets
Aug 20, 2021
Let's study #Flutter.
How to remember new buttons in Flutter?
Old RaisedButton >>> ElevatedButton
Old FlatButton >>> TextButton
Old OutlinedButton >>> OutlinedButton
Three examples below & in DartPad🧵👇
1
ElevatedButton(
onPressed: () {},
child: const Text('ElevatedButton'),
style: ElevatedButton.styleFrom(
primary: Colors.yellow, //background button color
onPrimary: Colors.green, //text color
),
),
2
TextButton(
onPressed: () {},
child: const Text('TextButton'),
style: TextButton.styleFrom(
backgroundColor: Colors.yellow,
primary: Colors.deepOrangeAccent,
padding: const EdgeInsets.all(10),
),
),
Read 5 tweets
Aug 20, 2021
#flutter
Let's study #Dart.
final, const & late in 3+ steps.
🧵👇
1/1
What is the difference between final and const?
A constant variable must be initialized at the time of declaration. It's a compile-time constant. A final variable can be initialized later, but only once when the first time it’s used.
1/2
void main() {
final int x;
const int y = 1;
x = 8; // ok
y = 2; // error: Constant variables can't be assigned a value.
x = 9; // error: The final variable 'a' can only be set once.
}
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(