Flutter
Lộ trình phát triển toàn diện Flutter theo tiêu chuẩn quốc tế nilbuild/developer-roadmap
Hướng dẫn từng bước từ nền tảng đến chuyên sâu giúp bạn làm chủ Flutter. Tích hợp tài liệu lý thuyết, bài viết thực chiến, video tham khảo và bài tập lập trình trực tiếp trên IDE.
Nền Tảng & Khái Niệm Cốt Lõi
Giai đoạn 1 tập trung hoàn thiện 22 chủ đề then chốt.
Trees
A tree is a data structure that is used to represent the hierarchy of widgets in a Flutter app. The tree structure allows Flutter to manage the layout, styling, and behavior of the widgets in the app.
Advanced Dart
Advanced Dart concepts crucial for Flutter development include generics for reusable code, `async`/`await` for clean asynchronous operations, mixins for multiple inheritance, abstract classes for base implementations, streams for continuous event handling, isolates for parallel processing, futures for future value representation, null-aware operators for concise null handling, collection literals for efficient collection creation, and extension methods for adding functionality to existing classes, all contributing to more efficient and maintainable code.
Analytics
Analytics is a key aspect of understanding user behavior and measuring app performance for Flutter apps. There are a number of analytics tools available for Flutter apps, each with their own set of features and benefits.
Android Studio
Android Studio is the official integrated development environment for Android app development, built by Google on the JetBrains IntelliJ IDEA platform. It provides a comprehensive suite of tools for Flutter developers, including an advanced code editor, integrated debugging, performance profiling, and an emulator for testing applications. The environment includes the Flutter and Dart plugins, which enable seamless project management, hot reload support, and UI inspection tools directly within the workspace.
AnimatedBuilder
AnimatedBuilder is a widget in Flutter that allows you to build animations. It takes an `Animation` object and a builder function as input, and it returns a widget that is rebuilt whenever the animation changes. The builder function is called with the BuildContext and the animation object and it should return the widget that should be animated. This can be used to create complex animations with ease, without having to manage animation state or listen to animation events in the widget tree.
AnimatedWidget
AnimatedWidget is a Flutter widget that takes an `Animation` object as an argument and automatically updates whenever the animation changes. This can be useful when you want to create animations that are tightly coupled to a widget, for example, to animate the size or color of a widget. With `AnimatedWidget`, you can encapsulate the animation logic into a single widget and reuse it throughout your app. This makes it easier to manage and maintain your animations, as the animation code is centralized and decoupled from the widget tree.
Animation Controller
An Animation Controller is a special class in Flutter that manages the state of an animation by generating a sequence of values over a specific duration. It acts as the engine that drives an animation forward, backward, or stops it completely based on a range typically defined between 0.0 and 1.0. You use this controller to provide the necessary timing data to other animation objects, such as Tweens, which then transform those raw values into the specific properties required for your UI elements.
Animations
Flutter’s animation support makes it easy to implement a variety of animation types. Many widgets, especially Material widgets, come with the standard motion effects defined in their design spec, but it’s also possible to customize these effects.
AppStore
The App Store is Apple's platform for distributing iOS and iPadOS applications. Publishing a Flutter app there requires an Apple Developer account, app metadata, signing with certificates and provisioning profiles, and submitting the build for App Review before release.
Async Await
Flutter's `async`/`await` pattern simplifies asynchronous programming by enabling code that appears synchronous. The `async` keyword designates a function as asynchronous, allowing non-blocking execution, while `await` pauses execution until an asynchronous operation completes, resulting in cleaner and more maintainable asynchronous code.
Authentication
Firebase Authentication is a service provided by Firebase that allows you to easily add user authentication to your Flutter app. With Firebase Authentication, you can authenticate users using email and password, phone number, or popular identity providers like Google, Facebook, and more.
Dart Basics
Dart is an open-source, general-purpose, object-oriented programming language with C-style syntax developed by Google in 2011. The purpose of Dart programming is to create a frontend user interfaces for the web and mobile apps. It can also be used to build server and desktop applications.
BDD
Behavior-driven development (BDD) is a software development methodology that emphasizes collaboration between developers, testers, and stakeholders to define and verify the behavior of an application. BDD uses natural language to describe the expected behavior of the application and provides a shared understanding of the requirements for the development team.
Bitrise
Bitrise is a cloud-based continuous integration and delivery (CI/CD) platform that can be used with Flutter mobile app development. Bitrise provides a comprehensive suite of tools for automating the build, test, and deployment process for mobile apps, including apps built with Flutter. With Bitrise, developers can automate tasks such as building the app, running tests, and distributing the app to various app stores.
BloC
Bloc (Business Logic Component) is a state management pattern used in Flutter to separate presentation logic from business logic. It helps to manage and maintain the app state, making it easier to test, debug, and reuse code. It uses streams to emit new states and reacts to changes in the state.
Built-in Types
There are several built-in data types, including int, double, String, bool, List, Sets, and Map. Additionally, there are other complex data types like dynamic, var, and Object in Dart programming language, which are used in Flutter.
Change Notifier
Flutter's ChangeNotifier is a fundamental class for state management in Flutter. It allows developers to handle and notify listeners of data changes, ensuring efficient updates to the user interface. By extending ChangeNotifier, developers can create custom classes to represent specific states or data models. Integrating ChangeNotifier enhances the user experience by managing state and dynamically updating the UI. It simplifies state management and enables the creation of interactive Flutter applications.
CI/CD
CI/CD (Continuous Integration and Continuous Deployment) is a software development practice that helps to automate the process of building, testing, and deploying mobile apps, including Flutter apps. With CI/CD, developers can automate the build, test, and deployment process for their Flutter apps, making it easier to catch bugs and deploy new features quickly and efficiently.
Firebase Cloud Functions
Cloud Functions for Firebase is a serverless computing platform that simplifies backend development by allowing developers to write JavaScript or TypeScript code, which runs automatically in response to events from Firebase services or incoming HTTP requests. This framework leverages Google's cloud infrastructure to provide a scalable and managed environment, making it easier to build powerful serverless applications without the need for server maintenance.
Codemagic
Codemagic is a continuous integration and continuous delivery platform specifically designed to automate the build, test, and release process for Flutter applications. It integrates directly with your version control systems to trigger automated pipelines whenever code changes are pushed. This tool simplifies the deployment process by handling code signing, environment configuration, and distributing your app to the Apple App Store and Google Play Store automatically.
Collections
Dart provides built-in collections like Lists (ordered, indexed), Sets (unordered, unique), Maps (key-value pairs), Queues (FIFO), and Stacks (LIFO) for efficient data storage and manipulation, useful in various scenarios like data storage, state management, and algorithm implementation.
Control Flow Statements
Dart's control flow statements manage program execution: `if-else` for conditional logic, `for`, `while`, and `do-while` loops for repetition, `switch-case` for multi-way selection, and `break` and `continue` to alter loop behavior, enabling complex program logic.
Kỹ Năng Trọng Tâm & Thực Hành
Giai đoạn 2 tập trung hoàn thiện 22 chủ đề then chốt.
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).
Cupertino Widgets
Cupertino widgets are a set of Flutter widgets that mimic the look and feel of Apple's iOS user interface. They are designed to provide a consistent look and feel on both iOS and Android devices, and include widgets such as CupertinoButton, CupertinoAlertDialog, and CupertinoSlider. These widgets are useful for building cross-platform apps that need to conform to the iOS design aesthetic.s
CurvedAnimations
Curved animations in Flutter can be achieved using the "CurvedAnimation" class. This class takes in a "Curve" object that defines the rate of change of the animation over time. The most commonly used curve is the "Curves.easeInOut" curve, which starts slow, speeds up in the middle, and then slows down again towards the end.
DartPad
DartPad is an online tool that allows developers to write and run Dart code snippets. It can also be used to run Flutter code, making it a convenient way to try out Flutter apps and widgets without having to set up a full development environment.
Dependency Injection
Dependency Injection is a design pattern that allows objects to receive their dependencies from external sources instead of creating them internally. In Flutter, this can be useful for managing complex state, reducing coupling between components, and making testing easier.
Deployment
Deployment in Flutter refers to the process of releasing a Flutter app to end-users. Deploying a Flutter app involves a combination of technical skills and experience, as well as knowledge of the relevant app stores and their policies and requirements.
Design Patterns
Design patterns are solutions to common problems in software development that can be used to improve the quality and maintainability of your code.
Design Principles
Flutter development emphasizes design principles like Material Design, responsiveness, user-centeredness, simplicity, consistency, accessibility, and performance to create visually appealing and user-friendly applications that function seamlessly across various devices and cater to diverse user needs.
Dev Tools
Flutter DevTools is a suite of development tools provided by Flutter to help developers build, test, and debug Flutter apps.
Development Environment
The development environment consists of the collection of software tools, editors, and SDKs required to build, compile, and run applications. It typically includes the Flutter SDK, which provides the framework's core libraries and command-line tools, paired with a code editor like VS Code or Android Studio. These components work together to provide features such as code completion, real-time error checking, and integrated debugging to facilitate the translation of source code into functional software.
Fastlane
Fastlane is an open-source tool suite that automates the release process for mobile applications. It handles repetitive tasks such as generating screenshots, managing code signing identities, and deploying builds to the Apple App Store or Google Play Store. By integrating Fastlane into a Flutter project, developers can create streamlined pipelines that build and distribute apps with simple command-line instructions.
Firebase Analytics
Firebase Analytics is a free analytics tool provided by Google that helps to understand user behavior and measure app performance for mobile apps, including those built with Flutter. With Firebase Analytics, Flutter developers can track user interactions with their app, including page views, events, and user properties, and use this data to gain insights into user behavior. Firebase Analytics provides a range of tools and features for analyzing this data, including real-time dashboards, user segmentation, and funnels.
Firebase App Distribution
Firebase App Distribution is a service that allows developers to easily distribute pre-release versions of their applications to trusted testers. It provides a centralized dashboard where you can upload your Flutter build artifacts, such as APK or IPA files, and automatically notify testers via email once a new version is available. This tool streamlines the beta testing process by simplifying the delivery of builds and gathering feedback, ensuring that your application is stable before it reaches a production environment.
Firebase
Firebase is Google's mobile development platform that provides backend services like authentication, the Cloud Firestore database, cloud storage, and push notifications. The FlutterFire plugins integrate these services into Flutter apps, letting you add a backend without running your own servers.
Firestore
Firebase Firestore is a cloud-based NoSQL document database service provided by Firebase that makes it easy to store, manage, and retrieve data in your Flutter app. Firestore is a flexible, scalable, and easy-to-use database that allows you to store and retrieve data in the form of documents, collections, and fields.
Flutter CLI
Flutter CLI (Command Line Interface) is a command-line tool that is used to develop, build, and run Flutter applications. It provides a set of commands and tools that developers can use to create, test, and deploy Flutter apps from the terminal. Some of the common tasks that can be performed using the Flutter CLI include: * Creating a new Flutter project * Running Flutter app on a connected device or emulator * Building and deploying Flutter app to app stores * Updating the Flutter framework and packages * Analyzing the performance of Flutter apps
Flutter Inspector
It is a tool in the Flutter SDK that provides a visual representation of the widget tree in a Flutter app. It allows developers to inspect the widgets in their app, see the properties and styles applied to each widget, and interact with the app in real-time.
Flutter Internals
The internal workings of Flutter refer to the underlying mechanisms and architecture that make up the Flutter framework. Flutter is a reactive framework for building user interfaces, which means that it allows developers to build dynamic, responsive apps that update automatically in response to changes in the state of the app.
Flutter Outline
Flutter Outline is a feature in the Flutter development environment (IDE) that provides a tree-like representation of the widgets and elements in your Flutter app. It shows the hierarchy of the widgets, their relationships, and the structure of your app.
flutter pub / dart pub
`flutter pub` and `dart pub` are command-line tools used to manage dependencies in Flutter and Dart projects. These tools interact with the pub.dev package repository to download, update, and remove external libraries defined in a project's `pubspec.yaml` file. They facilitate the integration of third-party code, ensuring that all necessary project assets and version-specific dependencies are correctly installed and synchronized within the development environment.
Fonts
Fonts in Flutter are text styles used to define the visual appearance of characters within an application. You can incorporate custom typefaces by adding font files to your project assets and declaring them in the pubspec.yaml file. Once configured, these fonts can be applied globally through the theme or targeted specifically to individual text widgets to maintain a consistent brand identity throughout the interface.
Functional Programming
Dart supports functional programming through higher-order functions, immutable data structures, lambdas/closures, and pure functions, enabling developers to write code that emphasizes immutability, statelessness, and data transformation via functions.
Kiến Trúc Nâng Cao & Tối Ưu
Giai đoạn 3 tập trung hoàn thiện 22 chủ đề then chốt.
Functions
Dart is a true object-oriented language, so even functions are objects and have a type, Function. This means that functions can be assigned to variables or passed as arguments to other functions. You can also call an instance of a Dart class as if it were a function.
Futures
A Future represents a potential value or error that will be available at some time in the future. It is a core mechanism in Dart used for handling asynchronous operations, allowing a program to initiate a task and continue executing other code while waiting for the task to complete. When the operation finishes, the Future either provides the resulting data or communicates that an error occurred.
FVM (Flutter Version Manager)
Flutter version manager is a tool used to manage different versions of Flutter SDK on a developer's machine. Flutter is a popular open-source mobile application development framework, and its SDK is updated frequently with new features, bug fixes, and improvements. However, sometimes developers need to work with older versions of Flutter due to various reasons like compatibility issues or project requirements.
GetX
GetX is a lightweight and powerful solution for state management and navigation in Flutter. It provides a clean and simple API for managing app state and navigating between screens. GetX makes it easy to create scalable and maintainable apps, as it offers a central place to manage the app's state, reducing the amount of boilerplate code needed. It also provides out-of-the-box support for routing, making it easy to navigate between screens, and it supports hot reloading, which allows developers to see changes in real-time.
Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GitHub Actions
GitHub Actions is a workflow automation tool provided by GitHub that can be used to automate various tasks in a Flutter mobile app development process. With GitHub Actions, developers can create custom workflows to automate tasks such as building the app, running tests, and deploying the app to various app stores. These workflows are defined as a series of actions in a YAML file, which can be committed to the repository.
GitHub
GitHub is a web-based platform that provides hosting for software development and version control using Git. It is widely used by developers and organizations around the world to manage and collaborate on software projects.
Google Analytics
Google Analytics is a free web analytics service provided by Google that helps to understand user behavior and measure app performance for mobile apps, including those built with Flutter. With Google Analytics, Flutter developers can track user interactions with their app, including page views, events, and user properties, and use this data to gain insights into user behavior. Google Analytics provides a range of tools and features for analyzing this data, including real-time dashboards, user segmentation, and funnels.
GraphQL
GraphQL is a query language for your API that allows clients to request exactly the data they need, and nothing more. It was developed by Facebook and released as open source in 2015.
Deployment Guidelines & Protocols
Deployment guidelines and protocols in Flutter encompass the standardized procedures and best practices required to prepare, build, and release applications to app stores or internal distribution channels. This process involves configuring release builds with optimized assets, securing API keys, managing versioning, and adhering to platform-specific submission requirements for both the Apple App Store and Google Play Store. Following these protocols ensures that the application meets performance standards, security benchmarks, and the user interface requirements necessary for a successful public launch.
Hero Animations
Hero animations in Flutter refer to the motion that occurs when a widget transitions from one screen to another. By wrapping two widgets on different pages with a Hero widget and assigning them the same unique tag, the framework automatically animates the shared element across the screen transition. This creates a seamless visual connection that helps users maintain context as they navigate through the application.
Images
Images in Flutter are visual components used to display graphical content within an application's user interface. You can load these files from your project's local directory by declaring them in the pubspec.yaml file or fetch them directly from the network using a specific URL. The framework provides the Image widget, which handles the rendering, scaling, and alignment of these assets to ensure they display correctly across various device screen sizes.
Immutability
Immutability in Flutter refers to objects that cannot be changed once they are created. In Flutter, immutability is used to ensure that objects in the widget tree are not modified unexpectedly, which can lead to unexpected behavior and bugs in the app.
Inherited Widgets
Inherited widgets in Flutter are a powerful mechanism for efficiently propagating data down the widget tree. They essentially create a shared data scope that descendant widgets can access without needing to explicitly pass the data through constructors. When a widget needs to access data from an ancestor, it can simply look up the nearest inherited widget of the desired type.
Integration Testing
Integration tests in Flutter are tests that verify the behavior of your app as a whole, rather than individual widgets or functions. Integration tests allow you to test the interactions between different parts of your app and verify that the overall behavior of the app is correct.
IntelliJ IDEA
IntelliJ IDEA is a powerful Integrated Development Environment (IDE) created by JetBrains. Essentially, it's a software application that provides comprehensive facilities to computer programmers for software development.
Isolates
Flutter Isolates are parallel execution contexts that enhance performance and concurrency by running intensive tasks in the background, preventing UI freezes. They provide isolated memory spaces for reliable code, enable concurrent execution, and facilitate inter-isolate communication for data sharing and coordination, though developers must consider context-switching and communication overhead.
JSON Serialization and Deserialization
JSON serialization and deserialization is the process of converting Dart objects into JSON strings for network transmission and transforming JSON data received from an API back into usable Dart objects. In Flutter, this is typically handled by mapping data fields to class properties using the `json_serializable` package or by manually defining `fromJson` and `toJson` methods. This workflow ensures that raw data from web services is safely structured and type-checked before being used within an application.
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. Lambdas are defined using the `=>` operator and can take zero or more arguments. They can also contain expressions, statements, and return values.
Lists
Dart Flutter offers various widgets for displaying lists, including `ListView`, `ListTile`, `SingleChildScrollView` with `Column`, `GridView`, and `CustomScrollView` with `Slivers`, enabling scrolling lists, grids, and customized item appearances through widgets, layouts, and styling.
Material Widgets
Material Widgets are a collection of pre-built UI components in Flutter that follow the Material Design guidelines developed by Google. These widgets provide a standardized look and feel for applications, including common elements like buttons, cards, text fields, and navigation bars. They help developers create intuitive and visually consistent interfaces across different platforms by offering ready-to-use implementations of design patterns such as ripples, shadows, and transitions.
Memory Allocation
Memory allocation is the process of reserving a portion of the device's memory for the use of your app. The memory allocation in Flutter is managed by the Dart virtual machine, which uses a garbage collector to automatically manage the memory used by the app.
Hệ Sinh Thái & Triển Khai Thực Tế
Giai đoạn 4 tập trung hoàn thiện 22 chủ đề then chốt.
Mixpanel
Mixpanel is a product analytics platform that provides insights into user behavior for mobile apps, including those built with Flutter. With Mixpanel, Flutter developers can track user interactions with their app, including page views, events, and user properties, and use this data to gain insights into user behavior. Mixpanel provides a range of tools and features for analyzing this data, including real-time dashboards, segmentation, and A/B testing.
OOP
Object-oriented programming (OOP) is a programming paradigm that is based on the concept of "objects," which are instances of a class. In OOP, a class is a blueprint for creating objects, which have both data (attributes) and behavior (methods). The main idea behind OOP is to model real-world objects and their interactions, making it well-suited for creating complex and large-scale software systems.
Opacity
Opacity is a Flutter widget that allows you to control the transparency of its child widget. It takes a single opacity argument, which is a value between 0.0 and 1.0, where 0.0 represents complete transparency and 1.0 represents complete opacity. The child widget is drawn with the specified opacity, making it appear translucent or transparent, depending on the value of the opacity argument. This can be useful for creating visual effects such as fading in or out, or to create partially transparent backgrounds or overlays. By using Opacity in combination with other widgets and animations, you can create sophisticated visual effects in your Flutter app.
Operators
Flutter, and Dart, utilize various operators to manipulate data: arithmetic operators for math, relational operators for comparisons, logical operators for boolean logic, assignment operators for value assignment, and the ternary operator for concise conditional expressions, enabling diverse operations on values and variables.
Other File Types in Flutter
Flutter allows you to include various file types in your application beyond standard images, such as JSON files, configuration files, fonts, or raw text documents. These assets are bundled within the application package and made accessible to the code through the root bundle mechanism. By registering these files in the pubspec.yaml file, you can load their contents at runtime to handle data processing, localized strings, or custom binary information required by your app.
Package Manager
The package manager for Flutter is called pub. It is used to manage Flutter projects' dependencies and publish Flutter packages. It is included with the Flutter SDK and can be run from the command line using the `pub` command.
Playstore
The Google Play Store is an online store for Android apps, games, and other digital content. It is operated by Google and is the official app store for Android devices.
Provider
Provider is a wrapper around InheritedWidget (base class for widgets that efficiently propagate information down the tree) to make them easier to use and more reusable.
pub.dev
`pub.dev` is the official package repository for Dart and Flutter packages. It is a platform for hosting, managing, and distributing Dart packages and Flutter plugins. Developers can use `pub.dev` to search for packages, find information about packages, and install packages in their Flutter projects.
Push Notifications
Implementing Firebase push notifications in Flutter involves setting up a Firebase project, integrating the FCM plugin, handling and displaying incoming notifications within the app, testing through the Firebase Console or tools like Postman, and customizing notification appearance with icons, sounds, and vibration patterns.
Reactive Programming
Reactive programming is a programming paradigm that allows for handling changing data streams and updating the UI based on those changes. Reactive programming in Flutter helps create dynamic and responsive apps that can handle changing data and update the UI accordingly. The `StreamBuilder` and `FutureBuilder` widgets are commonly used in Flutter to build reactive UIs.
ReduX
Redux is a state management library for Flutter, commonly used with the Flutter framework to manage the application's state. It helps to maintain a single source of truth for the state of the application, making it easier to understand, test and maintain the code. In Redux, the state is stored in a store and can only be updated through dispatching actions. The actions trigger the update of the state via reducers, which are pure functions that determine the next state based on the current state and the dispatched action.
Remote Config
Firebase Remote Config, accessed in Flutter via the `firebase_remote_config` plugin, enables dynamic app behavior and appearance changes without app updates. This involves adding the plugin, initializing the service, defining default parameter values in the console or code, fetching and retrieving remote parameters, and updating those parameters either through the console or by activating fetched values, allowing for A/B testing and feature control.
Render Objects
RenderObject's can be defined as "Objects" that render and manipulate layouts, sizes and draw the UI, providing the actual application rendering. They clean up some resources when dispose method is called, therefore it must be disposed by creator when is no longer used.
Repo Hosting Services
Several popular repository hosting services, including GitHub, GitLab, Bitbucket, AWS CodeCommit, and Azure DevOps, support Flutter development by offering Git repository management, issue tracking, and collaboration tools. When selecting a service, developers should consider factors like project needs, scalability, cost, ease of use, integrations, and third-party tool support to ensure the chosen platform aligns with their specific requirements.
Responsive Widgets
Responsive widgets are specialized components in Flutter designed to adapt the layout and appearance of an application based on the size, orientation, or platform of the screen. These widgets utilize various builders and constraints to ensure that UI elements remain functional and visually consistent across mobile, tablet, and desktop devices. By implementing these tools, developers can create flexible interfaces that automatically adjust their structure to provide an optimal user experience on any display resolution.
REST
REST, or REpresentational State Transfer, is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other.
Riverpod
Riverpod was created by the same author as Provider, and is designed to make it easier to manage application state by providing a more intuitive API and better performance than Provider. One of the key features of Riverpod is its ability to manage and scope state in a more granular way than Provider. This can make it easier to reason about your application's state and can lead to more efficient re-renders.
RxDart
RxDart is a library for Dart that provides additional functionality for working with reactive programming, specifically with the Streams and Observables classes. It extends the standard Dart Streams API and provides additional features such as the ability to transform and combine streams, and to compose and chain streams together. In Flutter, RxDart is commonly used to handle asynchronous data streams and user interactions in a more efficient and elegant way.
Segment
Segment is an analytics platform that provides a single API for collecting, storing, and routing customer data from various sources, including mobile apps built with Flutter. With Segment, Flutter developers can easily add analytics tracking to their app, without having to integrate with multiple analytics tools individually. Segment acts as a single point of integration, allowing developers to send data to multiple analytics tools with a single API.
Shared Preferences
In Flutter, SharedPreferences is a plugin allowing you to store data in key-value pairs persistently. It is similar to a local database or cache, but it is specifically designed to store small pieces of data, such as user preferences or settings. The SharedPreferences plugin is often used to store simple pieces of data that need to be accessed by multiple screens or widgets in an app. For example, you might use SharedPreferences to store the user's login status or the app's theme color.
SOLID Principles
SOLID is a mnemonic acronym for five design principles intended to make object-oriented designs more understandable, flexible, and maintainable.
Chuyên Gia & Mở Rộng Hệ Thống
Giai đoạn 5 tập trung hoàn thiện 20 chủ đề then chốt.
SQLite
SQLite is an open-source, lightweight relational database management system (RDBMS) used to store and manage data. It is written in C and self-contained, meaning it does not require a separate server process or system. SQLite is commonly used in mobile applications, embedded systems, and web browsers and is also supported by many programming languages. It is a popular choice for databases because it is easy to use and does not require a lot of setup or configuration.
State Management
State management in Flutter refers to the process of managing and updating the data or state of a Flutter application. In Flutter, the state of the widgets can change dynamically, for example, when a user interacts with the application.
Stateful widgets
A stateful widget is dynamic: for example, it can change its appearance in response to events triggered by user interactions or when it receives data. Checkbox, Radio, Slider, InkWell, Form, and TextField are examples of stateful widgets.
Stateless Widgets
Stateless widgets in Flutter are widgets that don't maintain any mutable state. They are designed to be immutable and rebuild each time the framework needs to update the UI. They are suitable for static, unchanging views or simple animations. They can be created using the `StatelessWidget` class and have a single build method that returns a widget tree.
Storage in Flutter
Storage in Flutter refers to the various methods and solutions used to persist data locally on a device so that information remains available even after an application is closed or restarted. Developers choose from different storage options based on the complexity and volume of the data, ranging from simple key-value pairs for user preferences to structured local databases for managing extensive records. These storage mechanisms ensure that apps can provide a personalized experience and work efficiently while offline.
Storage
In Flutter, you can use Firebase Storage to store and retrieve binary data, such as images, audio files, and videos. Firebase Storage is a cloud-based storage service provided by Firebase that makes it easy to store and serve large binary data, such as images and videos, in your Flutter app. To use Firebase Storage in your Flutter app, you need to first create a Firebase project in the Firebase Console and then add the Firebase Storage package to your Flutter app.
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.
Styled Widgets
Styled widgets are a set of Flutter components designed to simplify the process of styling UI elements through method chaining. Instead of wrapping widgets in multiple parent containers like Padding, Align, or Container to adjust their appearance, you can directly call extension methods on the widget itself. This approach makes your code more readable, reduces the depth of the widget tree, and allows you to apply visual properties such as spacing, coloring, and positioning with minimal boilerplate.
TDD
Test-driven development (TDD) is a software development methodology in which tests are written before the implementation of the code they are testing. The idea behind TDD is to write a failing test first, then write just enough code to make the test pass, and then refactor the code if necessary. This process is repeated for each new feature or requirement that is added to the app.
Testing
Testing is a crucial part of the development process in Flutter, as it helps you to verify the behavior and appearance of your app and ensure that it behaves correctly and consistently across different devices and platforms.
Unit Testing
Unit testing in Flutter is the process of testing individual units of code, such as functions or classes, to ensure that they behave as expected. Unit testing helps to catch bugs early in the development process and increases the confidence in your code by making it easier to refactor or make changes without breaking existing functionality.
Value Notifier
Flutter's ValueNotifier is a lightweight tool for state management in Flutter. It efficiently handles a single value and notifies listeners of changes. With ValueNotifier, developers can easily track and update specific data, such as counters or user inputs. It simplifies state management and enables dynamic Flutter interfaces.
Variables
In Flutter, variables are used to store values. There are three types of variables in Flutter namely local, global and instance variables.Variables in Flutter can store values of different data types, such as numbers, strings, booleans, and more.
Version Control Systems
Version control systems allow you to track changes to your codebase/files over time. They allow you to go back to some previous version of the codebase without any issues. Also, they help in collaborating with people working on the same code – if you’ve ever collaborated with other people on a project, you might already know the frustration of copying and merging the changes from someone else into your codebase; version control systems allow you to get rid of this issue.
VS Code
VS Code is a lightweight but powerful code editor developed by Microsoft that provides comprehensive support for Flutter development. It includes a dedicated extension that offers essential features like code completion, syntax highlighting, and an integrated debugger to help developers build and test mobile applications efficiently. The editor also features a built-in terminal and a user-friendly interface for managing Flutter projects, packages, and device emulators.
Web Sockets
In addition to normal HTTP requests, you can connect to servers using WebSockets. Web sockets allows for bidirectional communication between a client (such as a web browser) and a server over a single, long-lived connection. They are a more efficient alternative to HTTP for providing real-time data, as they allow for the server to push data to the client as soon as it becomes available, rather than requiring the client to continuously poll the server for updates.
Widget Testing
Widget testing in Flutter is the process of testing the behavior and appearance of individual widgets, in isolation from the rest of your app. It allows you to verify that a widget works correctly, displays the expected output, and behaves correctly in response to user interactions.
Widgets
Widgets in Flutter are the basic building blocks of the user interface. They define how the UI looks and behaves. Widgets can be combined to create complex user interfaces and can be easily customized. Widgets in Flutter are also designed to be highly reusable, allowing developers to build complex UIs quickly and efficiently.
Working with APIs in Flutter
Working with APIs involves connecting your application to external servers to fetch, send, or update data. Flutter developers typically use the `http` or `dio` packages to perform asynchronous network requests, which allow the app to communicate with RESTful web services. These requests return data in formats like JSON, which are then parsed into Dart objects to be displayed within the user interface.
Working with Assets
Assets in Flutter are files that you bundle with your application, such as images, fonts, configuration files, or JSON data. You register these files in the `pubspec.yaml` file so the framework can include them in the final build. Once defined, you access these resources through the `AssetBundle` object, which provides methods to load the content for use within your widgets or logic.