├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ └── Icon-512.png ├── manifest.json └── index.html ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── advanced_error_handling │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── analysis_options.yaml ├── lib ├── main.dart ├── common │ └── validation │ │ ├── validation_rule.dart │ │ └── validation_service.dart ├── user │ ├── domain │ │ ├── model │ │ │ ├── user_request.dart │ │ │ └── rule │ │ │ │ └── user_request_validation_rule.dart │ │ ├── exception │ │ │ └── user_request_validation_exception.dart │ │ └── service │ │ │ └── user_request_client_validation_service.dart │ └── application │ │ └── bloc │ │ └── sign_up │ │ ├── sign_up_bloc_state.dart │ │ ├── sign_up_bloc.dart │ │ └── sign_up_bloc_state.freezed.dart └── app │ ├── app.dart │ └── screen │ ├── home │ └── home_screen.dart │ └── sign_up │ └── sign_up_screen.dart ├── lefthook.yml ├── .metadata ├── README.md ├── pubspec.yaml ├── test └── widget_test.dart ├── .gitignore └── pubspec.lock /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/web/favicon.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lint/analysis_options.yaml 2 | 3 | analyzer: 4 | exclude: 5 | - "**/*.g.dart" 6 | - "**/*.freezed.dart" -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:advanced_error_handling/app/app.dart'; 4 | 5 | void main() { 6 | runApp(App()); 7 | } 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: false 3 | commands: 4 | check-order-imports: 5 | tags: lint 6 | run: flutter pub run import_sorter:main --exit-if-changed 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/common/validation/validation_rule.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | 3 | abstract class ValidationRule { 4 | Either validate(T target); 5 | } 6 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duhyeokko/advanced-error-handling-in-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/advanced_error_handling/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.advanced_error_handling 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /lib/user/domain/model/user_request.dart: -------------------------------------------------------------------------------- 1 | class UserRequest { 2 | final String id; 3 | final String password; 4 | 5 | const UserRequest({ 6 | required this.id, 7 | required this.password, 8 | }); 9 | 10 | bool get isEmpty => id.isEmpty && password.isEmpty; 11 | } 12 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/user/domain/exception/user_request_validation_exception.dart: -------------------------------------------------------------------------------- 1 | import 'package:advanced_error_handling/user/domain/model/user_request.dart'; 2 | 3 | class UserRequestValidationException implements Exception { 4 | final UserRequest userRequest; 5 | final String message; 6 | 7 | const UserRequestValidationException({ 8 | required this.userRequest, 9 | required this.message, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # throw 안 쓰고 에러 의미 있게 처리하기 2 | 3 | [![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint) 4 | 5 | 2021.3.27(토) Flutter Engagement Extended Korea 세션 발표 자료 예시 코드 6 | 7 | [이벤트 페이지 - https://festa.io/events/1433](https://festa.io/events/1433) 8 | 9 | ## 설치 10 | 11 | ### Git hooks 설정 (Optional) 12 | 이 프로젝트에선 Lefthook을 사용하여 Git hook을 관리 합니다. 13 | 14 | [lefthook 설치 및 적용](https://github.com/Arkweid/lefthook/blob/master/docs/full_guide.md) -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: advanced_error_handling 2 | description: An example for advanced error handling 3 | publish_to: 'none' 4 | version: 1.0.0+1 5 | environment: 6 | sdk: '>=2.12.0 <3.0.0' 7 | 8 | dependencies: 9 | dartz: 0.10.0-nullsafety.1 10 | flutter: 11 | sdk: flutter 12 | freezed_annotation: 13 | rxdart: 0.26.0 14 | dev_dependencies: 15 | build_runner: 16 | flutter_test: 17 | sdk: flutter 18 | freezed: 19 | import_sorter: 4.4.2 20 | lint: 1.5.3 21 | 22 | flutter: 23 | uses-material-design: true 24 | 25 | import_sorter: 26 | comments: false 27 | -------------------------------------------------------------------------------- /lib/user/application/bloc/sign_up/sign_up_bloc_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'package:advanced_error_handling/user/domain/exception/user_request_validation_exception.dart'; 4 | import 'package:advanced_error_handling/user/domain/model/user_request.dart'; 5 | 6 | part 'sign_up_bloc_state.freezed.dart'; 7 | 8 | @freezed 9 | class SignUpBlocState with _$SignUpBlocState { 10 | const factory SignUpBlocState.empty() = Empty; 11 | const factory SignUpBlocState.error( 12 | Iterable exceptions) = Error; 13 | const factory SignUpBlocState.valid(UserRequest userRequest) = Valid; 14 | } 15 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "advanced_error_handling", 3 | "short_name": "advanced_error_handling", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "An example for advanced error handling", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/app/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:advanced_error_handling/app/screen/home/home_screen.dart'; 4 | import 'package:advanced_error_handling/app/screen/sign_up/sign_up_screen.dart'; 5 | 6 | class App extends StatelessWidget { 7 | // This widget is the root of your application. 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | title: 'Flutter Demo', 12 | theme: ThemeData( 13 | primarySwatch: Colors.blue, 14 | ), 15 | initialRoute: HomeScreen.routeName, 16 | routes: { 17 | HomeScreen.routeName: (_) => const HomeScreen(), 18 | SignUpScreen.routeName: (_) => const SignUpScreen(), 19 | }, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/common/validation/validation_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | 3 | import 'package:advanced_error_handling/common/validation/validation_rule.dart'; 4 | 5 | mixin ValidationService { 6 | Iterable> get rules; 7 | Either, T> validate(T target) { 8 | final results = rules.map((rule) => rule.validate(target)); 9 | 10 | if (results.every((result) => result.isRight())) { 11 | return right(target); 12 | } 13 | 14 | final it = results.where((result) => result.isLeft()).iterator; 15 | final exceptionList = []; 16 | 17 | while (it.moveNext()) { 18 | it.current.fold((l) { 19 | exceptionList.add(l); 20 | }, (r) {}); 21 | } 22 | 23 | return left(exceptionList); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | import 'package:advanced_error_handling/app/app.dart'; 6 | 7 | void main() { 8 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 9 | // Build our app and trigger a frame. 10 | await tester.pumpWidget(App()); 11 | 12 | // Verify that our counter starts at 0. 13 | expect(find.text('0'), findsOneWidget); 14 | expect(find.text('1'), findsNothing); 15 | 16 | // Tap the '+' icon and trigger a frame. 17 | await tester.tap(find.byIcon(Icons.add)); 18 | await tester.pump(); 19 | 20 | // Verify that our counter has incremented. 21 | expect(find.text('0'), findsNothing); 22 | expect(find.text('1'), findsOneWidget); 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/user/application/bloc/sign_up/sign_up_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:rxdart/rxdart.dart'; 2 | 3 | import 'package:advanced_error_handling/user/application/bloc/sign_up/sign_up_bloc_state.dart'; 4 | import 'package:advanced_error_handling/user/domain/model/user_request.dart'; 5 | import 'package:advanced_error_handling/user/domain/service/user_request_client_validation_service.dart'; 6 | 7 | class SignUpBloc { 8 | final SignUpBlocState initialState = const SignUpBlocState.empty(); 9 | final UserRequestClientValidationService userRequestClientValidationService; 10 | late final BehaviorSubject _stateSubject; 11 | 12 | SignUpBloc({ 13 | required this.userRequestClientValidationService, 14 | }) { 15 | _stateSubject = BehaviorSubject.seeded(initialState); 16 | } 17 | 18 | ValueStream get stream => _stateSubject.stream; 19 | SignUpBlocState get currentState => 20 | _stateSubject.value ?? const SignUpBlocState.empty(); 21 | 22 | void dispose() { 23 | _stateSubject.close(); 24 | } 25 | 26 | void updateUserRequest(UserRequest userRequest) { 27 | userRequest.isEmpty 28 | ? _stateSubject.sink.add(const SignUpBlocState.empty()) 29 | : userRequestClientValidationService.validate(userRequest).fold( 30 | (l) => _stateSubject.sink.add(SignUpBlocState.error(l)), 31 | (r) => _stateSubject.sink.add(SignUpBlocState.valid(r))); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/user/domain/service/user_request_client_validation_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:advanced_error_handling/common/validation/validation_rule.dart'; 2 | import 'package:advanced_error_handling/common/validation/validation_service.dart'; 3 | import 'package:advanced_error_handling/user/domain/exception/user_request_validation_exception.dart'; 4 | import 'package:advanced_error_handling/user/domain/model/rule/user_request_validation_rule.dart'; 5 | import 'package:advanced_error_handling/user/domain/model/user_request.dart'; 6 | 7 | class UserRequestClientValidationService 8 | with ValidationService { 9 | @override 10 | final List> rules; 11 | 12 | const UserRequestClientValidationService({ 13 | required this.rules, 14 | }); 15 | 16 | factory UserRequestClientValidationService.withDefaultRules() => 17 | UserRequestClientValidationService(rules: [ 18 | IdEmailRule(), 19 | PasswordMinimumLengthRule(minLength: 10), 20 | PasswordRestrictionUserNameRule(), 21 | PasswordRestrictionMostCommonRule(commonPasswords: [ 22 | '12345678', 23 | '123456789', 24 | '1234567890', 25 | '0123456789', 26 | '987654321', 27 | '00000000', 28 | '1q2w3e4r5t', 29 | 'qwer123456', 30 | 'qwertyuiop', 31 | 'a123456789', 32 | 'password123', 33 | ]) 34 | ]); 35 | } 36 | -------------------------------------------------------------------------------- /lib/app/screen/home/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:advanced_error_handling/app/screen/sign_up/sign_up_screen.dart'; 4 | 5 | class HomeScreen extends StatefulWidget { 6 | static const routeName = '/'; 7 | 8 | const HomeScreen({Key? key}) : super(key: key); 9 | 10 | @override 11 | _HomeScreenState createState() => _HomeScreenState(); 12 | } 13 | 14 | class _HomeScreenState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | final theme = Theme.of(context); 18 | return Scaffold( 19 | body: Center( 20 | child: Column( 21 | mainAxisSize: MainAxisSize.min, 22 | children: [ 23 | Text('throw 안 쓰고 에러 의미 있게 처리하기', style: theme.textTheme.headline6), 24 | Container( 25 | margin: const EdgeInsets.only(top: 16.0), 26 | child: ElevatedButton( 27 | onPressed: () { 28 | Navigator.of(context).pushNamed(SignUpScreen.routeName); 29 | }, 30 | child: Padding( 31 | padding: const EdgeInsets.symmetric( 32 | vertical: 16.0, 33 | horizontal: 24.0, 34 | ), 35 | child: Text( 36 | '회원 가입 예시', 37 | style: theme.textTheme.subtitle1?.copyWith( 38 | color: Colors.white, 39 | fontWeight: FontWeight.bold, 40 | ), 41 | ), 42 | ), 43 | ), 44 | ), 45 | ], 46 | ), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | advanced_error_handling 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | advanced_error_handling 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.advanced_error_handling" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/user/domain/model/rule/user_request_validation_rule.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | 3 | import 'package:advanced_error_handling/common/validation/validation_rule.dart'; 4 | import 'package:advanced_error_handling/user/domain/exception/user_request_validation_exception.dart'; 5 | import 'package:advanced_error_handling/user/domain/model/user_request.dart'; 6 | 7 | abstract class UserRequestValidationRule 8 | implements ValidationRule {} 9 | 10 | class IdEmailRule extends UserRequestValidationRule { 11 | final emailRegex = RegExp( 12 | r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+"); 13 | final errorMessage = '아이디는 이메일 형식으로 입력하셔야 해요!'; 14 | 15 | @override 16 | Either validate( 17 | UserRequest userRequest) { 18 | return emailRegex.hasMatch(userRequest.id) 19 | ? right(userRequest) 20 | : left( 21 | UserRequestValidationException( 22 | userRequest: userRequest, 23 | message: errorMessage, 24 | ), 25 | ); 26 | } 27 | } 28 | 29 | class PasswordMinimumLengthRule extends UserRequestValidationRule { 30 | final int minLength; 31 | String errorMessage(int inputLength, int minLength) => (inputLength == 0) 32 | ? '비밀번호를 $minLength자리 이상 입력하셔야 해요!' 33 | : '비밀번호를 $inputLength자리 입력하셨어요. $minLength자리 이상 입력하셔야 해킹당할 가능성이 줄어들어요!'; 34 | 35 | PasswordMinimumLengthRule({required this.minLength}); 36 | 37 | @override 38 | Either validate( 39 | UserRequest userRequest) { 40 | final inputLength = userRequest.password.length; 41 | 42 | return inputLength < minLength 43 | ? left(UserRequestValidationException( 44 | userRequest: userRequest, 45 | message: errorMessage(inputLength, minLength))) 46 | : right(userRequest); 47 | } 48 | } 49 | 50 | class PasswordRestrictionUserNameRule extends UserRequestValidationRule { 51 | final errorMessage = 52 | '사용자 이름을 비밀번호에 사용하셨어요. 비밀번호에서 사용자 이름을 제거하여 추측할 만한 단서를 제거하면 해킹당할 가능성이 줄어들어요!'; 53 | 54 | @override 55 | Either validate( 56 | UserRequest userRequest) { 57 | final userId = userRequest.id; 58 | final userName = userId.contains('@') ? userId.split('@')[0] : userId; 59 | 60 | return userId.isEmpty 61 | ? right(userRequest) 62 | : userRequest.password.contains(userName) 63 | ? left(UserRequestValidationException( 64 | userRequest: userRequest, message: errorMessage)) 65 | : right(userRequest); 66 | } 67 | } 68 | 69 | class PasswordRestrictionMostCommonRule extends UserRequestValidationRule { 70 | final errorMessage = 71 | '전 세계에서 제일 많이 쓰이는 비밀번호를 사용하셨어요. 남이 안 쓸만한 비밀번호를 사용하신다면 해킹당할 가능성이 줄어들어요!'; 72 | final List commonPasswords; 73 | 74 | PasswordRestrictionMostCommonRule({ 75 | required this.commonPasswords, 76 | }); 77 | 78 | @override 79 | Either validate( 80 | UserRequest userRequest) { 81 | final userPassword = userRequest.password; 82 | 83 | return userPassword.isEmpty 84 | ? right(userRequest) 85 | : commonPasswords.contains(userPassword) 86 | ? left(UserRequestValidationException( 87 | userRequest: userRequest, message: errorMessage)) 88 | : right(userRequest); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /lib/app/screen/sign_up/sign_up_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:advanced_error_handling/app/screen/home/home_screen.dart'; 4 | import 'package:advanced_error_handling/user/application/bloc/sign_up/sign_up_bloc.dart'; 5 | import 'package:advanced_error_handling/user/application/bloc/sign_up/sign_up_bloc_state.dart'; 6 | import 'package:advanced_error_handling/user/domain/model/user_request.dart'; 7 | import 'package:advanced_error_handling/user/domain/service/user_request_client_validation_service.dart'; 8 | 9 | class SignUpScreen extends StatefulWidget { 10 | static const routeName = '/sign-up'; 11 | 12 | const SignUpScreen({Key? key}) : super(key: key); 13 | 14 | @override 15 | _SignUpScreenState createState() => _SignUpScreenState(); 16 | } 17 | 18 | class _SignUpScreenState extends State { 19 | final idTextEditingController = TextEditingController(); 20 | final passwordTextEditingController = TextEditingController(); 21 | final signUpBloc = SignUpBloc( 22 | userRequestClientValidationService: 23 | UserRequestClientValidationService.withDefaultRules()); 24 | 25 | @override 26 | void initState() { 27 | super.initState(); 28 | idTextEditingController.addListener(_updateUserRequest); 29 | passwordTextEditingController.addListener(_updateUserRequest); 30 | } 31 | 32 | void _updateUserRequest() { 33 | signUpBloc.updateUserRequest(UserRequest( 34 | id: idTextEditingController.text, 35 | password: passwordTextEditingController.text, 36 | )); 37 | } 38 | 39 | @override 40 | void dispose() { 41 | signUpBloc.dispose(); 42 | super.dispose(); 43 | } 44 | 45 | @override 46 | Widget build(BuildContext context) { 47 | final theme = Theme.of(context); 48 | return Scaffold( 49 | appBar: AppBar(title: const Text('회원 가입')), 50 | body: Padding( 51 | padding: const EdgeInsets.all(16), 52 | child: Column( 53 | mainAxisSize: MainAxisSize.min, 54 | crossAxisAlignment: CrossAxisAlignment.start, 55 | children: _buildFormItems(theme), 56 | ), 57 | ), 58 | floatingActionButton: _buildFloatingActionButton(), 59 | ); 60 | } 61 | 62 | Widget _buildFloatingActionButton() { 63 | return StreamBuilder( 64 | initialData: signUpBloc.initialState, 65 | stream: signUpBloc.stream, 66 | builder: (_, snapshot) { 67 | final state = snapshot.data!; 68 | return FloatingActionButton( 69 | backgroundColor: _buildBackgroundColor(state), 70 | onPressed: () async { 71 | await _showAlertDialog(state); 72 | }, 73 | child: _buildIcon(state), 74 | ); 75 | }, 76 | ); 77 | } 78 | 79 | MaterialColor _buildBackgroundColor(SignUpBlocState state) { 80 | return state.when( 81 | empty: () => Colors.grey, 82 | error: (exceptions) => Colors.red, 83 | valid: (_) => Colors.blue, 84 | ); 85 | } 86 | 87 | Icon _buildIcon(SignUpBlocState state) { 88 | return state.when( 89 | empty: () => const Icon(Icons.arrow_forward), 90 | error: (exceptions) => const Icon(Icons.close), 91 | valid: (_) => const Icon(Icons.arrow_forward), 92 | ); 93 | } 94 | 95 | Future _showAlertDialog(SignUpBlocState state) async { 96 | await state.when( 97 | empty: () async { 98 | await showDialog( 99 | context: context, 100 | builder: (_) { 101 | return AlertDialog( 102 | title: const Text('값을 채워 주세요!'), 103 | actions: [ 104 | TextButton( 105 | onPressed: Navigator.of(context).pop, 106 | child: const Text('값 채우기'), 107 | ) 108 | ], 109 | ); 110 | }); 111 | }, 112 | error: (_) async {}, 113 | valid: (_) async { 114 | await showDialog( 115 | context: context, 116 | builder: (_) { 117 | return AlertDialog( 118 | title: const Text('회원 가입이 완료되었습니다.'), 119 | actions: [ 120 | TextButton( 121 | onPressed: () { 122 | FocusManager.instance.primaryFocus?.unfocus(); 123 | Navigator.of(context).popUntil( 124 | (route) => route.settings.name == HomeScreen.routeName, 125 | ); 126 | }, 127 | child: const Text('처음 화면으로 돌아가기'), 128 | ) 129 | ], 130 | ); 131 | }, 132 | ); 133 | }, 134 | ); 135 | } 136 | 137 | List _buildFormItems(ThemeData theme) { 138 | return [ 139 | TextField( 140 | controller: idTextEditingController, 141 | autofocus: true, 142 | keyboardType: TextInputType.emailAddress, 143 | decoration: const InputDecoration( 144 | hintText: '아이디를 이메일로 입력해 주세요.', 145 | ), 146 | style: theme.textTheme.headline5?.copyWith(letterSpacing: -1), 147 | ), 148 | const SizedBox(height: 24), 149 | TextField( 150 | controller: passwordTextEditingController, 151 | autofocus: true, 152 | keyboardType: TextInputType.emailAddress, 153 | decoration: const InputDecoration( 154 | hintText: '비밀번호를 입력해 주세요.', 155 | ), 156 | style: theme.textTheme.headline5?.copyWith(letterSpacing: -1), 157 | ), 158 | const SizedBox(height: 8), 159 | _buildInfoMessageWrapper(theme), 160 | ]; 161 | } 162 | 163 | Widget _buildInfoMessageWrapper(ThemeData theme) { 164 | return StreamBuilder( 165 | initialData: signUpBloc.initialState, 166 | stream: signUpBloc.stream, 167 | builder: (context, snapshot) { 168 | final state = snapshot.data!; 169 | return state.when( 170 | empty: () => const SizedBox(width: 0, height: 0), 171 | error: (exceptions) => _buildErrorMessage( 172 | theme, 173 | exceptions.map((e) => e.message), 174 | ), 175 | valid: (_) => const SizedBox(width: 0, height: 0), 176 | ); 177 | }, 178 | ); 179 | } 180 | 181 | Widget _buildErrorMessage(ThemeData theme, Iterable messages) { 182 | return Column( 183 | mainAxisSize: MainAxisSize.min, 184 | crossAxisAlignment: CrossAxisAlignment.start, 185 | children: messages 186 | .map( 187 | (message) => Container( 188 | margin: const EdgeInsets.only(top: 8), 189 | child: Text( 190 | message, 191 | style: theme.textTheme.bodyText2?.copyWith( 192 | letterSpacing: -0.4, 193 | ), 194 | ), 195 | ), 196 | ) 197 | .toList(), 198 | ); 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "18.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.2.0" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.0.0" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.5.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.0" 39 | build: 40 | dependency: transitive 41 | description: 42 | name: build 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.6.3" 46 | build_config: 47 | dependency: transitive 48 | description: 49 | name: build_config 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.4.6" 53 | build_daemon: 54 | dependency: transitive 55 | description: 56 | name: build_daemon 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.10" 60 | build_resolvers: 61 | dependency: transitive 62 | description: 63 | name: build_resolvers 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.5.4" 67 | build_runner: 68 | dependency: "direct dev" 69 | description: 70 | name: build_runner 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.11.5" 74 | build_runner_core: 75 | dependency: transitive 76 | description: 77 | name: build_runner_core 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "6.1.10" 81 | built_collection: 82 | dependency: transitive 83 | description: 84 | name: built_collection 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "5.0.0" 88 | built_value: 89 | dependency: transitive 90 | description: 91 | name: built_value 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "8.0.3" 95 | characters: 96 | dependency: transitive 97 | description: 98 | name: characters 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.1.0" 102 | charcode: 103 | dependency: transitive 104 | description: 105 | name: charcode 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.2.0" 109 | checked_yaml: 110 | dependency: transitive 111 | description: 112 | name: checked_yaml 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.0.4" 116 | cli_util: 117 | dependency: transitive 118 | description: 119 | name: cli_util 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.3.0" 123 | clock: 124 | dependency: transitive 125 | description: 126 | name: clock 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.1.0" 130 | code_builder: 131 | dependency: transitive 132 | description: 133 | name: code_builder 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "3.7.0" 137 | collection: 138 | dependency: transitive 139 | description: 140 | name: collection 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.15.0" 144 | convert: 145 | dependency: transitive 146 | description: 147 | name: convert 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "3.0.0" 151 | crypto: 152 | dependency: transitive 153 | description: 154 | name: crypto 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "3.0.0" 158 | dart_style: 159 | dependency: transitive 160 | description: 161 | name: dart_style 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "1.3.14" 165 | dartz: 166 | dependency: "direct main" 167 | description: 168 | name: dartz 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "0.10.0-nullsafety.1" 172 | fake_async: 173 | dependency: transitive 174 | description: 175 | name: fake_async 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "1.2.0" 179 | file: 180 | dependency: transitive 181 | description: 182 | name: file 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "6.1.0" 186 | fixnum: 187 | dependency: transitive 188 | description: 189 | name: fixnum 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "1.0.0" 193 | flutter: 194 | dependency: "direct main" 195 | description: flutter 196 | source: sdk 197 | version: "0.0.0" 198 | flutter_test: 199 | dependency: "direct dev" 200 | description: flutter 201 | source: sdk 202 | version: "0.0.0" 203 | freezed: 204 | dependency: "direct dev" 205 | description: 206 | name: freezed 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "0.14.1" 210 | freezed_annotation: 211 | dependency: "direct main" 212 | description: 213 | name: freezed_annotation 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "0.14.1" 217 | glob: 218 | dependency: transitive 219 | description: 220 | name: glob 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "2.0.0" 224 | graphs: 225 | dependency: transitive 226 | description: 227 | name: graphs 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "0.2.0" 231 | http_multi_server: 232 | dependency: transitive 233 | description: 234 | name: http_multi_server 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "2.2.0" 238 | http_parser: 239 | dependency: transitive 240 | description: 241 | name: http_parser 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "4.0.0" 245 | import_sorter: 246 | dependency: "direct dev" 247 | description: 248 | name: import_sorter 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "4.4.2" 252 | io: 253 | dependency: transitive 254 | description: 255 | name: io 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "0.3.5" 259 | js: 260 | dependency: transitive 261 | description: 262 | name: js 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "0.6.3" 266 | json_annotation: 267 | dependency: transitive 268 | description: 269 | name: json_annotation 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "4.0.0" 273 | lint: 274 | dependency: "direct dev" 275 | description: 276 | name: lint 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "1.5.3" 280 | logging: 281 | dependency: transitive 282 | description: 283 | name: logging 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "1.0.0" 287 | matcher: 288 | dependency: transitive 289 | description: 290 | name: matcher 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "0.12.10" 294 | meta: 295 | dependency: transitive 296 | description: 297 | name: meta 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "1.3.0" 301 | mime: 302 | dependency: transitive 303 | description: 304 | name: mime 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "1.0.0" 308 | package_config: 309 | dependency: transitive 310 | description: 311 | name: package_config 312 | url: "https://pub.dartlang.org" 313 | source: hosted 314 | version: "2.0.0" 315 | path: 316 | dependency: transitive 317 | description: 318 | name: path 319 | url: "https://pub.dartlang.org" 320 | source: hosted 321 | version: "1.8.0" 322 | pedantic: 323 | dependency: transitive 324 | description: 325 | name: pedantic 326 | url: "https://pub.dartlang.org" 327 | source: hosted 328 | version: "1.11.0" 329 | pool: 330 | dependency: transitive 331 | description: 332 | name: pool 333 | url: "https://pub.dartlang.org" 334 | source: hosted 335 | version: "1.5.0" 336 | pub_semver: 337 | dependency: transitive 338 | description: 339 | name: pub_semver 340 | url: "https://pub.dartlang.org" 341 | source: hosted 342 | version: "2.0.0" 343 | pubspec_parse: 344 | dependency: transitive 345 | description: 346 | name: pubspec_parse 347 | url: "https://pub.dartlang.org" 348 | source: hosted 349 | version: "0.1.8" 350 | rxdart: 351 | dependency: "direct main" 352 | description: 353 | name: rxdart 354 | url: "https://pub.dartlang.org" 355 | source: hosted 356 | version: "0.26.0" 357 | shelf: 358 | dependency: transitive 359 | description: 360 | name: shelf 361 | url: "https://pub.dartlang.org" 362 | source: hosted 363 | version: "1.1.0" 364 | shelf_web_socket: 365 | dependency: transitive 366 | description: 367 | name: shelf_web_socket 368 | url: "https://pub.dartlang.org" 369 | source: hosted 370 | version: "0.2.4+1" 371 | sky_engine: 372 | dependency: transitive 373 | description: flutter 374 | source: sdk 375 | version: "0.0.99" 376 | source_gen: 377 | dependency: transitive 378 | description: 379 | name: source_gen 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "0.9.10+3" 383 | source_span: 384 | dependency: transitive 385 | description: 386 | name: source_span 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "1.8.0" 390 | stack_trace: 391 | dependency: transitive 392 | description: 393 | name: stack_trace 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "1.10.0" 397 | stream_channel: 398 | dependency: transitive 399 | description: 400 | name: stream_channel 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "2.1.0" 404 | stream_transform: 405 | dependency: transitive 406 | description: 407 | name: stream_transform 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "2.0.0" 411 | string_scanner: 412 | dependency: transitive 413 | description: 414 | name: string_scanner 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "1.1.0" 418 | term_glyph: 419 | dependency: transitive 420 | description: 421 | name: term_glyph 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "1.2.0" 425 | test_api: 426 | dependency: transitive 427 | description: 428 | name: test_api 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "0.2.19" 432 | timing: 433 | dependency: transitive 434 | description: 435 | name: timing 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "0.1.1+3" 439 | tint: 440 | dependency: transitive 441 | description: 442 | name: tint 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "2.0.0" 446 | typed_data: 447 | dependency: transitive 448 | description: 449 | name: typed_data 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "1.3.0" 453 | vector_math: 454 | dependency: transitive 455 | description: 456 | name: vector_math 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "2.1.0" 460 | watcher: 461 | dependency: transitive 462 | description: 463 | name: watcher 464 | url: "https://pub.dartlang.org" 465 | source: hosted 466 | version: "1.0.0" 467 | web_socket_channel: 468 | dependency: transitive 469 | description: 470 | name: web_socket_channel 471 | url: "https://pub.dartlang.org" 472 | source: hosted 473 | version: "1.2.0" 474 | yaml: 475 | dependency: transitive 476 | description: 477 | name: yaml 478 | url: "https://pub.dartlang.org" 479 | source: hosted 480 | version: "3.1.0" 481 | sdks: 482 | dart: ">=2.12.0 <3.0.0" 483 | -------------------------------------------------------------------------------- /lib/user/application/bloc/sign_up/sign_up_bloc_state.freezed.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides 3 | 4 | part of 'sign_up_bloc_state.dart'; 5 | 6 | // ************************************************************************** 7 | // FreezedGenerator 8 | // ************************************************************************** 9 | 10 | T _$identity(T value) => value; 11 | 12 | final _privateConstructorUsedError = UnsupportedError( 13 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); 14 | 15 | /// @nodoc 16 | class _$SignUpBlocStateTearOff { 17 | const _$SignUpBlocStateTearOff(); 18 | 19 | Empty empty() { 20 | return const Empty(); 21 | } 22 | 23 | Error error(Iterable exceptions) { 24 | return Error( 25 | exceptions, 26 | ); 27 | } 28 | 29 | Valid valid(UserRequest userRequest) { 30 | return Valid( 31 | userRequest, 32 | ); 33 | } 34 | } 35 | 36 | /// @nodoc 37 | const $SignUpBlocState = _$SignUpBlocStateTearOff(); 38 | 39 | /// @nodoc 40 | mixin _$SignUpBlocState { 41 | @optionalTypeArgs 42 | TResult when({ 43 | required TResult Function() empty, 44 | required TResult Function( 45 | Iterable exceptions) 46 | error, 47 | required TResult Function(UserRequest userRequest) valid, 48 | }) => 49 | throw _privateConstructorUsedError; 50 | @optionalTypeArgs 51 | TResult maybeWhen({ 52 | TResult Function()? empty, 53 | TResult Function(Iterable exceptions)? 54 | error, 55 | TResult Function(UserRequest userRequest)? valid, 56 | required TResult orElse(), 57 | }) => 58 | throw _privateConstructorUsedError; 59 | @optionalTypeArgs 60 | TResult map({ 61 | required TResult Function(Empty value) empty, 62 | required TResult Function(Error value) error, 63 | required TResult Function(Valid value) valid, 64 | }) => 65 | throw _privateConstructorUsedError; 66 | @optionalTypeArgs 67 | TResult maybeMap({ 68 | TResult Function(Empty value)? empty, 69 | TResult Function(Error value)? error, 70 | TResult Function(Valid value)? valid, 71 | required TResult orElse(), 72 | }) => 73 | throw _privateConstructorUsedError; 74 | } 75 | 76 | /// @nodoc 77 | abstract class $SignUpBlocStateCopyWith<$Res> { 78 | factory $SignUpBlocStateCopyWith( 79 | SignUpBlocState value, $Res Function(SignUpBlocState) then) = 80 | _$SignUpBlocStateCopyWithImpl<$Res>; 81 | } 82 | 83 | /// @nodoc 84 | class _$SignUpBlocStateCopyWithImpl<$Res> 85 | implements $SignUpBlocStateCopyWith<$Res> { 86 | _$SignUpBlocStateCopyWithImpl(this._value, this._then); 87 | 88 | final SignUpBlocState _value; 89 | // ignore: unused_field 90 | final $Res Function(SignUpBlocState) _then; 91 | } 92 | 93 | /// @nodoc 94 | abstract class $EmptyCopyWith<$Res> { 95 | factory $EmptyCopyWith(Empty value, $Res Function(Empty) then) = 96 | _$EmptyCopyWithImpl<$Res>; 97 | } 98 | 99 | /// @nodoc 100 | class _$EmptyCopyWithImpl<$Res> extends _$SignUpBlocStateCopyWithImpl<$Res> 101 | implements $EmptyCopyWith<$Res> { 102 | _$EmptyCopyWithImpl(Empty _value, $Res Function(Empty) _then) 103 | : super(_value, (v) => _then(v as Empty)); 104 | 105 | @override 106 | Empty get _value => super._value as Empty; 107 | } 108 | 109 | /// @nodoc 110 | class _$Empty implements Empty { 111 | const _$Empty(); 112 | 113 | @override 114 | String toString() { 115 | return 'SignUpBlocState.empty()'; 116 | } 117 | 118 | @override 119 | bool operator ==(dynamic other) { 120 | return identical(this, other) || (other is Empty); 121 | } 122 | 123 | @override 124 | int get hashCode => runtimeType.hashCode; 125 | 126 | @override 127 | @optionalTypeArgs 128 | TResult when({ 129 | required TResult Function() empty, 130 | required TResult Function( 131 | Iterable exceptions) 132 | error, 133 | required TResult Function(UserRequest userRequest) valid, 134 | }) { 135 | return empty(); 136 | } 137 | 138 | @override 139 | @optionalTypeArgs 140 | TResult maybeWhen({ 141 | TResult Function()? empty, 142 | TResult Function(Iterable exceptions)? 143 | error, 144 | TResult Function(UserRequest userRequest)? valid, 145 | required TResult orElse(), 146 | }) { 147 | if (empty != null) { 148 | return empty(); 149 | } 150 | return orElse(); 151 | } 152 | 153 | @override 154 | @optionalTypeArgs 155 | TResult map({ 156 | required TResult Function(Empty value) empty, 157 | required TResult Function(Error value) error, 158 | required TResult Function(Valid value) valid, 159 | }) { 160 | return empty(this); 161 | } 162 | 163 | @override 164 | @optionalTypeArgs 165 | TResult maybeMap({ 166 | TResult Function(Empty value)? empty, 167 | TResult Function(Error value)? error, 168 | TResult Function(Valid value)? valid, 169 | required TResult orElse(), 170 | }) { 171 | if (empty != null) { 172 | return empty(this); 173 | } 174 | return orElse(); 175 | } 176 | } 177 | 178 | abstract class Empty implements SignUpBlocState { 179 | const factory Empty() = _$Empty; 180 | } 181 | 182 | /// @nodoc 183 | abstract class $ErrorCopyWith<$Res> { 184 | factory $ErrorCopyWith(Error value, $Res Function(Error) then) = 185 | _$ErrorCopyWithImpl<$Res>; 186 | $Res call({Iterable exceptions}); 187 | } 188 | 189 | /// @nodoc 190 | class _$ErrorCopyWithImpl<$Res> extends _$SignUpBlocStateCopyWithImpl<$Res> 191 | implements $ErrorCopyWith<$Res> { 192 | _$ErrorCopyWithImpl(Error _value, $Res Function(Error) _then) 193 | : super(_value, (v) => _then(v as Error)); 194 | 195 | @override 196 | Error get _value => super._value as Error; 197 | 198 | @override 199 | $Res call({ 200 | Object? exceptions = freezed, 201 | }) { 202 | return _then(Error( 203 | exceptions == freezed 204 | ? _value.exceptions 205 | : exceptions // ignore: cast_nullable_to_non_nullable 206 | as Iterable, 207 | )); 208 | } 209 | } 210 | 211 | /// @nodoc 212 | class _$Error implements Error { 213 | const _$Error(this.exceptions); 214 | 215 | @override 216 | final Iterable exceptions; 217 | 218 | @override 219 | String toString() { 220 | return 'SignUpBlocState.error(exceptions: $exceptions)'; 221 | } 222 | 223 | @override 224 | bool operator ==(dynamic other) { 225 | return identical(this, other) || 226 | (other is Error && 227 | (identical(other.exceptions, exceptions) || 228 | const DeepCollectionEquality() 229 | .equals(other.exceptions, exceptions))); 230 | } 231 | 232 | @override 233 | int get hashCode => 234 | runtimeType.hashCode ^ const DeepCollectionEquality().hash(exceptions); 235 | 236 | @JsonKey(ignore: true) 237 | @override 238 | $ErrorCopyWith get copyWith => 239 | _$ErrorCopyWithImpl(this, _$identity); 240 | 241 | @override 242 | @optionalTypeArgs 243 | TResult when({ 244 | required TResult Function() empty, 245 | required TResult Function( 246 | Iterable exceptions) 247 | error, 248 | required TResult Function(UserRequest userRequest) valid, 249 | }) { 250 | return error(exceptions); 251 | } 252 | 253 | @override 254 | @optionalTypeArgs 255 | TResult maybeWhen({ 256 | TResult Function()? empty, 257 | TResult Function(Iterable exceptions)? 258 | error, 259 | TResult Function(UserRequest userRequest)? valid, 260 | required TResult orElse(), 261 | }) { 262 | if (error != null) { 263 | return error(exceptions); 264 | } 265 | return orElse(); 266 | } 267 | 268 | @override 269 | @optionalTypeArgs 270 | TResult map({ 271 | required TResult Function(Empty value) empty, 272 | required TResult Function(Error value) error, 273 | required TResult Function(Valid value) valid, 274 | }) { 275 | return error(this); 276 | } 277 | 278 | @override 279 | @optionalTypeArgs 280 | TResult maybeMap({ 281 | TResult Function(Empty value)? empty, 282 | TResult Function(Error value)? error, 283 | TResult Function(Valid value)? valid, 284 | required TResult orElse(), 285 | }) { 286 | if (error != null) { 287 | return error(this); 288 | } 289 | return orElse(); 290 | } 291 | } 292 | 293 | abstract class Error implements SignUpBlocState { 294 | const factory Error(Iterable exceptions) = 295 | _$Error; 296 | 297 | Iterable get exceptions => 298 | throw _privateConstructorUsedError; 299 | @JsonKey(ignore: true) 300 | $ErrorCopyWith get copyWith => throw _privateConstructorUsedError; 301 | } 302 | 303 | /// @nodoc 304 | abstract class $ValidCopyWith<$Res> { 305 | factory $ValidCopyWith(Valid value, $Res Function(Valid) then) = 306 | _$ValidCopyWithImpl<$Res>; 307 | $Res call({UserRequest userRequest}); 308 | } 309 | 310 | /// @nodoc 311 | class _$ValidCopyWithImpl<$Res> extends _$SignUpBlocStateCopyWithImpl<$Res> 312 | implements $ValidCopyWith<$Res> { 313 | _$ValidCopyWithImpl(Valid _value, $Res Function(Valid) _then) 314 | : super(_value, (v) => _then(v as Valid)); 315 | 316 | @override 317 | Valid get _value => super._value as Valid; 318 | 319 | @override 320 | $Res call({ 321 | Object? userRequest = freezed, 322 | }) { 323 | return _then(Valid( 324 | userRequest == freezed 325 | ? _value.userRequest 326 | : userRequest // ignore: cast_nullable_to_non_nullable 327 | as UserRequest, 328 | )); 329 | } 330 | } 331 | 332 | /// @nodoc 333 | class _$Valid implements Valid { 334 | const _$Valid(this.userRequest); 335 | 336 | @override 337 | final UserRequest userRequest; 338 | 339 | @override 340 | String toString() { 341 | return 'SignUpBlocState.valid(userRequest: $userRequest)'; 342 | } 343 | 344 | @override 345 | bool operator ==(dynamic other) { 346 | return identical(this, other) || 347 | (other is Valid && 348 | (identical(other.userRequest, userRequest) || 349 | const DeepCollectionEquality() 350 | .equals(other.userRequest, userRequest))); 351 | } 352 | 353 | @override 354 | int get hashCode => 355 | runtimeType.hashCode ^ const DeepCollectionEquality().hash(userRequest); 356 | 357 | @JsonKey(ignore: true) 358 | @override 359 | $ValidCopyWith get copyWith => 360 | _$ValidCopyWithImpl(this, _$identity); 361 | 362 | @override 363 | @optionalTypeArgs 364 | TResult when({ 365 | required TResult Function() empty, 366 | required TResult Function( 367 | Iterable exceptions) 368 | error, 369 | required TResult Function(UserRequest userRequest) valid, 370 | }) { 371 | return valid(userRequest); 372 | } 373 | 374 | @override 375 | @optionalTypeArgs 376 | TResult maybeWhen({ 377 | TResult Function()? empty, 378 | TResult Function(Iterable exceptions)? 379 | error, 380 | TResult Function(UserRequest userRequest)? valid, 381 | required TResult orElse(), 382 | }) { 383 | if (valid != null) { 384 | return valid(userRequest); 385 | } 386 | return orElse(); 387 | } 388 | 389 | @override 390 | @optionalTypeArgs 391 | TResult map({ 392 | required TResult Function(Empty value) empty, 393 | required TResult Function(Error value) error, 394 | required TResult Function(Valid value) valid, 395 | }) { 396 | return valid(this); 397 | } 398 | 399 | @override 400 | @optionalTypeArgs 401 | TResult maybeMap({ 402 | TResult Function(Empty value)? empty, 403 | TResult Function(Error value)? error, 404 | TResult Function(Valid value)? valid, 405 | required TResult orElse(), 406 | }) { 407 | if (valid != null) { 408 | return valid(this); 409 | } 410 | return orElse(); 411 | } 412 | } 413 | 414 | abstract class Valid implements SignUpBlocState { 415 | const factory Valid(UserRequest userRequest) = _$Valid; 416 | 417 | UserRequest get userRequest => throw _privateConstructorUsedError; 418 | @JsonKey(ignore: true) 419 | $ValidCopyWith get copyWith => throw _privateConstructorUsedError; 420 | } 421 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.advancedErrorHandling; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.advancedErrorHandling; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.advancedErrorHandling; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | --------------------------------------------------------------------------------