Skip to content

Commit

Permalink
Merge pull request #92 from nimblehq/release/0.9.0
Browse files Browse the repository at this point in the history
Release 0.9.0 (10)
  • Loading branch information
manh-t authored Jul 1, 2022
2 parents 0e90442 + 33cd747 commit c8fa734
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# Python
.venv/
scripts/__pycache__/

# VSCode
.vscode
9 changes: 9 additions & 0 deletions .template/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ jobs:

- name: Run widget tests, unit tests.
run: flutter test --machine --coverage

- uses: codecov/codecov-action@v2
with:
name: Upload coverage to codecov
files: ./coverage/lcov.info
flags: unittests # optional
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
fail_ci_if_error: false
verbose: true
6 changes: 6 additions & 0 deletions .template/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Flutter Templates

[![codecov](https://codecov.io/gh/nimblehq/flutter_templates/branch/main/graph/badge.svg?token=ATUNXDX218)](https://codecov.io/gh/nimblehq/flutter_templates)

All the templates that can be used to kick off a new Flutter application quickly.

## Usage
Expand Down Expand Up @@ -50,6 +52,10 @@ Clone the repository

`$ fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/my_home_page_test.dart --flavor staging`

- Code coverage integration:

- CodeCov: for the private repository, we need to set up a [TeamBot](https://docs.codecov.com/docs/team-bot) in `codecov.yml`.

## License

This project is Copyright (c) 2014 and onwards. It is free software,
Expand Down
26 changes: 26 additions & 0 deletions .template/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Sample CodeCov config for private repository
codecov:
bot: luongvo
require_ci_to_pass: yes

coverage:
status:
project: off
patch: off

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,files,tree"
behavior: default
require_changes: no

ignore:
- "lib/di"
- "lib/gen"
17 changes: 17 additions & 0 deletions .template/lib/usecases/base/base_use_case.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
part 'use_case_result.dart';

abstract class BaseUseCase<T extends Result> {
const BaseUseCase();
}

abstract class UseCase<T, P> extends BaseUseCase<Result<T>> {
const UseCase() : super();

Future<Result<T>> call(P params);
}

abstract class NoParamsUseCase<T> extends BaseUseCase<Result<T>> {
const NoParamsUseCase() : super();

Future<Result<T>> call();
}
23 changes: 23 additions & 0 deletions .template/lib/usecases/base/use_case_result.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
part of 'base_use_case.dart';

abstract class Result<T> {
Result._();
}

class Success<T> extends Result<T> {
final T value;

Success(this.value) : super._();
}

class UseCaseException implements Exception {
final dynamic actualException;

UseCaseException(this.actualException);
}

class Failed<T> extends Result<T> {
final UseCaseException exception;

Failed(this.exception) : super._();
}
2 changes: 1 addition & 1 deletion .template/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.8.0+9
version: 0.9.0+10

environment:
sdk: ">=2.16.1 <3.0.0"
Expand Down

0 comments on commit c8fa734

Please sign in to comment.