Compare commits

...
Author SHA1 Message Date
hugo f558685f11 chore(release): publish packages
- form_bloc_example@1.1.0
 - wyatt_form_bloc@0.0.3
 - authentication_bloc_example@1.0.1
 - wyatt_authentication_bloc@0.2.1+1
2022-07-10 22:12:37 +02:00
hugo b21aa04557 fix(auth): update form plugin and fix auth 2022-07-10 22:11:16 +02:00
hugo 01df7a0dff fix: ignore google services 2022-07-10 22:10:40 +02:00
hugo 8909274543 feat(form): add helpers 2022-07-10 22:10:12 +02:00
hugo 89f94cf1ff Merge pull request 'form/feature/add_metadata' (#10) from form/feature/add_metadata into master
Reviewed-on: #10
2022-07-10 19:23:54 +00:00
hugo 65774010aa Merge branch 'master' into form/feature/add_metadata 2022-07-10 19:23:40 +00:00
hugo 42810c4fb3 Merge pull request 'chore(deps): update dependency flutter_lints to v2' (#4) from renovate/flutter_lints-2.x into master
Reviewed-on: #4
2022-07-10 19:23:17 +00:00
hugo 39d19b4c7b Merge branch 'master' into renovate/flutter_lints-2.x 2022-07-10 19:23:12 +00:00
hugo 8a0af954bf doc: remove deprecated FormEntry 2022-07-10 21:15:33 +02:00
hugo 94b0ff01ad doc: update readme with usage 2022-07-10 21:13:52 +02:00
hugo 741f05e1be doc: update example 2022-07-10 21:13:43 +02:00
hugo d0f1d07363 feat: add metadata on inputs 2022-07-10 21:13:13 +02:00
hugo 08ac6d8fda feat: update to latest dart version 2022-07-10 21:12:55 +02:00
hugo 9203df94a0 chore(release): publish packages
- wyatt_http_client@1.2.0
2022-06-24 16:01:45 +02:00
hugo a7204f588f Merge pull request 'Feature/middlewares' (#9) from Feature/middlewares into master
Reviewed-on: #9
2022-06-24 14:00:03 +00:00
hugo 81367e5f3a feat(http): add new middleware feature 2022-06-24 15:58:48 +02:00
hugo 14cb3485e4 feat(http): implements doublelinked list for middlewares 2022-06-24 10:47:28 +02:00
hugo 58d3b70bee feat(http): [WIP] implements middleware system 2022-06-23 17:07:04 +02:00
hugo ea4a30ca00 feat(http): [WIP] work on middleware feature 2022-06-23 11:48:32 +02:00
Renovate 83b75ee0e5 chore(deps): update dependency flutter_lints to v2 2022-06-01 14:25:58 +00:00
hugo 9e9ec9ba9b docs(bloc): update license 2022-05-23 21:22:38 +02:00
hugo a98c41f461 chore(release): publish packages
- wyatt_http_client@1.1.0
2022-05-23 20:38:24 +02:00
hugo 9064d5bd34 doc(cli): update readme 2022-05-23 20:37:51 +02:00
hugo de00c532c8 feat(http): add oauth2 refresh token client 2022-05-23 20:37:26 +02:00
hugo 8892337b93 chore(http): add new package 2022-05-23 16:29:44 +02:00
Malo Léon 15b9f979a2 chore(release): publish packages
- wyatt_analysis@2.1.0
2022-05-23 15:51:18 +02:00
Malo Léon a146adfd16 feat(analysis): add experimental rules in appropriate file 2022-05-23 15:18:31 +02:00
Malo Léon 4aed98ef04 docs(packages): update doc with details on allowed types in commits 2022-05-23 15:17:03 +02:00
hugo 7a89704c0b chore(cli): add new package 2022-05-22 23:28:23 +02:00
hugo d60ff3ee27 chore(release): publish packages
- wyatt_authentication_bloc@0.2.1
 - wyatt_bloc_helper@1.1.0
2022-05-20 22:33:30 +02:00
hugo 9ef37633cb feat(bloc): add provider, consumer and helpers 2022-05-20 22:32:30 +02:00
hugo 2ac2b4d2be chore(bloc): add new package 2022-05-20 22:31:46 +02:00
hugo dffa91eb23 chore(release): publish packages
- wyatt_medium_feeds@1.0.1
2022-05-05 21:29:48 +02:00
hugo 164877bb0b fix(medium): remove useless example file 2022-05-05 21:29:25 +02:00
hugo c787b065ad chore(medium): add new package 2022-05-05 21:26:04 +02:00
hugo 12f9cf6aa5 feat(auth): add google, facebook, apple, twitter login 2022-05-04 22:50:07 +02:00
hugo 74db784973 chore(release): publish packages
- wyatt_form_bloc@0.0.2
 - wyatt_authentication_bloc@0.2.0+1
2022-05-02 14:44:17 +02:00
hugo fe5fa692f7 feat(form): add list option validator 2022-05-02 14:41:24 +02:00
hugo 5ea5c510cb chore(release): publish packages
- wyatt_crud_bloc@0.0.2
 - wyatt_analysis@2.0.1
2022-04-20 23:12:12 +02:00
hugo bb264b7362 docs: update readme with some instructions 2022-04-20 23:08:59 +02:00
hugo 17ae855ffb docs(crud): add example app 2022-04-20 23:08:37 +02:00
hugo b38fea130f feat(crud) : new package for crud operations 2022-04-20 22:57:14 +02:00
hugo e3776259df style(auth): update analysis options 2022-04-20 22:54:00 +02:00
hugo 371cc33e3a chore(release): publish packages
- wyatt_authentication_bloc@0.2.0
2022-04-20 18:55:29 +02:00
hugo 3cbc268dea fix(auth): example needs multidex support 2022-04-20 18:55:12 +02:00
hugo 99b6a0a335 remove firebase_options secret file 2022-04-20 18:47:35 +02:00
hugo 88719576b7 bump(auth): upgrade form_bloc package 2022-04-20 18:37:27 +02:00
hugo d191afad33 chore(release): publish packages
- wyatt_form_bloc@0.0.1
2022-04-20 18:28:09 +02:00
hugo 7e433fc0dd docs: fix analyzer badge in root readme 2022-04-20 18:26:57 +02:00
hugo 27015b63d9 feat(auth)!: use form_bloc package 2022-04-20 18:25:46 +02:00
hugo 703e3deeaf fix(form)!: change validate() to selfValidate() 2022-04-20 18:23:05 +02:00
hugo b6b42f9366 chore(analysis): add vscode files 2022-04-20 00:06:37 +02:00
363 changed files with 15243 additions and 2504 deletions
+1
View File
@@ -196,3 +196,4 @@ $RECYCLE.BIN/
.idea/
*.iml
google-services.json
+253
View File
@@ -3,6 +3,259 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 2022-07-10
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`form_bloc_example` - `v1.1.0`](#form_bloc_example---v110)
- [`wyatt_form_bloc` - `v0.0.3`](#wyatt_form_bloc---v003)
- [`authentication_bloc_example` - `v1.0.1`](#authentication_bloc_example---v101)
- [`wyatt_authentication_bloc` - `v0.2.1+1`](#wyatt_authentication_bloc---v0211)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `authentication_bloc_example` - `v1.0.1`
- `wyatt_authentication_bloc` - `v0.2.1+1`
---
#### `form_bloc_example` - `v1.1.0`
- **FEAT**: add list option validator.
- **DOCS**: add example app.
#### `wyatt_form_bloc` - `v0.0.3`
- **FEAT**: add helpers.
- **FEAT**: add metadata on inputs.
- **FEAT**: update to latest dart version.
## 2022-06-24
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_http_client` - `v1.2.0`](#wyatt_http_client---v120)
---
#### `wyatt_http_client` - `v1.2.0`
- **FEAT**: add new middleware feature.
- **FEAT**: implements doublelinked list for middlewares.
- **FEAT**: [WIP] implements middleware system.
- **FEAT**: [WIP] work on middleware feature.
## 2022-05-23
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_http_client` - `v1.1.0`](#wyatt_http_client---v110)
---
#### `wyatt_http_client` - `v1.1.0`
- **FEAT**: add oauth2 refresh token client.
## 2022-05-23
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_analysis` - `v2.1.0`](#wyatt_analysis---v210)
---
#### `wyatt_analysis` - `v2.1.0`
- **FEAT**: add experimental rules in appropriate file.
## 2022-05-20
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_authentication_bloc` - `v0.2.1`](#wyatt_authentication_bloc---v021)
- [`wyatt_bloc_helper` - `v1.1.0`](#wyatt_bloc_helper---v110)
---
#### `wyatt_authentication_bloc` - `v0.2.1`
- **FEAT**: add google, facebook, apple, twitter login.
#### `wyatt_bloc_helper` - `v1.1.0`
- **FEAT**: add provider, consumer and helpers.
## 2022-05-05
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_medium_feeds` - `v1.0.1`](#wyatt_medium_feeds---v101)
---
#### `wyatt_medium_feeds` - `v1.0.1`
- **FIX**: remove useless example file.
## 2022-05-02
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_form_bloc` - `v0.0.2`](#wyatt_form_bloc---v002)
- [`wyatt_authentication_bloc` - `v0.2.0+1`](#wyatt_authentication_bloc---v0201)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `wyatt_authentication_bloc` - `v0.2.0+1`
---
#### `wyatt_form_bloc` - `v0.0.2`
- **FEAT**: add list option validator.
## 2022-04-20
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_crud_bloc` - `v0.0.2`](#wyatt_crud_bloc---v002)
- [`wyatt_analysis` - `v2.0.1`](#wyatt_analysis---v201)
---
#### `wyatt_crud_bloc` - `v0.0.2`
- Migrate crud_package in monorepo
- **DOCS**: add example app.
#### `wyatt_analysis` - `v2.0.1`
- **DOCS**: Update readme with new version.
## 2022-04-20
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_authentication_bloc` - `v0.2.0`](#wyatt_authentication_bloc---v020)
Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries):
- `wyatt_authentication_bloc` - `v0.2.0`
---
#### `wyatt_authentication_bloc` - `v0.2.0`
## 2022-04-20
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`wyatt_form_bloc` - `v0.0.1`](#wyatt_form_bloc---v001)
Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries):
- `wyatt_form_bloc` - `v0.0.1`
---
#### `wyatt_form_bloc` - `v0.0.1`
## 2022-04-20
### Changes
+74 -14
View File
@@ -28,8 +28,8 @@
</p>
<p align="center">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt_analysis">
<img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square"" alt="Style: Wyatt Analysis" />
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis">
<img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" />
</a>
<a href="https://github.com/invertase/melos">
<img src="https://img.shields.io/badge/Maintained%20with-melos-f700ff.svg?style=flat-square" alt="Maintained with Melos" />
@@ -63,22 +63,65 @@ dart pub global activate melos
Then bootstrap with `melos bs`.
---
### Create a new package
## Usage
Create a new package in `packages/` folder.
You can add any package of the `packages/` sub directory in your project.
```yaml
dependencies:
wyatt_analysis:
git:
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
ref: wyatt_analysis-v2.0.0
path: packages/wyatt_analysis
```shell
dart create -t package-simple wyatt_<name>
```
Here you can change `package name` and `package version`.
Remove any `example/` subfolder. Then create a new sample project.
```shell
flutter create --platforms android --project-name <name>_example example
```
Then bootstrap project with `melos bs` command.
### Convention
#### Naming
In the previous instructions `<name>` variable is important.
It have to be clear and intelligible.
You **MUST** use underscores.
You **MUST** use `wyatt` prefix for package.
You **MUST** name example with specific name.
For example, if name is CRUD BLOC
- name will be crud_bloc
- so the package will be: `wyatt_crud_bloc`
- and the example will be: `crud_bloc_example`
#### Commits
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
tl;dr : `type(scope): description`.
Here allowed <type> values:
- **feat** for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
- **fix** for a bug fix for the user, not a fix to a build script. Such commit will trigger a release bumping a PATCH version.
- **perf** for performance improvements. Such commit will trigger a release bumping a PATCH version.
- **docs** for changes to the documentation.
- **style** for formatting changes, missing semicolons, etc.
- **refactor** for refactoring production code, e.g. renaming a variable.
- **test** for adding missing tests, refactoring tests; no production code change.
- **build** for updating build configuration, development tools or other changes irrelevant to the user.
Some examples :
- `feat(auth): add AWS support.` = add a feature in authentication_bloc package.
- `docs: update readme.` = update **this** readme file.
- `fix(crud)!: fix bug in awesome() function.` = fix a bug, `!` is important and indicate `BREAKING CHANGES`.
Conventional commits are important for `melos version` command !
#### Badging
In the package `readme.md` file, please specify the supported SDK:
@@ -97,6 +140,23 @@ or
---
## Usage
You can add any package of the `packages/` sub directory in your project.
```yaml
dependencies:
wyatt_analysis:
git:
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
ref: wyatt_analysis-v2.0.0
path: packages/wyatt_analysis
```
Here you can change `package name` and `package version`.
---
## Status
![Status: Experimental](https://img.shields.io/badge/Status-WIP-red?style=flat-square)
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2022 WYATT GROUP
* Please see the AUTHORS file for details.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
{
"recommendations": [
"psioniq.psi-header",
"blaugold.melos-code"
]
}
+71
View File
@@ -0,0 +1,71 @@
{
"psi-header.changes-tracking": {
"isActive": true
},
"psi-header.config": {
"blankLinesAfter": 1,
"forceToTop": true
},
"psi-header.lang-config": [
{
"beforeHeader": [
"# -*- coding:utf-8 -*-",
"#!/usr/bin/env python3"
],
"begin": "###",
"end": "###",
"language": "python",
"prefix": "# "
},
{
"beforeHeader": [
"#!/usr/bin/env sh",
""
],
"language": "shellscript",
"begin": "",
"end": "",
"prefix": "# "
},
{
"begin": "",
"end": "",
"language": "dart",
"prefix": "// "
},
{
"begin": "",
"end": "",
"language": "yaml",
"prefix": "# "
},
{
"begin": "<!--",
"end": "-->",
"language": "markdown",
},
],
"psi-header.templates": [
{
"language": "*",
"template": [
"Copyright (C) <<year>> WYATT GROUP",
"Please see the AUTHORS file for details.",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>."
],
}
],
"dart.runPubGetOnPubspecChanges": false,
}
+8
View File
@@ -1,3 +1,11 @@
## 2.1.0
- **FEAT**: add experimental rules in appropriate file.
## 2.0.1
- **DOCS**: Update readme with new version.
## 2.0.0
> Note: This release has breaking changes.
@@ -0,0 +1,22 @@
# Copyright (C) 2022 WYATT GROUP
# Please see the AUTHORS file for details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
include: package:wyatt_analysis/analysis_options.flutter.2.0.0.yaml
linter:
rules:
- use_super_parameters
- use_enums
+1 -1
View File
@@ -1,7 +1,7 @@
name: wyatt_analysis
description: Lint rules for Dart and Flutter used internally at Wyatt and Wyatt Studio.
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis
version: 2.0.0
version: 2.1.0
environment:
sdk: '>=2.12.0 <3.0.0'
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2022 WYATT GROUP
* Please see the AUTHORS file for details.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
{
"recommendations": [
"psioniq.psi-header",
"blaugold.melos-code"
]
}
@@ -0,0 +1,71 @@
{
"psi-header.changes-tracking": {
"isActive": true
},
"psi-header.config": {
"blankLinesAfter": 1,
"forceToTop": true
},
"psi-header.lang-config": [
{
"beforeHeader": [
"# -*- coding:utf-8 -*-",
"#!/usr/bin/env python3"
],
"begin": "###",
"end": "###",
"language": "python",
"prefix": "# "
},
{
"beforeHeader": [
"#!/usr/bin/env sh",
""
],
"language": "shellscript",
"begin": "",
"end": "",
"prefix": "# "
},
{
"begin": "",
"end": "",
"language": "dart",
"prefix": "// "
},
{
"begin": "",
"end": "",
"language": "yaml",
"prefix": "# "
},
{
"begin": "<!--",
"end": "-->",
"language": "markdown",
},
],
"psi-header.templates": [
{
"language": "*",
"template": [
"Copyright (C) <<year>> WYATT GROUP",
"Please see the AUTHORS file for details.",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>."
],
}
],
"dart.runPubGetOnPubspecChanges": false,
}
@@ -1,3 +1,19 @@
## 0.2.1+1
- Update a dependency to the latest release.
## 0.2.1
- **FEAT**: add google, facebook, apple, twitter login.
## 0.2.0+1
- Update a dependency to the latest release.
## 0.2.0
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 0.2.0-dev.0
> Note: This release has breaking changes.
+7 -7
View File
@@ -18,7 +18,12 @@
# Flutter - Authentication BLoC
[![style: wyatt analysis](https://img.shields.io/badge/Style-Wyatt%20Analysis-blue)](https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt_analysis)
<p align="left">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis">
<img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" />
</a>
<img src="https://img.shields.io/badge/SDK-Flutter-blue?style=flat-square" alt="SDK: Flutter" />
</p>
Authentication Bloc for Flutter.
@@ -40,15 +45,10 @@ Authentication Bloc for Flutter.
* Start/Stop listening on demand
- `start()` to listen to user changes
- `stop()` to cancel listener
- Form
* FormInput: validation of one input
* Form: validation of all form inputs
* FormEntry: contains data of one input
* FormData: contains all entries
- SignUpCubit
* Handles email/password validation and password confirmation
* Handles register with email/password
* Handles custom form fields
* Handles custom form fields thanks `wyatt_form_bloc`
- Use `entries` to pass a `FormData` object
- You can use several pre configured `FormInput` for validation
- You can use `updateFormData()` to change FormData and validators during runtime (intersection, union, difference or replace)
@@ -1,6 +1 @@
include: package:wyatt_analysis/analysis_options.flutter.1.1.1.yaml
linter:
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
include: package:wyatt_analysis/analysis_options.flutter.yaml
@@ -44,3 +44,5 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
lib/firebase_options.dart
@@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b
revision: 5464c5bac742001448fe4fc0597be939379f88ea
channel: stable
project_type: app
@@ -0,0 +1,4 @@
## 1.0.1
- Update a dependency to the latest release.
@@ -1,4 +1,4 @@
# example
# authentication_bloc_example
A new Flutter project.
@@ -22,6 +22,9 @@ if (flutterVersionName == null) {
}
apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
@@ -43,7 +46,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
applicationId "com.example.authentication_bloc_example"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
@@ -0,0 +1,135 @@
{
"project_info": {
"project_number": "136771801992",
"firebase_url": "https://tchat-beta.firebaseio.com",
"project_id": "tchat-beta",
"storage_bucket": "tchat-beta.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:136771801992:android:4ff419f07afdad6097203d",
"android_client_info": {
"package_name": "com.example.authentication_bloc_example"
}
},
"oauth_client": [
{
"client_id": "136771801992-ncuib3rbu7p4ro4eo5su4vaudn2u4qrv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAYS14uXupkS158Q5QAFP1864UrUN_yDSk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "136771801992-ncuib3rbu7p4ro4eo5su4vaudn2u4qrv.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "136771801992-e585bm1n9b3lv89t4phrl9u0glsg52ua.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.example"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:136771801992:android:8482c9b90bc29de697203d",
"android_client_info": {
"package_name": "com.example.crud_bloc_example"
}
},
"oauth_client": [
{
"client_id": "136771801992-ncuib3rbu7p4ro4eo5su4vaudn2u4qrv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAYS14uXupkS158Q5QAFP1864UrUN_yDSk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "136771801992-ncuib3rbu7p4ro4eo5su4vaudn2u4qrv.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "136771801992-e585bm1n9b3lv89t4phrl9u0glsg52ua.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.example"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:136771801992:android:d20e0361057e815197203d",
"android_client_info": {
"package_name": "com.example.example"
}
},
"oauth_client": [
{
"client_id": "136771801992-n2pq8oqutvrqj58e05hbavvc7n1jdfjb.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.example",
"certificate_hash": "5d8790309e13b68c35e5d4d8437c35c6d15e6131"
}
},
{
"client_id": "136771801992-pj9s88ao7d99pnp4ace75nj1abtmoq7e.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.example",
"certificate_hash": "bc8faf31c0b0085dc358b2319684e10c93f42719"
}
},
{
"client_id": "136771801992-ncuib3rbu7p4ro4eo5su4vaudn2u4qrv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAYS14uXupkS158Q5QAFP1864UrUN_yDSk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "136771801992-ncuib3rbu7p4ro4eo5su4vaudn2u4qrv.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "136771801992-e585bm1n9b3lv89t4phrl9u0glsg52ua.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.example"
}
}
]
}
}
}
],
"configuration_version": "1"
}
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
package="com.example.authentication_bloc_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
package="com.example.authentication_bloc_example">
<application
android:label="example"
android:label="authentication_bloc_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
@@ -0,0 +1,6 @@
package com.example.authentication_bloc_example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
package="com.example.authentication_bloc_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
@@ -7,6 +7,9 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.10'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -1,34 +0,0 @@
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
</dict>
</plist>
@@ -1,2 +0,0 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
@@ -1,2 +0,0 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
@@ -1,41 +0,0 @@
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
@@ -1,97 +0,0 @@
PODS:
- Firebase/Auth (8.10.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 8.10.0)
- Firebase/CoreOnly (8.10.0):
- FirebaseCore (= 8.10.0)
- firebase_auth (3.3.5):
- Firebase/Auth (= 8.10.0)
- firebase_core
- Flutter
- firebase_core (1.11.0):
- Firebase/CoreOnly (= 8.10.0)
- Flutter
- FirebaseAuth (8.10.0):
- FirebaseCore (~> 8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/Environment (~> 7.6)
- GTMSessionFetcher/Core (~> 1.5)
- FirebaseCore (8.10.0):
- FirebaseCoreDiagnostics (~> 8.0)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Logger (~> 7.6)
- FirebaseCoreDiagnostics (8.10.0):
- GoogleDataTransport (~> 9.1)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Logger (~> 7.6)
- nanopb (~> 2.30908.0)
- Flutter (1.0.0)
- GoogleDataTransport (9.1.2):
- GoogleUtilities/Environment (~> 7.2)
- nanopb (~> 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.7.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/Network (7.7.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.7.0)"
- GoogleUtilities/Reachability (7.7.0):
- GoogleUtilities/Logger
- GTMSessionFetcher/Core (1.7.0)
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- PromisesObjC (2.0.0)
DEPENDENCIES:
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
SPEC REPOS:
trunk:
- Firebase
- FirebaseAuth
- FirebaseCore
- FirebaseCoreDiagnostics
- GoogleDataTransport
- GoogleUtilities
- GTMSessionFetcher
- nanopb
- PromisesObjC
EXTERNAL SOURCES:
firebase_auth:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
Flutter:
:path: Flutter
SPEC CHECKSUMS:
Firebase: 44213362f1dcc52555b935dc925ed35ac55f1b20
firebase_auth: 9d959bddc3b255ddfb67cf630a5bbb6186964356
firebase_core: 2ca2d6cc8a11693e701b37126afae4800be5dbac
FirebaseAuth: 59a2d2b933b5b79e18fb1e6ad230c6abdaa73d26
FirebaseCore: 04186597c095da37d90ff9fd3e53bc61a1ff2440
FirebaseCoreDiagnostics: 56fb7216d87e0e6ec2feddefa9d8a392fe8b2c18
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940
GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
GTMSessionFetcher: 43748f93435c2aa068b1cbe39655aaf600652e91
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea
COCOAPODS: 1.11.2
@@ -1,549 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
E0ACB97A2AC1EAE305AB816E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17811D4CD54BBE5A5A617A67 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
08CA0F9F86D48F857AE8F6A9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
17811D4CD54BBE5A5A617A67 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
5464F99483A75A45363198CF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
60123E8F332B681F9E8E65D0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E0ACB97A2AC1EAE305AB816E /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
868018A8DFEB24F4BBF7C643 /* Pods */ = {
isa = PBXGroup;
children = (
5464F99483A75A45363198CF /* Pods-Runner.debug.xcconfig */,
08CA0F9F86D48F857AE8F6A9 /* Pods-Runner.release.xcconfig */,
60123E8F332B681F9E8E65D0 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
868018A8DFEB24F4BBF7C643 /* Pods */,
A25D987A122B465AA7E625CC /* Frameworks */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
A25D987A122B465AA7E625CC /* Frameworks */ = {
isa = PBXGroup;
children = (
17811D4CD54BBE5A5A617A67 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
FDCB4921C84D1E40D80F2BC5 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
EA7D75F2512D4CFC69FD736B /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
EA7D75F2512D4CFC69FD736B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FDCB4921C84D1E40D80F2BC5 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
@@ -1,13 +0,0 @@
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
@@ -1,122 +0,0 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

@@ -1,23 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

@@ -1,5 +0,0 @@
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
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.
@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Example</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
@@ -1 +0,0 @@
#import "GeneratedPluginRegistrant.h"
@@ -14,35 +14,46 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'dart:developer';
import 'package:authentication_bloc_example/constants.dart';
import 'package:authentication_bloc_example/home/home_page.dart';
import 'package:authentication_bloc_example/login/login_page.dart';
import 'package:authentication_bloc_example/model.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:example/constants.dart';
import 'package:example/home/home_page.dart';
import 'package:example/login/login_page.dart';
import 'package:example/model.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
static FormData getNormalFormData() {
return const FormData([
FormEntry(formFieldName, Name.pure()),
FormEntry(formFieldPhone, Phone.pure()),
FormEntry(formFieldPro, Boolean.pure()),
FormEntry(formFieldConfirmedPassword, ConfirmedPassword.pure(), export: false),
FormInput(formFieldName, Name.pure()),
FormInput(formFieldPhone, Phone.pure()),
FormInput(formFieldPro, Boolean.pure()),
FormInput(
formFieldConfirmedPassword,
ConfirmedPassword.pure(),
metadata: FormInputMetadata(export: false),
),
]);
}
static FormData getProFormData() {
return const FormData([
FormEntry(formFieldName, Name.pure()),
FormEntry(formFieldPhone, Phone.pure()),
FormEntry(formFieldPro, Boolean.pure()),
FormEntry(formFieldSiren, Siren.pure()),
FormEntry(formFieldIban, Iban.pure()),
FormEntry(formFieldConfirmedPassword, ConfirmedPassword.pure(), export: false),
FormInput(formFieldName, Name.pure()),
FormInput(formFieldPhone, Phone.pure()),
FormInput(formFieldPro, Boolean.pure()),
FormInput(formFieldSiren, Siren.pure()),
FormInput(formFieldIban, Iban.pure()),
FormInput(
formFieldConfirmedPassword,
ConfirmedPassword.pure(),
metadata: FormInputMetadata(export: false),
),
]);
}
@@ -52,14 +63,32 @@ class App extends StatelessWidget {
if (user.isNotEmpty && !user.isAnonymous) {
// Check if user is register in Firesore.
DocumentSnapshot firestoreUser = await FirebaseFirestore.instance
.collection('users')
.collection(firestoreCollectionUsers)
.doc(user.uid)
.get();
return {
'user':
UserFirestore.fromMap(firestoreUser.data() as Map<String, dynamic>),
...firestoreUser.data() as Map<String, dynamic>? ?? {}
};
if (!firestoreUser.exists) {
// Register user in Firestore when sign in with social account.
final uid = user.uid;
final u = {'uid': uid, 'email': user.email};
await FirebaseFirestore.instance
.collection(firestoreCollectionUsers)
.doc(uid)
.set(u);
return {
'user': UserFirestore(
uid: uid,
email: user.email ?? '',
name: user.displayName ?? '',
phone: user.phoneNumber ?? ''),
};
} else {
return {
'user': UserFirestore.fromMap(
firestoreUser.data() as Map<String, dynamic>),
...firestoreUser.data() as Map<String, dynamic>? ?? {}
};
}
} else {
return {};
}
@@ -70,48 +99,52 @@ class App extends StatelessWidget {
if (uid != null) {
final data = state.data.toMap();
final user = {'uid': uid, 'email': state.email.value, ...data};
await FirebaseFirestore.instance.collection('users').doc(uid).set(user);
log('onSignUpSuccess: $user');
await FirebaseFirestore.instance
.collection(firestoreCollectionUsers)
.doc(uid)
.set(user);
}
}
@override
Widget build(BuildContext context) {
AuthenticationRepositoryInterface _authenticationRepository =
AuthenticationRepositoryInterface authenticationRepository =
AuthenticationRepositoryFirebase();
AuthenticationCubit _authenticationCubit = AuthenticationCubit(
authenticationRepository: _authenticationRepository,
AuthenticationCubit authenticationCubit = AuthenticationCubit(
authenticationRepository: authenticationRepository,
onAuthSuccess: onAuthSuccess,
);
SignUpCubit _signUpCubit = SignUpCubit(
authenticationRepository: _authenticationRepository,
authenticationCubit: _authenticationCubit,
SignUpCubit signUpCubit = SignUpCubit(
authenticationRepository: authenticationRepository,
authenticationCubit: authenticationCubit,
entries: getNormalFormData(),
onSignUpSuccess: onSignUpSuccess,
);
SignInCubit _signInCubit = SignInCubit(
authenticationRepository: _authenticationRepository,
authenticationCubit: _authenticationCubit,
SignInCubit signInCubit = SignInCubit(
authenticationRepository: authenticationRepository,
authenticationCubit: authenticationCubit,
);
return MultiRepositoryProvider(
providers: [
RepositoryProvider<AuthenticationRepositoryInterface>(
create: (context) => _authenticationRepository,
create: (context) => authenticationRepository,
),
],
child: MultiBlocProvider(
providers: [
BlocProvider<AuthenticationCubit>(
create: (context) => _authenticationCubit..init(),
create: (context) => authenticationCubit..init(),
),
BlocProvider<SignUpCubit>(
create: (context) => _signUpCubit,
create: (context) => signUpCubit,
),
BlocProvider<SignInCubit>(
create: (context) => _signInCubit,
create: (context) => signInCubit,
),
],
child: const AppView(),
@@ -20,3 +20,5 @@ const String formFieldPro = 'isPro';
const String formFieldConfirmedPassword = 'confirmedPassword';
const String formFieldSiren = 'siren';
const String formFieldIban = 'iban';
const String firestoreCollectionUsers = 'authentication_bloc_users';
@@ -1,70 +0,0 @@
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
// ignore: missing_enum_constant_in_switch
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyCxdDUpkpW7onOicIcIDcIVvPC8ll1twCQ',
appId: '1:136771801992:web:e757595ae62e646297203d',
messagingSenderId: '136771801992',
projectId: 'tchat-beta',
authDomain: 'tchat-beta.firebaseapp.com',
databaseURL: 'https://tchat-beta.firebaseio.com',
storageBucket: 'tchat-beta.appspot.com',
);
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyAYS14uXupkS158Q5QAFP1864UrUN_yDSk',
appId: '1:136771801992:android:d20e0361057e815197203d',
messagingSenderId: '136771801992',
projectId: 'tchat-beta',
databaseURL: 'https://tchat-beta.firebaseio.com',
storageBucket: 'tchat-beta.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCDbbhjbFrQwLXuIANdJzjkDk8uOETnn7w',
appId: '1:136771801992:ios:6fe69c0bea08b7b397203d',
messagingSenderId: '136771801992',
projectId: 'tchat-beta',
databaseURL: 'https://tchat-beta.firebaseio.com',
storageBucket: 'tchat-beta.appspot.com',
iosClientId:
'136771801992-e585bm1n9b3lv89t4phrl9u0glsg52ua.apps.googleusercontent.com',
iosBundleId: 'com.example.example',
);
}
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/forgot_password/widgets/forgot_password_form.dart';
import 'package:authentication_bloc_example/forgot_password/widgets/forgot_password_form.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -15,8 +15,9 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
class _EmailInput extends StatelessWidget {
@override
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/home/widgets/infos.dart';
import 'package:authentication_bloc_example/home/widgets/infos.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:example/home/widgets/email_verification.dart';
import 'package:authentication_bloc_example/home/widgets/email_verification.dart';
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/home/widgets/avatar.dart';
import 'package:authentication_bloc_example/home/widgets/avatar.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:example/constants.dart';
import 'package:authentication_bloc_example/constants.dart';
class UserInfo extends StatelessWidget {
const UserInfo({Key? key}) : super(key: key);
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/login/widgets/login_form.dart';
import 'package:authentication_bloc_example/login/widgets/login_form.dart';
import 'package:flutter/material.dart';
class LoginPage extends StatelessWidget {
@@ -14,13 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/app/app.dart';
import 'package:example/constants.dart';
import 'package:example/forgot_password/forgot_password_page.dart';
import 'package:example/sign_up/sign_up_page.dart';
import 'package:authentication_bloc_example/app/app.dart';
import 'package:authentication_bloc_example/constants.dart';
import 'package:authentication_bloc_example/forgot_password/forgot_password_page.dart';
import 'package:authentication_bloc_example/sign_up/sign_up_page.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
class _EmailInput extends StatelessWidget {
@override
@@ -101,6 +102,24 @@ class _LoginWithPasswordButton extends StatelessWidget {
}
}
class _LoginWithGoogleButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocBuilder<SignInCubit, SignInState>(
buildWhen: (previous, current) => previous.status != current.status,
builder: (context, state) {
return state.status.isSubmissionInProgress
? const CircularProgressIndicator()
: ElevatedButton(
onPressed: () =>
context.read<SignInCubit>().signInWithGoogle(),
child: const Text('LOGIN GOOGLE'),
);
},
);
}
}
class _SignUpButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
@@ -181,6 +200,8 @@ class LoginForm extends StatelessWidget {
const SizedBox(height: 8),
_LoginAnonButton(),
const SizedBox(height: 8),
_LoginWithGoogleButton(),
const SizedBox(height: 8),
_SignUpButton(),
const SizedBox(height: 8),
_SignUpAsProButton(),
@@ -14,9 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/app/app.dart';
import 'package:example/app/bloc_observer.dart';
import 'package:example/firebase_options.dart';
import 'package:authentication_bloc_example/app/app.dart';
import 'package:authentication_bloc_example/app/bloc_observer.dart';
import 'package:authentication_bloc_example/firebase_options.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:example/sign_up/widgets/sign_up_form.dart';
import 'package:authentication_bloc_example/sign_up/widgets/sign_up_form.dart';
import 'package:flutter/material.dart';
class SignUpPage extends StatelessWidget {
@@ -16,11 +16,12 @@
import 'dart:developer';
import 'package:example/app/app.dart';
import 'package:example/constants.dart';
import 'package:authentication_bloc_example/app/app.dart';
import 'package:authentication_bloc_example/constants.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
class _NameInput extends StatelessWidget {
@override
@@ -36,7 +37,7 @@ class _NameInput extends StatelessWidget {
labelText: 'name',
helperText: '',
errorText:
state.data.input(formFieldName).invalid ? 'invalid name' : null,
state.data.isNotValid(formFieldName) ? 'invalid name' : null,
),
);
},
@@ -57,7 +58,7 @@ class _PhoneInput extends StatelessWidget {
decoration: InputDecoration(
labelText: 'phone',
helperText: '',
errorText: state.data.input(formFieldPhone).invalid
errorText: state.data.isNotValid(formFieldPhone)
? 'invalid phone'
: null,
),
@@ -80,7 +81,7 @@ class _SirenInput extends StatelessWidget {
decoration: InputDecoration(
labelText: 'siren',
helperText: '',
errorText: state.data.input(formFieldSiren).invalid
errorText: state.data.isNotValid(formFieldSiren)
? 'invalid SIREN'
: null,
),
@@ -104,7 +105,7 @@ class _IbanInput extends StatelessWidget {
labelText: 'iban',
helperText: '',
errorText:
state.data.input(formFieldIban).invalid ? 'invalid IBAN' : null,
state.data.isNotValid(formFieldIban) ? 'invalid IBAN' : null,
),
);
},
@@ -148,8 +149,7 @@ class _PasswordInput extends StatelessWidget {
.read<SignUpCubit>()
.state
.data
.input(formFieldConfirmedPassword)
.value,
.valueOf<String, ValidationError>(formFieldConfirmedPassword),
),
);
},
@@ -184,7 +184,7 @@ class _ConfirmPasswordInput extends StatelessWidget {
decoration: InputDecoration(
labelText: 'confirm password',
helperText: '',
errorText: state.data.input(formFieldConfirmedPassword).invalid
errorText: state.data.isNotValid(formFieldConfirmedPassword)
? 'passwords do not match'
: null,
),
@@ -202,7 +202,7 @@ class _CheckIsProInput extends StatelessWidget {
trailing: BlocBuilder<SignUpCubit, SignUpState>(
builder: (context, state) {
return Checkbox(
value: state.data.input<bool>(formFieldPro).value,
value: state.data.valueOf<bool, ValidationError>(formFieldPro),
onChanged: (isPro) {
final value =
isPro!; // tristate is false, so value can't be null
@@ -253,11 +253,12 @@ class _DebugButton extends StatelessWidget {
return BlocBuilder<SignUpCubit, SignUpState>(
builder: (context, state) {
return ElevatedButton(
onPressed: () {
log(state.toString());
} ,
child: const Text('DEBUG'),
);
onPressed: () {
// log(state.toString());
log(state.data.toMap().toString());
},
child: const Text('DEBUG'),
);
},
);
}
@@ -295,7 +296,7 @@ class SignUpForm extends StatelessWidget {
const SizedBox(height: 8),
BlocBuilder<SignUpCubit, SignUpState>(
builder: (context, state) {
if (state.data.input<bool>(formFieldPro).value) {
if (state.data.valueOf<bool, ValidationError>(formFieldPro)) {
return Column(children: [
_SirenInput(),
const SizedBox(height: 8),
@@ -1,4 +1,4 @@
name: example
name: authentication_bloc_example
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
@@ -15,10 +15,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
version: 1.0.1
environment:
sdk: ">=2.15.1 <3.0.0"
sdk: ">=2.16.2 <3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@@ -30,15 +30,21 @@ dependencies:
flutter:
sdk: flutter
firebase_core: ^1.13.1
firebase_core: ^1.14.1
flutter_bloc: ^8.0.1
wyatt_authentication_bloc:
path: "../"
wyatt_form_bloc:
git:
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
ref: wyatt_form_bloc-v0.0.3
path: packages/wyatt_form_bloc
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
cloud_firestore: ^3.1.10
cloud_firestore: ^3.1.12
dev_dependencies:
flutter_test:
@@ -49,7 +55,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^1.0.4
flutter_lints: ^2.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
@@ -15,9 +15,9 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wyatt_authentication_bloc/src/authentication/cubit/authentication_cubit.dart';
import 'package:wyatt_authentication_bloc/src/models/user/user_interface.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class AuthenticationBuilder extends StatelessWidget {
const AuthenticationBuilder({
@@ -16,9 +16,9 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:wyatt_authentication_bloc/src/form/form_status.dart';
import 'package:wyatt_authentication_bloc/src/models/exceptions/exceptions_interface.dart';
import 'package:wyatt_authentication_bloc/src/repositories/authentication_repository_interface.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart' show FormStatus;
part 'email_verification_state.dart';
@@ -1,137 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/foundation.dart';
import 'package:wyatt_authentication_bloc/src/form/form_entry.dart';
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/models/validation_error.dart';
@immutable
class FormData {
const FormData(this._entries);
FormData.empty() : this(<FormEntry>[]);
final List<FormEntry> _entries;
List<FormEntry> get entries => _entries;
List<FormInput<T, ValidationError>> inputs<T>() {
return _entries
.map((FormEntry entry) => entry.input as FormInput<T, ValidationError>)
.toList();
}
FormInput<T, ValidationError> input<T>(String field) {
if (contains(field)) {
return _entries
.firstWhere((FormEntry entry) => entry.field == field)
.input as FormInput<T, ValidationError>;
} else {
throw Exception('Field $field does not exist in form');
}
}
bool contains(String field) {
return _entries.any((FormEntry entry) => entry.field == field);
}
FormData intersection(FormData other) {
final List<FormEntry> entries = <FormEntry>[];
for (final FormEntry entry in _entries) {
if (other.contains(entry.field)) {
entries.add(entry);
}
}
return FormData(entries);
}
FormData difference(FormData other) {
final List<FormEntry> entries = <FormEntry>[];
for (final FormEntry otherEntry in other._entries) {
if (!contains(otherEntry.field)) {
entries.add(otherEntry);
}
}
for (final FormEntry entry in _entries) {
if (!other.contains(entry.field)) {
entries.add(entry);
}
}
return FormData(entries);
}
FormData union(FormData other) {
final List<FormEntry> entries = <FormEntry>[];
for (final FormEntry entry in _entries) {
entries.add(entry);
}
for (final FormEntry otherEntry in other._entries) {
if (!contains(otherEntry.field)) {
entries.add(otherEntry);
}
}
return FormData(entries);
}
void update(String field, FormInput input) {
if (contains(field)) {
final index = _entries.indexOf(
_entries.firstWhere((FormEntry entry) => entry.field == field),
);
_entries[index] = _entries[index].copyWith(input: input);
}
}
FormData clone() {
return FormData(
_entries
.map((FormEntry entry) => entry.clone())
.toList(),
);
}
Map<String, dynamic> toMap() {
final map = <String, dynamic>{};
for (final entry in _entries) {
if (entry.export) {
map[entry.fieldName ?? entry.field] = entry.input.value;
}
}
return map;
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is FormData && listEquals(other._entries, _entries);
}
@override
int get hashCode => _entries.hashCode;
@override
String toString() => 'FormData(entries: $_entries)';
}
@@ -1,77 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/foundation.dart';
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
@immutable
class FormEntry {
const FormEntry(this.field, this.input, {this.export = true, this.fieldName});
final String field;
final FormInput input;
final bool export;
final String? fieldName;
FormEntry copyWith({
String? field,
FormInput? input,
bool? export,
String? fieldName,
}) {
return FormEntry(
field ?? this.field,
input ?? this.input,
export: export ?? this.export,
fieldName: fieldName ?? this.fieldName,
);
}
FormEntry clone() {
return FormEntry(
field,
input,
export: export,
fieldName: fieldName,
);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is FormEntry &&
other.field == field &&
other.input == input &&
other.export == export &&
other.fieldName == fieldName;
}
@override
int get hashCode {
return field.hashCode ^
input.hashCode ^
export.hashCode ^
fieldName.hashCode;
}
@override
String toString() {
// ignore: lines_longer_than_80_chars
return 'FormEntry(field: $field, input: $input, export: $export, fieldName: $fieldName)';
}
}
@@ -1,79 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/// Enum representing the status of a form at any given point in time.
enum FormStatus {
/// The form has not been touched.
pure,
/// The form has been completely validated.
valid,
/// The form contains one or more invalid inputs.
invalid,
/// The form is in the process of being submitted.
submissionInProgress,
/// The form has been submitted successfully.
submissionSuccess,
/// The form submission failed.
submissionFailure,
/// The form submission has been canceled.
submissionCanceled
}
const Set<FormStatus> _validatedFormStatuses = <FormStatus>{
FormStatus.valid,
FormStatus.submissionInProgress,
FormStatus.submissionSuccess,
FormStatus.submissionFailure,
FormStatus.submissionCanceled,
};
/// Useful extensions on [FormStatus]
extension FormStatusX on FormStatus {
/// Indicates whether the form is untouched.
bool get isPure => this == FormStatus.pure;
/// Indicates whether the form is completely validated.
bool get isValid => this == FormStatus.valid;
/// Indicates whether the form has been validated successfully.
/// This means the [FormStatus] is either:
/// * `FormStatus.valid`
/// * `FormStatus.submissionInProgress`
/// * `FormStatus.submissionSuccess`
/// * `FormStatus.submissionFailure`
bool get isValidated => _validatedFormStatuses.contains(this);
/// Indicates whether the form contains one or more invalid inputs.
bool get isInvalid => this == FormStatus.invalid;
/// Indicates whether the form is in the process of being submitted.
bool get isSubmissionInProgress => this == FormStatus.submissionInProgress;
/// Indicates whether the form has been submitted successfully.
bool get isSubmissionSuccess => this == FormStatus.submissionSuccess;
/// Indicates whether the form submission failed.
bool get isSubmissionFailure => this == FormStatus.submissionFailure;
/// Indicates whether the form submission has been canceled.
bool get isSubmissionCanceled => this == FormStatus.submissionCanceled;
}
@@ -1,32 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/form/form_input_status.dart';
import 'package:wyatt_authentication_bloc/src/form/form_status.dart';
/// Class which contains methods that help manipulate and manage
/// [FormStatus] and [FormInputStatus] instances.
class FormValidator {
/// Returns a [FormStatus] given a list of [FormInput].
static FormStatus validate(List<FormInput> inputs) {
return inputs.every((FormInput element) => element.pure)
? FormStatus.pure
: inputs.any((FormInput input) => input.valid == false)
? FormStatus.invalid
: FormStatus.valid;
}
}
@@ -1,39 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/models/validation_error.dart';
/// {@template confirmed_password}
/// Form input for a confirmed password input.
/// {@endtemplate}
class ConfirmedPassword
extends FormInput<String, ValidationError> {
/// {@macro confirmed_password}
const ConfirmedPassword.pure({this.password = ''}) : super.pure('');
/// {@macro confirmed_password}
const ConfirmedPassword.dirty({required this.password, String value = ''})
: super.dirty(value);
/// The original password.
final String password;
@override
ValidationError? validator(String? value) {
return password == value ? null : ValidationError.invalid;
}
}
@@ -1,40 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/models/validation_error.dart';
/// {@template email}
/// Form input for an email input.
/// {@endtemplate}
class Email extends FormInput<String, ValidationError> {
/// {@macro email}
const Email.pure() : super.pure('');
/// {@macro email}
const Email.dirty([String value = '']) : super.dirty(value);
static final RegExp _emailRegExp = RegExp(
r'^[a-zA-Z0-9.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$',
);
@override
ValidationError? validator(String? value) {
return _emailRegExp.hasMatch(value ?? '')
? null
: ValidationError.invalid;
}
}
@@ -106,10 +106,12 @@ class SignInAnonymouslyFailureFirebase
}
}
class SignInWithGoogleFailureFirebase extends SignInWithGoogleFailureInterface {
SignInWithGoogleFailureFirebase([String? code, String? message])
class SignInWithCredentialFailureFirebase
extends SignInWithCredentialFailureInterface {
SignInWithCredentialFailureFirebase([String? code, String? message])
: super(code ?? 'unknown', message ?? 'An unknown error occurred.');
SignInWithGoogleFailureFirebase.fromCode(String code) : super.fromCode(code) {
SignInWithCredentialFailureFirebase.fromCode(String code)
: super.fromCode(code) {
switch (code) {
case 'account-exists-with-different-credential':
message = 'Account exists with different credentials.';
@@ -143,6 +145,38 @@ class SignInWithGoogleFailureFirebase extends SignInWithGoogleFailureInterface {
}
}
class SignInWithGoogleFailureFirebase
extends SignInWithCredentialFailureFirebase
implements SignInWithGoogleFailureInterface {
SignInWithGoogleFailureFirebase([String? code, String? message])
: super(code, message);
SignInWithGoogleFailureFirebase.fromCode(String code) : super.fromCode(code);
}
class SignInWithFacebookFailureFirebase
extends SignInWithCredentialFailureFirebase
implements SignInWithFacebookFailureInterface {
SignInWithFacebookFailureFirebase([String? code, String? message])
: super(code, message);
SignInWithFacebookFailureFirebase.fromCode(String code)
: super.fromCode(code);
}
class SignInWithAppleFailureFirebase extends SignInWithCredentialFailureFirebase
implements SignInWithAppleFailureInterface {
SignInWithAppleFailureFirebase([String? code, String? message])
: super(code, message);
SignInWithAppleFailureFirebase.fromCode(String code) : super.fromCode(code);
}
class SignInWithTwitterFailureFirebase extends SignInWithCredentialFailureFirebase
implements SignInWithAppleFailureInterface {
SignInWithTwitterFailureFirebase([String? code, String? message])
: super(code, message);
SignInWithTwitterFailureFirebase.fromCode(String code) : super.fromCode(code);
}
class SignInWithEmailLinkFailureFirebase
extends SignInWithEmailLinkFailureInterface {
SignInWithEmailLinkFailureFirebase([String? code, String? message])
@@ -64,6 +64,20 @@ abstract class FetchSignInMethodsForEmailFailureInterface
: super.fromCode(code);
}
/// {@template sign_in_with_credential_failure}
/// Thrown during the sign in process if a failure occurs.
/// {@endtemplate}
abstract class SignInWithCredentialFailureInterface
extends AuthenticationFailureInterface {
/// {@macro sign_in_with_credential_failure}
SignInWithCredentialFailureInterface(String code, String message)
: super(code, message);
/// {@macro sign_in_with_credential_failure}
SignInWithCredentialFailureInterface.fromCode(String code)
: super.fromCode(code);
}
/// {@template sign_in_anonymously_failure}
/// Thrown during the sign in process if a failure occurs.
/// {@endtemplate}
@@ -91,6 +105,47 @@ abstract class SignInWithGoogleFailureInterface
SignInWithGoogleFailureInterface.fromCode(String code) : super.fromCode(code);
}
/// {@template sign_in_with_facebook_failure}
/// Thrown during the sign in process if a failure occurs.
/// {@endtemplate}
abstract class SignInWithFacebookFailureInterface
extends AuthenticationFailureInterface {
/// {@macro sign_in_with_facebook_failure}
SignInWithFacebookFailureInterface(String code, String message)
: super(code, message);
/// {@macro sign_in_with_facebook_failure}
SignInWithFacebookFailureInterface.fromCode(String code)
: super.fromCode(code);
}
/// {@template sign_in_with_apple_failure}
/// Thrown during the sign in process if a failure occurs.
/// {@endtemplate}
abstract class SignInWithAppleFailureInterface
extends AuthenticationFailureInterface {
/// {@macro sign_in_with_apple_failure}
SignInWithAppleFailureInterface(String code, String message)
: super(code, message);
/// {@macro sign_in_with_apple_failure}
SignInWithAppleFailureInterface.fromCode(String code) : super.fromCode(code);
}
/// {@template sign_in_with_twitter_failure}
/// Thrown during the sign in process if a failure occurs.
/// {@endtemplate}
abstract class SignInWithTwitterFailureInterface
extends AuthenticationFailureInterface {
/// {@macro sign_in_with_twitter_failure}
SignInWithTwitterFailureInterface(String code, String message)
: super(code, message);
/// {@macro sign_in_with_twitter_failure}
SignInWithTwitterFailureInterface.fromCode(String code)
: super.fromCode(code);
}
/// {@template sign_in_with_email_link_failure}
/// Thrown during the sign in process if a failure occurs.
/// {@endtemplate}
@@ -1,38 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/models/validation_error.dart';
/// {@template iban}
/// Form input for an IBAN input.
/// {@endtemplate}
class Iban extends FormInput<String, ValidationError> {
/// {@macro iban}
const Iban.pure() : super.pure('');
/// {@macro iban}
const Iban.dirty([String value = '']) : super.dirty(value);
static final RegExp _regExp = RegExp(
r'^(?:((?:IT|SM)\d{2}[A-Z]{1}\d{22})|(NL\d{2}[A-Z]{4}\d{10})|(LV\d{2}[A-Z]{4}\d{13})|((?:BG|GB|IE)\d{2}[A-Z]{4}\d{14})|(GI\d{2}[A-Z]{4}\d{15})|(RO\d{2}[A-Z]{4}\d{16})|(MT\d{2}[A-Z]{4}\d{23})|(NO\d{13})|((?:DK|FI)\d{16})|((?:SI)\d{17})|((?:AT|EE|LU|LT)\d{18})|((?:HR|LI|CH)\d{19})|((?:DE|VA)\d{20})|((?:AD|CZ|ES|MD|SK|SE)\d{22})|(PT\d{23})|((?:IS)\d{24})|((?:BE)\d{14})|((?:FR|MC|GR)\d{25})|((?:PL|HU|CY)\d{26}))$',
);
@override
ValidationError? validator(String? value) {
return _regExp.hasMatch(value ?? '') ? null : ValidationError.invalid;
}
}
@@ -14,16 +14,5 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export 'boolean.dart';
export 'confirmed_password.dart';
export 'email.dart';
export 'exceptions/exceptions.dart';
export 'iban.dart';
export 'name.dart';
export 'operations.dart';
export 'password.dart';
export 'phone.dart';
export 'siren.dart';
export 'text_string.dart';
export 'user/user.dart';
export 'validation_error.dart';
@@ -1,37 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/models/validation_error.dart';
/// {@template phone}
/// Form input for a phone input.
/// {@endtemplate}
class Phone extends FormInput<String, ValidationError> {
/// {@macro phone}
const Phone.pure() : super.pure('');
/// {@macro phone}
const Phone.dirty([String value = '']) : super.dirty(value);
static final RegExp _phoneRegExp =
RegExp(r'^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$');
@override
ValidationError? validator(String? value) {
return _phoneRegExp.hasMatch(value ?? '') ? null : ValidationError.invalid;
}
}
@@ -64,6 +64,9 @@ class UserFirebase implements UserInterface {
@override
String get uid => _user?.uid ?? '';
@override
String? get providerId => _user?.providerData.first.providerId;
@override
bool? get isNewUser {
if (_user?.metadata.lastSignInTime == null ||
@@ -71,6 +71,9 @@ abstract class UserInterface {
/// The user's unique ID.
String get uid;
/// The provider ID for the user.
String? get providerId;
/// Whether the user account has been recently created.
bool? get isNewUser;
@@ -16,11 +16,9 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:wyatt_authentication_bloc/src/form/form_status.dart';
import 'package:wyatt_authentication_bloc/src/form/form_validator.dart';
import 'package:wyatt_authentication_bloc/src/models/email.dart';
import 'package:wyatt_authentication_bloc/src/models/exceptions/exceptions_interface.dart';
import 'package:wyatt_authentication_bloc/src/repositories/authentication_repository_interface.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
part 'password_reset_state.dart';
@@ -35,7 +33,7 @@ class PasswordResetCubit extends Cubit<PasswordResetState> {
emit(
state.copyWith(
email: email,
status: FormValidator.validate([email]),
status: FormStatus.validate([email]),
),
);
}
@@ -15,19 +15,28 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
import 'package:twitter_login/twitter_login.dart';
import 'package:wyatt_authentication_bloc/src/models/exceptions/exceptions_firebase.dart';
import 'package:wyatt_authentication_bloc/src/models/user/user_firebase.dart';
import 'package:wyatt_authentication_bloc/src/models/user/user_interface.dart';
import 'package:wyatt_authentication_bloc/src/repositories/authentication_repository_interface.dart';
import 'package:wyatt_authentication_bloc/src/utils/cryptography.dart';
class AuthenticationRepositoryFirebase
implements AuthenticationRepositoryInterface {
final FirebaseAuth _firebaseAuth;
final TwitterLogin? _twitterLogin;
UserFirebase _userCache = const UserFirebase.empty();
AuthenticationRepositoryFirebase({FirebaseAuth? firebaseAuth})
: _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance;
AuthenticationRepositoryFirebase({
FirebaseAuth? firebaseAuth,
TwitterLogin? twitterLogin,
}) : _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance,
_twitterLogin = twitterLogin;
@override
Stream<UserInterface> get user {
@@ -99,9 +108,106 @@ class AuthenticationRepositoryFirebase
}
@override
Future<void> signInWithGoogle() {
// TODO(hpcl): implement signInWithGoogle
throw UnimplementedError();
Future<void> signInWithGoogle() async {
// Trigger the authentication flow
final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn();
// Obtain the auth details from the request
final GoogleSignInAuthentication? googleAuth =
await googleUser?.authentication;
// Create a new credential
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth?.accessToken,
idToken: googleAuth?.idToken,
);
try {
await _firebaseAuth.signInWithCredential(credential);
} on FirebaseAuthException catch (e) {
throw SignInWithGoogleFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInWithGoogleFailureFirebase();
}
}
@override
Future<void> signInWithFacebook() async {
// Trigger the sign-in flow
final LoginResult loginResult = await FacebookAuth.instance.login();
// Create a credential from the access token
final OAuthCredential credential =
FacebookAuthProvider.credential(loginResult.accessToken?.token ?? '');
try {
await _firebaseAuth.signInWithCredential(credential);
} on FirebaseAuthException catch (e) {
throw SignInWithFacebookFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInWithFacebookFailureFirebase();
}
}
@override
Future<void> signInWithApple() async {
// To prevent replay attacks with the credential returned from Apple, we
// include a nonce in the credential request. When signing in with
// Firebase, the nonce in the id token returned by Apple, is expected to
// match the sha256 hash of `rawNonce`.
final rawNonce = Cryptography.generateNonce();
final nonce = Cryptography.sha256ofString(rawNonce);
// Request credential for the currently signed in Apple account.
final appleCredential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
nonce: nonce,
);
// Create an `OAuthCredential` from the credential returned by Apple.
final credential = OAuthProvider('apple.com').credential(
idToken: appleCredential.identityToken,
rawNonce: rawNonce,
);
// Sign in the user with Firebase. If the nonce we generated earlier does
// not match the nonce in `appleCredential.identityToken`,
// sign in will fail.
try {
await _firebaseAuth.signInWithCredential(credential);
} on FirebaseAuthException catch (e) {
throw SignInWithAppleFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInWithAppleFailureFirebase();
}
}
@override
Future<void> signInWithTwitter() async {
final twitterLogin = _twitterLogin;
if (twitterLogin == null) {
throw SignInWithTwitterFailureFirebase();
}
// Trigger the sign-in flow
final authResult = await twitterLogin.login();
// Create a credential from the access token
final credential = TwitterAuthProvider.credential(
accessToken: authResult.authToken!,
secret: authResult.authTokenSecret!,
);
try {
await _firebaseAuth.signInWithCredential(credential);
} on FirebaseAuthException catch (e) {
throw SignInWithCredentialFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInWithCredentialFailureFirebase();
}
}
@override
@@ -61,6 +61,21 @@ abstract class AuthenticationRepositoryInterface {
/// Throws a [SignInWithGoogleFailureInterface] if an exception occurs.
Future<void> signInWithGoogle();
/// Starts the Sign In with Facebook Flow.
///
/// Throws a [SignInWithFacebookFailureInterface] if an exception occurs.
Future<void> signInWithFacebook();
/// Starts the Sign In with Apple Flow.
///
/// Throws a [SignInWithAppleFailureInterface] if an exception occurs.
Future<void> signInWithApple();
/// Starts the Sign In with Twitter Flow.
///
/// Throws a [SignInWithTwitterFailureInterface] if an exception occurs.
Future<void> signInWithTwitter();
/// Signs in using an email address and email sign-in link.
///
/// Throws a [SignInWithEmailLinkFailureInterface] if an exception occurs.
@@ -17,12 +17,9 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:wyatt_authentication_bloc/src/authentication/cubit/authentication_cubit.dart';
import 'package:wyatt_authentication_bloc/src/form/form_status.dart';
import 'package:wyatt_authentication_bloc/src/form/form_validator.dart';
import 'package:wyatt_authentication_bloc/src/models/email.dart';
import 'package:wyatt_authentication_bloc/src/models/exceptions/exceptions_interface.dart';
import 'package:wyatt_authentication_bloc/src/models/password.dart';
import 'package:wyatt_authentication_bloc/src/repositories/authentication_repository_interface.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
part 'sign_in_state.dart';
@@ -42,7 +39,7 @@ class SignInCubit extends Cubit<SignInState> {
emit(
state.copyWith(
email: email,
status: FormValidator.validate([email, state.password]),
status: FormStatus.validate([email, state.password]),
),
);
}
@@ -52,13 +49,12 @@ class SignInCubit extends Cubit<SignInState> {
emit(
state.copyWith(
password: password,
status: FormValidator.validate([state.email, password]),
status: FormStatus.validate([state.email, password]),
),
);
}
Future<void> signInAnonymously() async {
// TODO(hpcl): Maybe check this in UI.
if (state.status.isSubmissionInProgress) {
return;
}
@@ -80,6 +76,28 @@ class SignInCubit extends Cubit<SignInState> {
}
}
Future<void> signInWithGoogle() async {
if (state.status.isSubmissionInProgress) {
return;
}
emit(state.copyWith(status: FormStatus.submissionInProgress));
try {
await _authenticationRepository.signInWithGoogle();
_authenticationCubit.start();
emit(state.copyWith(status: FormStatus.submissionSuccess));
} on SignInWithGoogleFailureInterface catch (e) {
emit(
state.copyWith(
errorMessage: e.message,
status: FormStatus.submissionFailure,
),
);
} catch (_) {
emit(state.copyWith(status: FormStatus.submissionFailure));
}
}
Future<void> signInWithEmailAndPassword() async {
if (!state.status.isValidated) return;
emit(state.copyWith(status: FormStatus.submissionInProgress));
@@ -45,4 +45,14 @@ class SignInState extends Equatable {
@override
List<Object> get props => [email, password, status];
@override
String toString() {
return '''
email: $email,
password: $password,
status: $status,
errorMessage: $errorMessage,
''';
}
}
@@ -19,16 +19,9 @@ import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:flutter/foundation.dart';
import 'package:wyatt_authentication_bloc/src/authentication/cubit/authentication_cubit.dart';
import 'package:wyatt_authentication_bloc/src/form/form_data.dart';
import 'package:wyatt_authentication_bloc/src/form/form_input.dart';
import 'package:wyatt_authentication_bloc/src/form/form_status.dart';
import 'package:wyatt_authentication_bloc/src/form/form_validator.dart';
import 'package:wyatt_authentication_bloc/src/models/email.dart';
import 'package:wyatt_authentication_bloc/src/models/exceptions/exceptions_interface.dart';
import 'package:wyatt_authentication_bloc/src/models/operations.dart';
import 'package:wyatt_authentication_bloc/src/models/password.dart';
import 'package:wyatt_authentication_bloc/src/models/validation_error.dart';
import 'package:wyatt_authentication_bloc/src/repositories/authentication_repository_interface.dart';
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
part 'sign_up_state.dart';
@@ -51,16 +44,16 @@ class SignUpCubit extends Cubit<SignUpState> {
void emailChanged(String value) {
final Email email = Email.dirty(value);
final List<FormInput<dynamic, ValidationError>> inputsToValidate = [
final List<FormInputValidator<dynamic, ValidationError>> toValidate = [
email,
state.password,
...state.data.inputs<dynamic>(),
...state.data.validators<dynamic, ValidationError>(),
];
emit(
state.copyWith(
email: email,
status: FormValidator.validate(inputsToValidate),
status: FormStatus.validate(toValidate),
),
);
}
@@ -68,25 +61,26 @@ class SignUpCubit extends Cubit<SignUpState> {
void passwordChanged(String value) {
final Password password = Password.dirty(value);
final List<FormInput<dynamic, ValidationError>> inputsToValidate = [
final List<FormInputValidator<dynamic, ValidationError>> toValidate = [
state.email,
password,
...state.data.inputs<dynamic>(),
...state.data.validators<dynamic, ValidationError>(),
];
emit(
state.copyWith(
password: password,
status: FormValidator.validate(inputsToValidate),
status: FormStatus.validate(toValidate),
),
);
}
void dataChanged<T>(String field, FormInput dirtyValue) {
// Take from wyatt_form_bloc/wyatt_form_bloc.dart
void dataChanged<T>(String field, FormInputValidator dirtyValue) {
final _form = state.data.clone();
if (_form.contains(field)) {
_form.update(field, dirtyValue);
_form.updateValidator(field, dirtyValue);
} else {
throw Exception('Form field $field not found');
}
@@ -94,13 +88,18 @@ class SignUpCubit extends Cubit<SignUpState> {
emit(
state.copyWith(
data: _form,
status: FormValidator.validate(
[state.email, state.password, ..._form.inputs<dynamic>()],
status: FormStatus.validate(
[
state.email,
state.password,
...state.data.validators<dynamic, ValidationError>(),
],
),
),
);
}
// Take from wyatt_form_bloc/wyatt_form_bloc.dart
void updateFormData(
FormData data, {
SetOperation operation = SetOperation.replace,
@@ -125,8 +124,12 @@ class SignUpCubit extends Cubit<SignUpState> {
emit(
state.copyWith(
data: _form,
status: FormValidator.validate(
[state.email, state.password, ..._form.inputs<dynamic>()],
status: FormStatus.validate(
[
state.email,
state.password,
...state.data.validators<dynamic, ValidationError>(),
],
),
),
);
@@ -16,7 +16,6 @@
export 'authentication/authentication.dart';
export 'email_verification/email_verification.dart';
export 'form/form.dart';
export 'models/models.dart';
export 'password_reset/password_reset.dart';
export 'repositories/repositories.dart';

Some files were not shown because too many files have changed in this diff Show More