Adding content to 110-advanced-dart

pull/3389/head
syedmouaazfarrukh 2 years ago
parent c6c52b7087
commit f582a5fbda
  1. 3
      src/roadmaps/flutter/content/110-advanced-dart/100-core-libraries.md
  2. 17
      src/roadmaps/flutter/content/110-advanced-dart/101-lists.md
  3. 17
      src/roadmaps/flutter/content/110-advanced-dart/102-collections.md
  4. 18
      src/roadmaps/flutter/content/110-advanced-dart/103-lambdas.md
  5. 15
      src/roadmaps/flutter/content/110-advanced-dart/104-functional-programming.md
  6. 16
      src/roadmaps/flutter/content/110-advanced-dart/105-isolates.md
  7. 14
      src/roadmaps/flutter/content/110-advanced-dart/106-async-await.md
  8. 8
      src/roadmaps/flutter/content/110-advanced-dart/107-streams.md
  9. 14
      src/roadmaps/flutter/content/110-advanced-dart/108-futures.md
  10. 21
      src/roadmaps/flutter/content/110-advanced-dart/index.md

@ -1,7 +1,8 @@
# Core libraries
# Core Libraries
Dart has a rich set of core libraries that provide essentials for many everyday programming tasks such as working on collections of objects (dart:collection), making calculations (dart:math), and encoding/decoding data (dart:convert).
Visit the following resources to learn more:
- [Core libraries](https://dart.dev/guides/libraries)
- [Libraries](https://api.flutter.dev/)

@ -1 +1,16 @@
# Lists
# Lists
Some common ways to display lists in Dart Flutter include:
- ListView widget
- ListTile widget
- SingleChildScrollView with Column
- GridView widget
- CustomScrollView with Slivers
These widgets allow you to display items in a scrolling list, a grid, or a combination of both. You can customize the appearance of each item using widgets, layouts, and styling.
Learn more from the following:
- [List Class](https://api.flutter.dev/flutter/dart-core/List-class.html)
- [Dart Programming – List](https://www.geeksforgeeks.org/dart-programming-list/)

@ -1 +1,16 @@
# Collections
# Collections
In Dart, collections are used to store and manipulate groups of objects. There are several types of collections available, including:
1. List (ordered and indexable)
2. Set (unordered and unique elements)
3. Map (key-value pairs)
4. Queue (ordered and first-in-first-out)
5. Stack (ordered and last-in-first-out)
These collections are built-in data structures that can be used to store and manipulate data efficiently. They can be used in a variety of scenarios, such as storing user data, managing state, and organizing algorithms.
Learn more from the following:
- [Generic collections in Flutter](https://dart.dev/guides/language/language-tour#generic-collections-and-the-types-they-contain)
- [Iterable collections](https://dart.dev/codelabs/iterables)

@ -1 +1,17 @@
# Lambdas
# Lambdas
Lambdas, also known as anonymous functions, are a fundamental concept in Dart and Flutter. They are a way to create short, inline functions that can be passed as arguments to other functions or assigned to variables.
Here are some common use cases for lambdas in Dart Flutter:
- Event Handlers: You can use lambdas as event handlers for widgets, such as buttons.
- Callbacks: You can use lambdas as callbacks to pass into functions that execute later.
- Streams: You can use lambdas to handle events in a Stream.
- Filtering: You can use lambdas to filter data in a collection using functions like where and `firstWhere`.
Lambdas are defined using the `=>` operator and can take zero or more arguments. They can also contain expressions, statements, and return values.
Learn more from the following links:
- [Lambda functions in Dart](https://medium.com/jay-tillu/lambda-functions-in-dart-7db8b759f07a)
- [Anonymous Function in Dart | Lambda Function](https://www.youtube.com/watch?v=XTKKQdTAR0U)

@ -1 +1,14 @@
# Functional programming
# Functional Programming
Functional programming is a programming paradigm that emphasizes immutability, statelessness, and the use of functions to transform data. Dart, being a modern programming language, supports functional programming concepts such as:
- Higher-Order Functions: Dart supports functions that take other functions as arguments and/or return functions as output.
- Immutable Data: Dart provides support for immutable data structures and encourages the use of these data structures in functional programming.
- Lambdas/Closures: Dart has support for anonymous functions, also known as lambdas or closures, which can be used to create simple and concise functions.
- Pure Functions: Dart encourages the use of pure functions, which are functions that have no side effects and always return the same output given the same inputs.
Learn more from the following links:
- [Brief Overview of Functional Programming](https://buildflutter.com/functional-programming-with-flutter/)
- [Functional Programming in Dart & Flutter](https://yogi-6.medium.com/list/functional-programming-in-dart-flutter-2f3ac9d7fa39)
- [Functional programming - Flutter](https://docs.flutter.dev/resources/faq)

@ -1 +1,15 @@
# Isolates
# Isolates
Isolates in Flutter are separate execution contexts that run in parallel with each other. They are used to improve performance and concurrency in Flutter applications. Key benefits of using Isolates in Flutter include:
- Improved Performance: Isolates allow you to run intensive computations or blocking operations in the background, without freezing the user interface.
- Concurrent Execution: Isolates provide a way to run multiple tasks concurrently, allowing you to improve the overall performance of your app.
- Isolation: Each Isolate runs in its own memory space and is isolated from other Isolates. This makes it easier to write reliable and secure code.
- Communication: Flutter provides a mechanism for communicating between Isolates, allowing them to share data and coordinate their work.
Isolates are created using the `Isolate` class and can be used for a variety of tasks, such as network operations, long-running computations, or background tasks. When using Isolates, it's important to be mindful of the cost of context-switching and communication between Isolates.
Learn more from the following links:
- [How isolates work](https://dart.dev/guides/language/concurrency#how-isolates-work)
- [Dart - Isolates and event loops](https://medium.com/dartlang/dart-asynchronous-programming-isolates-and-event-loops-bffc3e296a6a)

@ -1 +1,13 @@
# Async await
# Async Await
It is a programming pattern in Flutter that makes it easier to write asynchronous code. It allows you to write asynchronous code that looks and behaves like synchronous code.
- **async**: The async keyword is used to mark a function as asynchronous, which means that the function can run asynchronously and not block the main thread.
- **await**: The await keyword is used inside an async function to wait for the result of an asynchronous operation before continuing the execution of the function.
With `async`/`await`, you can write asynchronous code that is easy to read, write, and maintain.
Learn more from the following resources:
- [Asynchronous programming: async, await](https://dart.dev/codelabs/async-await)
- [Async widgets](https://docs.flutter.dev/development/ui/widgets/async)

@ -1 +1,7 @@
# Streams
# Streams
Streams in Flutter are a way to receive data over time as it becomes available. They are similar to observables in other languages and frameworks. Streams can be used for things like getting real-time updates from a server, or listening for changes in user input. In Flutter, streams are represented by the `Stream` class and can be listened to using the `StreamBuilder` widget.
Learn more from the following resources:
- [Creating streams in Dart](https://dart.dev/articles/libraries/creating-streams)

@ -1 +1,13 @@
# Futures
# Futures
Futures in Flutter are a way of representing a potential value that will be available at some point in the future. Some key points about Futures in Flutter:
- Futures are used for asynchronous programming in Flutter
- Futures return a single value (or an error) and are often used with `async` and `await`.
- The `then` method can be used to attach a callback to a Future that will be executed once the Future's value is available
- Futures can be combined with other Futures using `Future.wait` or `Future.whenComplete` methods
- Futures are often used with network requests, file I/O operations, and other long-running tasks in Flutter.
Learn more from the following resources:
- [Futures and Error handling](https://dart.dev/guides/libraries/futures-error-handling)

@ -1 +1,20 @@
# Advanced dart
# Advanced Dart
Here are some advanced concepts in Dart that are commonly used in Flutter development:
- Generics: allows creating reusable code by abstracting over types
- Async/Await: simplifies asynchronous programming by allowing to wait for a Future to complete in a clean, readable way.
- Mixins: lets classes inherit behaviors from multiple mixin classes
- Abstract Classes: provide a base class that can be extended to create multiple concrete implementations.
- Streams: provide a way to receive a continuous sequence of events, like data from a server or user events.
- Isolates: allow running Dart code in separate threads with communication through message passing.
- Futures: represent a value that will be available at some point in the future.
- Null-aware operators (??, ?.): provide a concise way to handle null values.
- Collection literals: provide concise syntax for creating collections.
- Extension Methods: allow adding methods to existing classes, even if you don't have access to their source code.
By mastering these concepts, you will be able to write more efficient and maintainable Dart code in your Flutter projects.
Learn more from the following resources:
- [Tutorials - Dart](https://dart.dev/tutorials)
Loading…
Cancel
Save