Skip to content

Commit

Permalink
Merge branch 'release/1.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tokku5552 committed Feb 13, 2021
2 parents 2cffd89 + 742177b commit eb206d5
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
#
# Copyright (c) 2021 tokku5552
#
# This software is released under the MIT License.
# https://opensource.org/licenses/mit-license.php
#
#
name: Flutter_Analyzer

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- master
- main
- develop

jobs:
flutter_analyze:
runs-on: ubuntu-latest
timeout-minutes: 1
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
channel: 'stable'
- run: flutter pub get
- run: flutter analyze
34 changes: 34 additions & 0 deletions .github/workflows/flutter_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Copyright (c) 2021 tokku5552
#
# This software is released under the MIT License.
# https://opensource.org/licenses/mit-license.php
#
#
name: Flutter_Test

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
- develop

jobs:
flutter_test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get
- run: flutter test --no-test-assets --coverage --coverage-path=~/coverage/lcov.info
- uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ~/coverage/lcov.info
3 changes: 1 addition & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# https://pub.dev/packages/pedantic_mono
include: package:pedantic_mono/analysis_options.yaml
include: package:pedantic/analysis_options.yaml
4 changes: 2 additions & 2 deletions lib/presentation/todo_list/todo_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TodoListPage extends StatelessWidget {
return PopupMenuButton(
initialValue: 'model.viewCompletedItems',
onSelected: (String s) async {
model.changeViewCompletedItems(s);
await model.changeViewCompletedItems(s);
await model.getTodoList();
},
itemBuilder: (BuildContext context) {
Expand Down Expand Up @@ -133,6 +133,6 @@ class TodoListPage extends StatelessWidget {
fullscreenDialog: true,
),
);
model.getTodoList();
await model.getTodoList();
}
}
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+3"
pedantic_mono:
pedantic:
dependency: "direct dev"
description:
name: pedantic_mono
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0+3"
version: "1.9.2"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -176,7 +176,7 @@ packages:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.2+2"
version: "4.3.3"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -218,7 +218,7 @@ packages:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
version: "0.0.2+3"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -237,14 +237,14 @@ packages:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2+1"
version: "1.3.2+3"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2+1"
version: "1.0.3+1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -307,7 +307,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.4"
version: "1.7.4+1"
xdg_directories:
dependency: transitive
description:
Expand Down
9 changes: 8 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#
# Copyright (c) 2021 tokku5552
#
# This software is released under the MIT License.
# https://opensource.org/licenses/mit-license.php
#
#
name: todo_app_sample_flutter
description: A new Flutter application.

Expand All @@ -21,7 +28,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pedantic_mono: any
pedantic: ^1.9.2

flutter:
uses-material-design: true
Expand Down
2 changes: 1 addition & 1 deletion test/todo_item_detail_model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void main() {
);
// repository.create(
// '変更前', '変更前', false, DateTime.now().subtract(Duration(days: 1)));
repository.create(
await repository.create(
title: '変更前',
body: '変更前',
isDone: false,
Expand Down
18 changes: 9 additions & 9 deletions test/todo_item_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:todo_app_sample_flutter/domain/todo_item.dart';

void main() {
group("TodoItemのゲッターのテスト", () {
final TodoItem todoItem = TodoItem(
group('TodoItemのゲッターのテスト', () {
final todoItem = TodoItem(
id: 0,
title: 'title',
body: 'body',
Expand All @@ -24,11 +24,11 @@ void main() {
});

test('titleのテスト', () async {
expect(todoItem.getTitle, "title");
expect(todoItem.getTitle, 'title');
});

test('bodyのテスト', () async {
expect(todoItem.getBody, "body");
expect(todoItem.getBody, 'body');
});

test('createdAtのテスト', () async {
Expand All @@ -44,8 +44,8 @@ void main() {
});
});

group("toMapのテスト", () {
final TodoItem todoItem = TodoItem(
group('toMapのテスト', () {
final todoItem = TodoItem(
id: 0,
title: 'title',
body: 'body',
Expand Down Expand Up @@ -77,7 +77,7 @@ void main() {
});
});

group("fromMapのテスト", () {
group('fromMapのテスト', () {
final json = {
'id': 0,
'title': 'title',
Expand Down Expand Up @@ -107,8 +107,8 @@ void main() {
});
});

group("toStringのテスト", () {
final TodoItem todoItem = TodoItem(
group('toStringのテスト', () {
final todoItem = TodoItem(
id: 0,
title: 'title',
body: 'body',
Expand Down
46 changes: 21 additions & 25 deletions test/todo_list_model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ void main() {
todoItemRepository.clear();

for (final todoItem in data) {
todoItemRepository
..incrementId()
..create(
title: todoItem.title,
body: todoItem.body,
isDone: todoItem.isDone,
now: now);
todoItemRepository.incrementId();
await todoItemRepository.create(
title: todoItem.title,
body: todoItem.body,
isDone: todoItem.isDone,
now: now);
}

model.viewCompletedItems = true;
Expand Down Expand Up @@ -89,13 +88,12 @@ void main() {
// 事前準備
todoItemRepository.clear();
for (final todoItem in data) {
todoItemRepository
..incrementId()
..create(
title: todoItem.title,
body: todoItem.body,
isDone: todoItem.isDone,
now: now);
todoItemRepository.incrementId();
await todoItemRepository.create(
title: todoItem.title,
body: todoItem.body,
isDone: todoItem.isDone,
now: now);
}

// メソッド実行
Expand All @@ -112,13 +110,12 @@ void main() {
// 事前準備
todoItemRepository.clear();
for (final todoItem in data) {
todoItemRepository
..incrementId()
..create(
title: todoItem.title,
body: todoItem.body,
isDone: todoItem.isDone,
now: now);
todoItemRepository.incrementId();
await todoItemRepository.create(
title: todoItem.title,
body: todoItem.body,
isDone: todoItem.isDone,
now: now);
}

// メソッド実行
Expand Down Expand Up @@ -165,10 +162,9 @@ void main() {

test('正常系:keyがある時', () async {
// 事前準備
storageRepository
..clear()
..savePersistenceStorage(
viewCompletedItemsKey, viewCompletedItemsTrueString);
storageRepository.clear();
await storageRepository.savePersistenceStorage(
viewCompletedItemsKey, viewCompletedItemsTrueString);

// メソッド実行
await model.loadViewCompletedItems();
Expand Down
2 changes: 0 additions & 2 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:todo_app_sample_flutter/presentation/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
Expand Down

0 comments on commit eb206d5

Please sign in to comment.