Flutter Learnings - Imtiaz211/interviews GitHub Wiki
Learning Flutter #18.11.2024
Chip Widget
- seedColor, primaryCOlor, inputDecorationTheme, "Theme.of", StateLessWidget, StatefullWidget, InheritedWidget,
Widget Liberary
16.11.2024Placeholder Widget,
- IconButton, InkWell, GestureDetector works like buttons.
- Container doesn't have elevation property
- BackdropFilter =
- ClipRRect =
- Align Widget for left, right alignment.
#15.11.2024
StatelessWidget can't run multiple of times, it run only one time. SatefullWidget is const type, hence we need to work with State.
initState()
didChangeDependencies()
didUpdateWidget()
13.11.2024
Information Widget
- Calendar, Watch and Weather app are called Information Widget.
- Home_widget,
28.10.2024
Adding costum fonts in flutter app.
27.10.2024
Flutter approach set of state management.
- setState :- simple and inbuilt, great for small application or individual widgets.
- InheritedWidget:- allow data to be shared across widgets tree, good for medium complexity scanario.
- Provider:-Based on IntegratedWidget but more flexiable and powerful, popular and easy to integrate.
- Riverpod:-An improvement over Provider with better comopile-time safety, offers more granular control and less boilerplate code.
- Bloc and Cubit:- Stands for Business logic component, Separate Business logic from UI; Uses streams, High resuability and testability.
- Redux:- Inspired by Redux from JavaScript, Centrilized state management, Predictable state management and time traveling(state history)
- GetX:- Simple syntax and less boilerplate, Offers state management, dependency injection and navigation.
- Mobx:- Reactive State Management, Easy to learn with clean predictable behaviour.
- ScopedModel:- Older approach, less popular now. based on IntegratedWidget for passing data down the widget tree.
26.10.2024
Tag, Drag and enter text
- Widgert Tester Library
- enterText()
- tap()
- drag()
- In the test environment, Flutter doesn't automatically rebuild widgets when the state changes.
State Management in Flutter
- Provider
- Getx
- block
- These statemanagement can work on StatelessWidget without using statefullwidgets.
The provider package is a popular state management solution for Flutter applications. It offers a flexible and efficient way to manage and share state across your app's components.
- Provider
- ChangeNotifier
- ValueNotifier
- StreamProvider
API Call Methods in Dart
- HTTP
- Dio
- chopper
The flutter popular database package
- Firebase
- sqlite
What is mixin:-> Multiple inheritances are not supported in Dart. Hence, you would need mixins to use multiple inheritance in Flutter,
Flutter architecture
- Flutter framework layer
- Engine Layer
- Playform Layer
Constructor in Flutter
- Named Constructor
- Standard Constructor
- factory Constructor.
- Widgets listing
- ListView Widget
- Container Widget
- MediaQuery Widget
- SizedBox widget
- Lifecycle of StatefullWidget.
- createState
- initState
- didChangeDependencies
- build
- didUpdateWidget
- setState
- deactivete
- dispose
- Widgets listing
Flutter and Dart Version
- Flutter 3.24
- Dart 3.5
- Choose your development platform to get started
- Windows
- macOS
- Linux
- ChromeOS
Flutter is an open-source UI software development kit developed by Google, widely popular among companies and developers.
- Flutter compiles the code to the native language.
- Startups can easily adopt Flutter and create MVP.
- Wide platform supports (Android, iOS, Windows, macOS, Linux, Embedded, more coming soon!)
- Great documentation and ample resources available to learn
- Large and supportive community!
- OpenSource!
Few concepts that you should learn
- Lists
- Map
- Lambda Function
- mixins => it offers similar functionality through extension and mixins in Dart.
- await and async
Once you complete the basic dart concepts, feel free to explore Flutter.
- API calls can be done using different packages available like http, dio, retrofit, chopper, etc.
- Databases are an integral part of any app
An AnimatedList needs a GlobalKey that keeps track of the widgets while they are being animated. Every time you make a change to the list, you need to update both the backing data list and the global key.
In Flutter, navigation from one screen to another is possible because of Navigators, a simple widget that maintains a stack of Routes, or in simpler terms, a history of visited screens/pages.