Mobile Tech
1.16K subscribers
92 photos
8 videos
6 files
138 links
Michael Lazebny's blog about @dart and @flutter
lazebny.io
Download Telegram
Our top liked article of the week dives into reversing a character string in Dart. We'll explore the step-by-step process, covering methods such as 'Reverse Using Split and Join', 'Reverse Using Runes' and 'Reverse Using Code Units'. This invaluable guide, a hit amongst Flutter app developers, breaks down this process efficiently for any Dart framework.
https://medium.flutterdevs.com/reverse-a-string-in-dart-85d80216c890

#flutter #gpt #automated
1🥰1
The first in a series of articles on advanced flutter questions has just been published. At the moment, only Dart related questions are covered:

- Why is dart a perfect choice for flutter?
- What are the differences between const and final?
- Differences between local, static and global variables in Dart
- What is Dart VM?
- What is Dart Runtime?
- What are the Dart compilers?
- How does asynchrony work in Dart?
- What is the Await keyword?
- What about timers in Dart? How do I delay an operation?
- Is it possible to make the event loop hang? How do I fix it?

https://lazebny.io/flutter-advanced-one/
👍2🔥2
How do I unload an event loop in Dart? It is quite a common situation for us to have APIs like Future<List<T>>.

Imagine a method that returns a list of users. What you do there is parse the json into a dart list and then somehow convert it into a typed list of models. This conversion to models can be done lazily. Just change the API to Stream<T> and you will get the idea. You can put all the elements in the event loop to process them asynchronously.

Here is the link to the working flutter app, which gives you an example of how to do this:
https://gist.github.com/hawkkiller/932140079adfdcab2cfdd4b0292bb50a

#dart #flutter #async #eventloop #tip‍‍‍
👍2
Dive into the advanced topic of Flutter's factory constructors in this popular medium article of the week. Learn when to use them, how they differentiate from static methods, and understand their relevance in implementing singleton patterns, deserialization, subclass instantiation, and more for a more readable code.
https://itnext.io/dart-flutter-what-are-factory-constructors-advanced-knowledge-9770ef723394

#flutter #gpt #automated
👾2
In the second part of advanced questions I will cover these themes:

- Pattern matching
- Immutability
- Isolates, heap, isolate groups
- GC
- Errors & exceptions - differences and proper handling
- What is a widget, different types
- Inherited Widget, its implementation and advantages
- State lookup, find ancestor in the tree
- Keys: local, global
3👍2
What is the complexity of getting Inherited Widget?
Anonymous Quiz
69%
O(1)
28%
O(n)
3%
O(logN)
I'm introducing exciting polls on various topics, mainly about Dart & Flutter. I think you'll like it.
Today published a post about Dart GC. I wrote about the garbage collection process and the tricks it employs.
👍3
Global and static variables are lazy by default
Anonymous Quiz
50%
Yes
50%
No
👍3
🔥1
Mobile Tech
Photo
👍5
What is needed to override to compare objects in Dart?
Anonymous Quiz
79%
Both == an hashCode
14%
Only ==
6%
Only hashCode
👍2🤔1
👍3
What is the worst case time complexity of inserting into an array?
Anonymous Quiz
8%
O(1)
25%
O(logN)
67%
O(n)
👍2
Does ListView use slivers under the hood?
Anonymous Quiz
81%
Yes
19%
No
👍1
List of expected articles 🙂
Currently, I'm working on advanced questions and doc about sizzle starter.
🔥10
Does Dart support tail call optimisation?
Anonymous Quiz
58%
Yes
42%
No
👍3