First time, setup project for development on Mac.
- Download Flutter SDK
- Open iTerm
open ~/.zshrc- Add code in find .zshrc -> and remove pwd to /Users/supagornsirimaleewattana
export PATH="$PATH:/Users/supagornsirimaleewattana/flutter/bin"- Run flutter doctor
flutter doctor- Finish
- open iTerm
open -a Simulator- Create a new Flutter app
flutter create my_app- Enter this directory
cd my_app- To launch the app
flutter run- Or Run in by VS Code
- Click Run
- Click Start Debugging
- Start VS Code.
- Invoke View > Command Palette….
- Type “install”, and select Extensions: Install Extensions.
- Type “flutter” in the extensions search field, select Flutter in the list, and click Install. This also installs the required Dart plugin.
- Add a font to your project
- in assets/fonts/
- Register the font
- Open your pubspec.yaml file.
flutter:
fonts:
- family: DancingScript
fonts:
- asset: assets/fonts/dancing_script.ttf[Reference](https://suragch.medium.com/how-to-use-a-custom-font-in-a-flutter-app-911763c162f5)
- we only need to convert the string #b74093 to an integer value
const color = const Color(0xFFB74093);[Reference](https://stackoverflow.com/a/50081214/17992107)
- Folder assets -> Contains Folder images, icons, logos, fonts
- Folder fucntions -> cloud function (API)
- Folder lib
- 3.1. Folder modals -> Contains collection data
- 3.2. Folder pages -> Contains many screen
- 3.3. Folder services -> Contains firebase
- 3.4. Folder utils -> Contains Function
- 3.5. Folder widgets -> Contains widget for reuse widget
- 3.6. File app.dart -> Navigation
- 3.7. File theme.dart -> Contains Styles
[Reference](https://www.youtube.com/watch?v=FsK1H6KXf0c)
MaterialApp(
title: 'Named Routes Demo',
// Start the app with the "/" named route. In this case, the app starts
// on the FirstScreen widget.
initialRoute: '/',
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/': (context) => const FirstScreen(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/second': (context) => const SecondScreen(),
},
)