generated from yumemi-inc/flutter-training-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #23 from mqkotoo/session/10
Session/10
- Loading branch information
Showing
12 changed files
with
468 additions
and
57 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
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
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 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
@immutable | ||
class ErrorMessage { | ||
const ErrorMessage._(); | ||
|
||
static const invalidParameter = 'パラメータが有効ではありません。'; | ||
static const unknown = '予期せぬエラーが発生しました。'; | ||
static const receiveInvalidData = '不適切なデータを取得しました。'; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const validJsonData = ''' | ||
{ | ||
"weather_condition": "cloudy", | ||
"max_temperature": 25, | ||
"min_temperature": 7, | ||
"date": "2023-09-19 10:24:31.877" | ||
} | ||
'''; | ||
|
||
const sunnyWeatherJsonData = ''' | ||
{ | ||
"weather_condition": "sunny", | ||
"max_temperature": 30, | ||
"min_temperature": 0, | ||
"date": "2023-09-19 10:24:31.877" | ||
} | ||
'''; | ||
|
||
const cloudyWeatherJsonData = ''' | ||
{ | ||
"weather_condition": "cloudy", | ||
"max_temperature": 25, | ||
"min_temperature": 7, | ||
"date": "2023-09-19 10:24:31.877" | ||
} | ||
'''; | ||
|
||
const rainyWeatherJsonData = ''' | ||
{ | ||
"weather_condition": "rainy", | ||
"max_temperature": 44, | ||
"min_temperature": -22, | ||
"date": "2023-09-19 10:24:31.877" | ||
} | ||
'''; | ||
|
||
const invalidJsonDataForCheckedFromJsonException = ''' | ||
{ | ||
"weather_condition": "thunder", | ||
"max_temperature": 25.0, | ||
"min_temperature": 7, | ||
"date": "2023-09-19T00:00:00.000" | ||
} | ||
'''; | ||
|
||
const invalidJsonDataForFormatException = '{invalid json data}'; |
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,19 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
final binding = TestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
//初期状態は横画面判定になっているので縦画面に設定する | ||
void setDisplaySize({ | ||
Size size = const Size(390, 844), | ||
}) { | ||
binding.platformDispatcher.implicitView!.physicalSize = size; | ||
binding.platformDispatcher.implicitView!.devicePixelRatio = 1; | ||
} | ||
|
||
//デバイスサイズ設定の破棄 | ||
void teardownDisplaySize() { | ||
binding.platformDispatcher.implicitView!.resetPhysicalSize(); | ||
binding.platformDispatcher.implicitView!.resetDevicePixelRatio(); | ||
} |
Oops, something went wrong.