#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.
🧵👇
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
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.
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.
#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.
🧵👇
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🧵👇
#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.
}