From 85d3d9ead641051ab328fb0f9847e9324ba38ea5 Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 18:42:34 +0900 Subject: [PATCH 1/9] fix:add flutter_test.yaml --- .github/workflow/flutter_test.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflow/flutter_test.yaml diff --git a/.github/workflow/flutter_test.yaml b/.github/workflow/flutter_test.yaml new file mode 100644 index 0000000..cd815ce --- /dev/null +++ b/.github/workflow/flutter_test.yaml @@ -0,0 +1,26 @@ +name: Flutter_Test + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - master + +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: 'beta' + - 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 From fc0237af7199898db48e99b49e924f37281555cd Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 18:43:10 +0900 Subject: [PATCH 2/9] =?UTF-8?q?fix:=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81?= =?UTF-8?q?=E5=90=8D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflow/flutter_analyze.yaml | 2 +- .github/workflow/flutter_test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflow/flutter_analyze.yaml b/.github/workflow/flutter_analyze.yaml index 5c9f93a..dda7c06 100644 --- a/.github/workflow/flutter_analyze.yaml +++ b/.github/workflow/flutter_analyze.yaml @@ -5,7 +5,7 @@ on: types: [opened, synchronize] push: branches: - - master + - main jobs: flutter_analyze: diff --git a/.github/workflow/flutter_test.yaml b/.github/workflow/flutter_test.yaml index cd815ce..9f1688a 100644 --- a/.github/workflow/flutter_test.yaml +++ b/.github/workflow/flutter_test.yaml @@ -5,7 +5,7 @@ on: types: [opened, synchronize] push: branches: - - master + - main jobs: flutter_test: From dabe69a6442c0a99fa655c50e461ed532636164d Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 18:49:44 +0900 Subject: [PATCH 3/9] =?UTF-8?q?fix:develop=E3=83=96=E3=83=A9=E3=83=B3?= =?UTF-8?q?=E3=83=81=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflow/flutter_analyze.yaml | 1 + .github/workflow/flutter_test.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflow/flutter_analyze.yaml b/.github/workflow/flutter_analyze.yaml index dda7c06..dca65f9 100644 --- a/.github/workflow/flutter_analyze.yaml +++ b/.github/workflow/flutter_analyze.yaml @@ -6,6 +6,7 @@ on: push: branches: - main + - develop jobs: flutter_analyze: diff --git a/.github/workflow/flutter_test.yaml b/.github/workflow/flutter_test.yaml index 9f1688a..50012e2 100644 --- a/.github/workflow/flutter_test.yaml +++ b/.github/workflow/flutter_test.yaml @@ -6,6 +6,7 @@ on: push: branches: - main + - develop jobs: flutter_test: From a40c872dee94ba21f7dfcec98ee044aa5b37c90b Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 18:52:22 +0900 Subject: [PATCH 4/9] =?UTF-8?q?fix:=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80?= =?UTF-8?q?=E5=90=8D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/{workflow => workflows}/flutter_analyze.yaml | 0 .github/{workflow => workflows}/flutter_test.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflow => workflows}/flutter_analyze.yaml (100%) rename .github/{workflow => workflows}/flutter_test.yaml (100%) diff --git a/.github/workflow/flutter_analyze.yaml b/.github/workflows/flutter_analyze.yaml similarity index 100% rename from .github/workflow/flutter_analyze.yaml rename to .github/workflows/flutter_analyze.yaml diff --git a/.github/workflow/flutter_test.yaml b/.github/workflows/flutter_test.yaml similarity index 100% rename from .github/workflow/flutter_test.yaml rename to .github/workflows/flutter_test.yaml From 0e5a77aad607977493680c90e03f5e50a7f2b063 Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 18:57:24 +0900 Subject: [PATCH 5/9] fix:change_timeout_minutes --- .github/workflows/flutter_analyze.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_analyze.yaml b/.github/workflows/flutter_analyze.yaml index dca65f9..4f6aac4 100644 --- a/.github/workflows/flutter_analyze.yaml +++ b/.github/workflows/flutter_analyze.yaml @@ -11,7 +11,7 @@ on: jobs: flutter_analyze: runs-on: ubuntu-latest - timeout-minutes: 1 + timeout-minutes: 10 steps: - uses: actions/checkout@v2 with: From ad4556686e6c6e6dad67ff0ec4a81deed6404024 Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 21:08:52 +0900 Subject: [PATCH 6/9] =?UTF-8?q?refactor:linter=E3=82=92pedantic=5Fmono?= =?UTF-8?q?=E3=81=8B=E3=82=89pedantic=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analysis_options.yaml | 3 +-- pubspec.lock | 16 ++++++++-------- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index c6d040c..d4fcc1a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,2 +1 @@ -# https://pub.dev/packages/pedantic_mono -include: package:pedantic_mono/analysis_options.yaml \ No newline at end of file +include: package:pedantic/analysis_options.yaml \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index fe9c1ed..96d2a6e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: @@ -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 @@ -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: @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index d25e159..e671fc9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - pedantic_mono: any + pedantic: ^1.9.2 flutter: uses-material-design: true From 99f0466b658fa01762afffa1a23993e437139a41 Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 21:18:09 +0900 Subject: [PATCH 7/9] =?UTF-8?q?fix:lint=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../todo_list/todo_list_page.dart | 4 +- test/todo_item_detail_model_test.dart | 2 +- test/todo_item_test.dart | 18 ++++---- test/todo_list_model_test.dart | 46 +++++++++---------- test/widget_test.dart | 2 - 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/lib/presentation/todo_list/todo_list_page.dart b/lib/presentation/todo_list/todo_list_page.dart index 6645472..c03f9ca 100644 --- a/lib/presentation/todo_list/todo_list_page.dart +++ b/lib/presentation/todo_list/todo_list_page.dart @@ -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) { @@ -133,6 +133,6 @@ class TodoListPage extends StatelessWidget { fullscreenDialog: true, ), ); - model.getTodoList(); + await model.getTodoList(); } } diff --git a/test/todo_item_detail_model_test.dart b/test/todo_item_detail_model_test.dart index 656bebd..72e344a 100644 --- a/test/todo_item_detail_model_test.dart +++ b/test/todo_item_detail_model_test.dart @@ -66,7 +66,7 @@ void main() { ); // repository.create( // '変更前', '変更前', false, DateTime.now().subtract(Duration(days: 1))); - repository.create( + await repository.create( title: '変更前', body: '変更前', isDone: false, diff --git a/test/todo_item_test.dart b/test/todo_item_test.dart index 7b79da5..dde2b2e 100644 --- a/test/todo_item_test.dart +++ b/test/todo_item_test.dart @@ -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', @@ -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 { @@ -44,8 +44,8 @@ void main() { }); }); - group("toMapのテスト", () { - final TodoItem todoItem = TodoItem( + group('toMapのテスト', () { + final todoItem = TodoItem( id: 0, title: 'title', body: 'body', @@ -77,7 +77,7 @@ void main() { }); }); - group("fromMapのテスト", () { + group('fromMapのテスト', () { final json = { 'id': 0, 'title': 'title', @@ -107,8 +107,8 @@ void main() { }); }); - group("toStringのテスト", () { - final TodoItem todoItem = TodoItem( + group('toStringのテスト', () { + final todoItem = TodoItem( id: 0, title: 'title', body: 'body', diff --git a/test/todo_list_model_test.dart b/test/todo_list_model_test.dart index 829bb8e..8183bb7 100644 --- a/test/todo_list_model_test.dart +++ b/test/todo_list_model_test.dart @@ -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; @@ -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); } // メソッド実行 @@ -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); } // メソッド実行 @@ -165,10 +162,9 @@ void main() { test('正常系:keyがある時', () async { // 事前準備 - storageRepository - ..clear() - ..savePersistenceStorage( - viewCompletedItemsKey, viewCompletedItemsTrueString); + storageRepository.clear(); + await storageRepository.savePersistenceStorage( + viewCompletedItemsKey, viewCompletedItemsTrueString); // メソッド実行 await model.loadViewCompletedItems(); diff --git a/test/widget_test.dart b/test/widget_test.dart index 7b4ba39..fd040a3 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -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 { From 445077e6467a3c27ce5d1d0ea92cc832d146573f Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 21:42:25 +0900 Subject: [PATCH 8/9] fix:flutter channel change stable --- .github/workflows/flutter_analyze.yaml | 2 +- .github/workflows/flutter_test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_analyze.yaml b/.github/workflows/flutter_analyze.yaml index 4f6aac4..6908051 100644 --- a/.github/workflows/flutter_analyze.yaml +++ b/.github/workflows/flutter_analyze.yaml @@ -18,6 +18,6 @@ jobs: fetch-depth: 1 - uses: subosito/flutter-action@v1 with: - channel: 'beta' + channel: 'stable' - run: flutter pub get - run: flutter analyze \ No newline at end of file diff --git a/.github/workflows/flutter_test.yaml b/.github/workflows/flutter_test.yaml index 50012e2..661a492 100644 --- a/.github/workflows/flutter_test.yaml +++ b/.github/workflows/flutter_test.yaml @@ -18,7 +18,7 @@ jobs: fetch-depth: 1 - uses: subosito/flutter-action@v1 with: - channel: 'beta' + channel: 'stable' - run: flutter pub get - run: flutter test --no-test-assets --coverage --coverage-path=~/coverage/lcov.info - uses: codecov/codecov-action@v1 From 742177b310eea48b407bab7804ed281bbd2e749c Mon Sep 17 00:00:00 2001 From: tokku5552 Date: Sat, 13 Feb 2021 21:46:57 +0900 Subject: [PATCH 9/9] add license --- .github/workflows/flutter_analyze.yaml | 7 +++++++ .github/workflows/flutter_test.yaml | 7 +++++++ pubspec.yaml | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/.github/workflows/flutter_analyze.yaml b/.github/workflows/flutter_analyze.yaml index 6908051..2e38ce4 100644 --- a/.github/workflows/flutter_analyze.yaml +++ b/.github/workflows/flutter_analyze.yaml @@ -1,3 +1,10 @@ +# +# Copyright (c) 2021 tokku5552 +# +# This software is released under the MIT License. +# https://opensource.org/licenses/mit-license.php +# +# name: Flutter_Analyzer on: diff --git a/.github/workflows/flutter_test.yaml b/.github/workflows/flutter_test.yaml index 661a492..dfd29ba 100644 --- a/.github/workflows/flutter_test.yaml +++ b/.github/workflows/flutter_test.yaml @@ -1,3 +1,10 @@ +# +# Copyright (c) 2021 tokku5552 +# +# This software is released under the MIT License. +# https://opensource.org/licenses/mit-license.php +# +# name: Flutter_Test on: diff --git a/pubspec.yaml b/pubspec.yaml index e671fc9..f60a030 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.