clone
git clone https://github.com/flutter/flutter.git -b stable
add the flutter/bin to your PATH variable
run flutter doctor
flutter doctor
install android studio from https://developer.android.com/studio make sure ANDROID_SDK_ROOT is set to the path of your SDK
setup android studio emulator to have at least one device to test with
see more at https://flutter.dev/docs/get-started/install/windows
flutter create . --org com.bilersolutions.<yourproject>
rename
rename setAppName --targets ios,android --value "YourAppName"
install package
flutter pub add <package-name>
clean
flutter clean
get dependencies
flutter pub get
- Similar to ReactJS
- Widget = Component
- Uses Dart programming language (similar to ES6)
- Sample project https://github.com/buonzz/startup_namer
- pubspec.yaml is like packages.json
- https://pub.dev/ is like npmjs.com
- BLoC - Business Logic Component, predictable state management library for Dart
each app has main function
void main() {
print('Hello, World!');
}
importing
// Importing core libraries
import 'dart:math';
// Importing libraries from external packages
import 'package:test/test.dart';
// Importing files
import 'path/to/my_other_file.dart';
StatelessWidget - dont have properties that change over time StatefulWidget - changes based on user interaction and other factors, store mutable state in a seperate class called State StatefulWidgets don’t have a build method; instead, their user interface is built through their State object
get a state class from any parent
StudentState extends InheritedWidget
final studentState = StudentState.of(context);
- SafeArea - widget that avoids operating system interfaces
Basic Layout with navigation menu on top
main > runApp > MaterialApp.home > SafeArea.child > StatelessWidget.build > Material.child > Column.children > MyAppBar and Expanded
⇧ + ⌘ + K
Ctrl + Alt + d
click "Open Devtools in Web Browser"
Riverpod - state management for flutter.
- Provider - simple immutable objects
- StateProvider - simple mutable objects
- FutureProvider - values that are resolved asynchronously
- StreamProvider - values that come from a continuous stream