Skip to content

OttawaSTEM/flutter_boilerplate

Repository files navigation

Install Flutter

https://docs.flutter.dev/get-started/install/macos

brew install cocoapods

VSCode Extension

GetX Snippets

Change Language regardless device setting

Get.updateLocale(const Locale('zh', 'CN'));
Get.updateLocale(const Locale('en', 'US'));

Flutter Google Fonts Icon

https://fonts.google.com/icons

Websocket use GetxService

chat https://absyz.com/getconnect-the-best-way-to-perform-api-operations-in-flutter-with-getx/

Flutter local dev can't use localhost or 127.0.0.1

VSCode extensions for Flutter

  • Dart
  • Error Lens
  • Flutter
  • GetX Snippets

Ctrl + . - Wrap or Extract Widget

  • Prettier - Code formatter
  • Dart Data Class generator
  • Bloc

flutter_boilerplate

Google Authentication

Flutter Launcher Icons

flutter pub run flutter_launcher_icons

Flutter splach

flutter pub run flutter_native_splash:create

Local http request

Add '--disable-web-security' in the chrome web configuration.

  1. Go to flutter\bin\cache and remove a file named: flutter_tools.stamp
  2. Go to flutter\packages\flutter_tools\lib\src\web and open the file chrome.dart.
  3. Find '--disable-extensions'
  4. Add '--disable-web-security', # !!! Including ,(comma)

MacOS no network connection

Add
<key>com.apple.security.network.client</key>
<true />
to
macos/Runner/DebugProfile.entitiements
macos/Runner/release.entitiements

Flutter http: api vs client - ??? Django auth session ???

api: Single http request client: Multiple requests and a persistent connection

Flutter MVC+S Design Pattern

Model: lib\models View: lib\ui Controller: lib\providers Services: lib\services

Tools

QuickType - Convert JSON to Class

Vscode Extensions

Bloc Dart Data Class Generator

Bloc Shortcut

Click the light bulb Windows: Crtl + . Mac OS: Command + .

JSON to Dart

JSON to Dart

SVG Cleaner

SVG Cleaner Online

Flutter Default Config

C:\Tools\Flutter\packages\flutter_tools\gradle\flutter.gradle

Scrollable Layout

1. SingleChildScrollView inside SafeArea

Scaffold(
    body: SafeArea(
        child: Column(children: <Widget>[
            Expanded(
                child: SingleChildScrollView(),
            )
        ]
    ),
);

2. ListView inside SafeArea

Scaffold(
    body: SafeArea(
        child: ListView(
        children: <Widget>[],
    ),
);

Clean flutter packages and reinstall flutter packages

flutter pub outdated
flutter pub upgrade
flutter clean && flutter pub get 

F5 to run Flutter Debug

Flutter ColorScheme

https://api.flutter.dev/flutter/material/ColorScheme-class.html

Recreate Device

delete android flutter create . flutter create --platforms=android,ios --project-name=flutter_boilerplate .

Flutter add package

flutter pub add settings_ui flutter pub get

Flutter Plugins & Packages

https://github.com/flutter/packages https://github.com/fluttercommunity/plus_plugins

  • Packages At a minimum, a Dart package is a directory containing a pubspec.yaml file. Additionally, a package can contain dependencies (listed in the pubspec), Dart libraries, apps, resources, tests, images, fonts, and examples. The pub.dev site lists many packages—developed by Google engineers and generous members of the Flutter and Dart community— that you can use in your app.

  • Plugins A plugin package is a special kind of package that makes platform functionality available to the app. Plugin packages can be written for Android (using Kotlin or Java), iOS (using Swift or Objective-C), web, macOS, Windows, Linux, or any combination thereof. For example, a plugin might provide Flutter apps with the ability to use a device's camera.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published