From 1d26d1de66bbe9e0dad73a0164e407d0b0b82069 Mon Sep 17 00:00:00 2001 From: Ganesh Rathinavel Date: Sat, 11 Apr 2020 16:08:43 +0530 Subject: [PATCH] Readme updates --- .githooks/pre-commit | 8 +++-- README.md | 72 ++++++++++++++++++++++++++++++++++++++----- ios/Runner/Info.plist | 5 +++ 3 files changed, 74 insertions(+), 11 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index f68e475..6f4de80 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,15 +1,17 @@ #!/usr/bin/env bash +PATH="~/apps/flutter/bin/flutter:$PATH" +export PATH ##### Flutter formatter printf "\n" printf "\e[33;1m%s\e[0m\n" 'Running the Flutter formatter' -flutter format ./lib/ +~/apps/flutter/bin/flutter format ./lib/ ##### Flutter analyzer printf "\n" printf "\e[33;1m%s\e[0m\n" 'Running the Flutter analyzer' -flutter analyze ./lib/ +~/apps/flutter/bin/flutter analyze ./lib/ if [ $? -ne 0 ]; then printf "\e[31;1m%s\e[0m\n" 'Flutter analyzer error' exit 1 @@ -19,7 +21,7 @@ fi ##### Unit tests # printf "\n" # printf "\e[33;1m%s\e[0m\n" 'Running unit tests' -# flutter test +# ~/apps/flutter/bin/flutter test # if [ $? -ne 0 ]; then # printf "\e[31;1m%s\e[0m\n" 'Unit tests error' # exit 1 diff --git a/README.md b/README.md index 1311aac..de786c3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ - auto_route for routing (https://pub.dev/packages/auto_route) - Multi theme support - Multilingual support (l10n) -- Logging +- Pre-commit hooks +- Logging using `logger` (lib/utils/log) ### Installation ```shell @@ -45,21 +46,60 @@ This boilerplate uses code generation tools to automatically generate code durin ./scripts/build-runner-watch.sh ``` -### Hide Generated Files +### Configuration +Activate pre-commit hooks +```shell +$ git config core.hooksPath .githooks/ +``` -In-order to hide generated files, navigate to `Android Studio` -> `Preferences` -> `Editor` -> `File Types` and past the below lines under `ignore files and folders` section: +To activate network connection in macOS, add the following lines to your *macos/Runner/DebugProfile.entitlements* and *macos/Runner/Release.entitlements* +```xml + com.apple.security.network.server + + com.apple.security.network.client + +``` +To activate video player in, +macOS: add the following lines to your *macos/Runner/Info.plist* +```xml + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + ``` -*.inject.summary;*.inject.dart;*.g.dart; + +iOS: add the following lines to your *ios/Runner/Info.plist* +```xml + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + ``` -In Visual Studio Code, navigate to `Preferences` -> `Settings` and search for `Files:Exclude`. Add the following patterns: +Android: Ensure the following permission is present in your Android Manifest file, located in *android/app/src/main/AndroidManifest.xml* +```xml + ``` -**/*.inject.summary -**/*.inject.dart -**/*.g.dart + +and add the attribute `android:usesCleartextTraffic="true"` to ` + + + ``` + ### APIS Clone the repo https://github.com/ganeshrvel/auth-apis and follow the instructions in the [README.md](https://github.com/ganeshrvel/auth-apis/blob/master/README.md "README.md") for the running the API server. @@ -294,6 +334,22 @@ appData.pick( value1 = getDefaultValue(); }, ); +``` + +### IDE +**Hide Generated Files** + +In-order to hide generated files, navigate to `Android Studio` -> `Preferences` -> `Editor` -> `File Types` and paste the below lines under `Ignore files and Folders` section: + +``` +*.inject.summary;*.inject.dart;*.g.dart; +``` + +In Visual Studio Code, navigate to `Preferences` -> `Settings` and search for `Files:Exclude`. Add the following patterns: +``` +**/*.inject.summary +**/*.inject.dart +**/*.g.dart ``` ### Contribute diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5d56758..f8c9a6c 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -41,5 +41,10 @@ UIViewControllerBasedStatusBarAppearance + NSAppTransportSecurity + + NSAllowsArbitraryLoads + +