Small introduction
After the holiday break (this was in January), I decided to work a little as an Android developer on a half-time basis in order to combine work and study.
Back in December, I met the chief programmer of an IT company based in Sochi.
I will not disclose the name of the company for purposes of corporate secrecy, this is not the point. The company is quite young and therefore uses newer technologies. I was surprised when I was told that they needed a Flutter developer, not Java / Kotlin.
That's how I got to know Flutter.
First impressions
I was completely amazed when I first saw the generated mobile app project in Flutter. Everything was completely different from the usual native Android development.
The first thing that caught my eye was a completely different language, Dart.
I immediately began to study this section and found out that Flutter is a Framework with a declarative style of writing UI.
I have never understood this style of coding. Sometime in the past, I decided to master React JS, but I could not get over it and gave up (mainly due to stupidity and laziness). Why declarative programming style at all? There is an intuitively imperative one: created a button object, added it to a parent element, etc.
When I became interested in Flutter, I realized and understood the main advantages of this approach:
Less code
Intuitive
Accelerated development
Power
. .
, , UI , Android Studio:
Scaffold(
appBar: AppBar(
title: Text("Counter App"),
),
body: Center(child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("You have pushed the button this many times: "),
SizedBox(height: 10),
Text("$counter",
style: Theme.of(context).textTheme.headline4,
)
],
),),
floatingActionButton: FloatingActionButton(
onPressed: () { setState(() => counter = counter + 1); },
child: Icon(Icons.add),
),
);
: , )))
: , - , UI
: . UI .
, Dart : , , UI .
. Flutter , , Java / Kotlin - 100% ( ).
, , : , .
flutter.dev, .
, sqlite Android iOS - sqflite.
, (pub-) pubspec.yaml, build.gradle (Android).
Dart ( Flutter) pub.dev
, Flutter Android iOS, .
C .
Dart. , Dart Tour
, - , UI (, ..). : , ..
Thread' (Java), Coroutines (Kotlin) Android
Flutter , :
fun getArticles() async {
final response = await http.get("https://xxx.ru/rest/getArticles");
final List<Article> articles = decodeArticles(response.body);
setState(() {
this.articles = articles;
});
}
Flutter , setState
.
setState
(Dart ) , .
setState
: , , Flutter . ( , Flutter , , , ).
Flutter - .
Flutter .
Flutter - ( ).
Flutter .
provider . .
Flutter
, Flutter - framework , , React Native .
Flutter.
Flutter :
UI framework, . Android , .. View ;
- .. Flutter , iOS Android, , :)
,
- Flutter , pub-, ). Flutter , Flutter Engage 2021
Flutter:
- , Flutter
-
The article is subjective and therefore I may be wrong in some, and maybe in all respects.
My main goal was to express my humble development experience in Flutter and share my opinion and some comments.
In the end, I would like to note that Flutter has all the necessary circumstances for future development and may even outgrow other approaches of cross-platform development (React Native), if not yet outgrown.
Useful links: