Skip to content

Commit

Permalink
Readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshrvel committed Apr 11, 2020
1 parent 7b1ced8 commit 1d26d1d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
72 changes: 64 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
```

To activate video player in,
macOS: add the following lines to your *macos/Runner/Info.plist*
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```
*.inject.summary;*.inject.dart;*.g.dart;

iOS: add the following lines to your *ios/Runner/Info.plist*
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```

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
<uses-permission android:name="android.permission.INTERNET"/>
```
**/*.inject.summary
**/*.inject.dart
**/*.g.dart

and add the attribute `android:usesCleartextTraffic="true"` to `<application`

```xml
# example
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="abc.xyz.pqr">
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:usesCleartextTraffic="true"
....
...
/>
```


### 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.
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>

0 comments on commit 1d26d1d

Please sign in to comment.