-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from salihgueler/starter_new_era
amplify_starter: New Era
- Loading branch information
Showing
230 changed files
with
2,381 additions
and
1,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- | ||
Thanks for contributing! | ||
Provide a description of your changes below and a general summary in the title | ||
Please look at the following checklist to ensure that your PR can be accepted quickly: | ||
--> | ||
|
||
## Description | ||
|
||
<!--- Describe your changes in detail --> | ||
|
||
## Type of Change | ||
|
||
<!--- Put an `x` in all the boxes that apply: --> | ||
|
||
- [ ] ✨ New feature (non-breaking change which adds functionality) | ||
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) | ||
- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) | ||
- [ ] 🧹 Code refactor | ||
- [ ] ✅ Build configuration change | ||
- [ ] 📝 Documentation | ||
- [ ] 🗑️ Chore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "pub" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: {{project_name.snakeCase()}} | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
semantic-pull-request: | ||
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 | ||
|
||
build: | ||
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 | ||
with: | ||
flutter_channel: stable | ||
flutter_version: 3.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
__brick__/{{project_name}}/.idea/runConfigurations/development.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
__brick__/{{project_name}}/.idea/runConfigurations/production.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
__brick__/{{project_name}}/.idea/runConfigurations/staging.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"dart-code.dart-code", | ||
"dart-code.flutter", | ||
"felixangelov.bloc" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch development", | ||
"request": "launch", | ||
"type": "dart", | ||
"program": "lib/main_development.dart", | ||
"args": [ | ||
"--flavor", | ||
"development", | ||
"--target", | ||
"lib/main_development.dart" | ||
] | ||
}, | ||
{ | ||
"name": "Launch staging", | ||
"request": "launch", | ||
"type": "dart", | ||
"program": "lib/main_staging.dart", | ||
"args": ["--flavor", "staging", "--target", "lib/main_staging.dart"] | ||
}, | ||
{ | ||
"name": "Launch production", | ||
"request": "launch", | ||
"type": "dart", | ||
"program": "lib/main_production.dart", | ||
"args": ["--flavor", "production", "--target", "lib/main_production.dart"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,160 @@ | ||
# {{project_name.sentenceCase()}} | ||
|
||
[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) | ||
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link][![License: MIT][license_badge]][license_link][![Powered by Mason][mason_badge]][mason_link] | ||
|
||
An opinionated Flutter project for starting with AWS Amplify. | ||
An opinionated Flutter project for starting with AWS Amplify. It uses the Very Good Core project for example project setup. | ||
|
||
The project uses: | ||
- [Amplify Authenticator](https://pub.dev/packages/amplify_authenticator), for authentication | ||
- [Amplify Datastore](https://pub.dev/packages/amplify_datastore) for saving data and real time updates | ||
- [bloc](https://pub.dev/packages/bloc) for state management. | ||
- | ||
## Getting Started | ||
- [Amplify Flutter](https://pub.dev/packages/amplify_flutter), for Amplify Setup | ||
|
||
The project is structured and configured for your usage. Only thing you have to do is to change your changes to the cloud __IF__ you have not done it yet. | ||
_For an Amplify Starter Application with a todo example, check out amplify_todo_starter brick._ | ||
|
||
```shell | ||
amplify push | ||
## Getting Started 🚀 | ||
|
||
This project contains 3 flavors: | ||
|
||
- development | ||
- staging | ||
- production | ||
|
||
To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands: | ||
|
||
```sh | ||
# Development | ||
$ flutter run --flavor development --target lib/main_development.dart | ||
|
||
# Staging | ||
$ flutter run --flavor staging --target lib/main_staging.dart | ||
|
||
# Production | ||
$ flutter run --flavor production --target lib/main_production.dart | ||
``` | ||
|
||
_\*Amplify Starter Template works on iOS, Android, Web, and Windows._ | ||
|
||
--- | ||
|
||
## Running Tests 🧪 | ||
|
||
To run all unit and widget tests use the following command: | ||
|
||
```sh | ||
$ flutter test --coverage --test-randomize-ordering-seed random | ||
``` | ||
|
||
With this command, you are pushing your changes to the cloud. These changes will take a couple of minutes so in the meantime enjoy your coffee. | ||
To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). | ||
|
||
```sh | ||
# Generate Coverage Report | ||
$ genhtml coverage/lcov.info -o coverage/ | ||
|
||
# Open Coverage Report | ||
$ open coverage/index.html | ||
``` | ||
|
||
--- | ||
|
||
## Working with Translations 🌐 | ||
|
||
This project relies on [flutter_localizations][flutter_localizations_link] and follows the [official internationalization guide for Flutter][internationalization_link]. | ||
|
||
### Adding Strings | ||
|
||
1. To add a new localizable string, open the `app_en.arb` file at `lib/l10n/arb/app_en.arb`. | ||
|
||
```arb | ||
{ | ||
"@@locale": "en", | ||
"counterAppBarTitle": "Counter", | ||
"@counterAppBarTitle": { | ||
"description": "Text shown in the AppBar of the Counter Page" | ||
} | ||
} | ||
``` | ||
|
||
2. Then add a new key/value and description | ||
|
||
```arb | ||
{ | ||
"@@locale": "en", | ||
"counterAppBarTitle": "Counter", | ||
"@counterAppBarTitle": { | ||
"description": "Text shown in the AppBar of the Counter Page" | ||
}, | ||
"helloWorld": "Hello World", | ||
"@helloWorld": { | ||
"description": "Hello World Text" | ||
} | ||
} | ||
``` | ||
|
||
3. Use the new string | ||
|
||
```dart | ||
import 'package:{{project_name.sentenceCase()}}/l10n/l10n.dart'; | ||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = context.l10n; | ||
return Text(l10n.helloWorld); | ||
} | ||
``` | ||
|
||
### Adding Supported Locales | ||
|
||
Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info.plist` to include the new locale. | ||
|
||
```xml | ||
... | ||
|
||
<key>CFBundleLocalizations</key> | ||
<array> | ||
<string>en</string> | ||
<string>es</string> | ||
</array> | ||
|
||
... | ||
``` | ||
|
||
### Adding Translations | ||
|
||
1. For each supported locale, add a new ARB file in `lib/l10n/arb`. | ||
|
||
``` | ||
├── l10n | ||
│ ├── arb | ||
│ │ ├── app_en.arb | ||
│ │ └── app_es.arb | ||
``` | ||
|
||
2. Add the translated strings to each `.arb` file: | ||
|
||
`app_en.arb` | ||
|
||
```arb | ||
{ | ||
"@@locale": "en", | ||
"counterAppBarTitle": "Counter", | ||
"@counterAppBarTitle": { | ||
"description": "Text shown in the AppBar of the Counter Page" | ||
} | ||
} | ||
``` | ||
|
||
`app_es.arb` | ||
|
||
```arb | ||
{ | ||
"@@locale": "es", | ||
"counterAppBarTitle": "Contador", | ||
"@counterAppBarTitle": { | ||
"description": "Texto mostrado en la AppBar de la página del contador" | ||
} | ||
} | ||
``` | ||
|
||
Once it is done, go ahead and run your application! | ||
[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis | ||
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg | ||
[license_link]: https://opensource.org/licenses/MIT | ||
[mason_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge | ||
[mason_link]: https://github.com/felangel/mason |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,4 @@ | ||
# This file configures the analyzer, which statically analyzes Dart code to | ||
# check for errors, warnings, and lints. | ||
# | ||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled | ||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be | ||
# invoked from the command line by running `flutter analyze`. | ||
|
||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
analyzer: | ||
exclude: | ||
- lib/models | ||
|
||
include: package:very_good_analysis/analysis_options.3.1.0.yaml | ||
linter: | ||
# The lint rules applied to this project can be customized in the | ||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` | ||
# included above or to enable additional rules. A list of all available lints | ||
# and their documentation is published at | ||
# https://dart-lang.github.io/linter/lints/index.html. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options | ||
public_member_api_docs: false |
Oops, something went wrong.