Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1dc30ad
feat: add dependencies into pubspec.yaml
AliHoseinpoor Feb 5, 2023
d1d3353
feat: add analysis rules
AliHoseinpoor Feb 5, 2023
4d21121
feat: add injection config
AliHoseinpoor Feb 5, 2023
47c1eda
feat: add theme config and routing config
AliHoseinpoor Feb 5, 2023
fa472b8
feat: add splash page and home page
AliHoseinpoor Feb 5, 2023
a4e3123
feat: add value object for person and add validation file
AliHoseinpoor Feb 5, 2023
e927e27
feat: add floor database to project
AliHoseinpoor Feb 5, 2023
a35e857
feat: add customer repository
AliHoseinpoor Feb 5, 2023
8560c47
feat: add bloc for create customer
AliHoseinpoor Feb 5, 2023
7c0c926
feat: add textField widget
AliHoseinpoor Feb 5, 2023
98c1e56
feat: add form for create customer, and complete logic of add customer
AliHoseinpoor Feb 5, 2023
138ec9c
feat: complete add customer logic and ui
AliHoseinpoor Feb 5, 2023
a6abc17
feat: add get all customers bloc
AliHoseinpoor Feb 5, 2023
b442d51
feat: add delete customer bloc
AliHoseinpoor Feb 5, 2023
d17979d
feat: complete delete customer ui
AliHoseinpoor Feb 5, 2023
ce7d54b
feat: add update customer logic and ui
AliHoseinpoor Feb 5, 2023
2e40f2f
fix: change error message in update customer
AliHoseinpoor Feb 6, 2023
fa86d39
feat: add poppins font and add animation to customer list
AliHoseinpoor Feb 6, 2023
4158eca
feat: add quarterCircle widget to home page
AliHoseinpoor Feb 6, 2023
a1b25a7
fix: fix return data in action dialog
AliHoseinpoor Feb 6, 2023
3bb47e7
feat: add video for test app
AliHoseinpoor Feb 6, 2023
4e06f17
update README.md
AliHoseinpoor Feb 6, 2023
02bd3c3
update README.md
AliHoseinpoor Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 1 addition & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
# CRUD Code Test

Please read each note very carefully!
Feel free to add/change project structure to a clean architecture to your view.
and if you are not able to work on FrontEnd project, you can add a Swagger UI
in a new Front project.

Create a simple CRUD application with that implements the below model:

```
Customer {
Firstname
Lastname
DateOfBirth
PhoneNumber
Email
BankAccountNumber
}
```

## Practices and patterns (Must)

- [TDD](https://en.wikipedia.org/wiki/Test-driven_development)
- [DDD](https://en.wikipedia.org/wiki/Domain-driven_design)
- [BDD](https://en.wikipedia.org/wiki/Behavior-driven_development): [Acceptance Test](https://en.wikipedia.org/wiki/Acceptance_testing)
- Clean git commits that shows your work progress.

## Clean Architecture (Must)

<img src="./clean_architecture.png" max-width="250px" max-height="250px" />

### Validations (Must)

- During Create; validate the phone number to be a valid *mobile* number only (You can use [Google LibPhoneNumber](https://github.com/google/libphonenumber) to validate number at the backend).

- A Valid email and a valid bank account number must be checked before submitting the form.

- Customers must be unique in database: By `Firstname`, `Lastname` and `DateOfBirth`.

- Email must be unique in the database.

### Storage (Must)

- Use database of choise to store data.

- Store the phone number in a database with minimized space storage (choose `varchar`/`string`, or `Uint64` whichever store less space).

### Submit your result

Please clone this repository in a new github repository in private mode and share with ID: `mason-chase` in private mode on github.com and then create a [PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) that only shows what you have changed in the project, it means you must make sure that my commits are not erased from the history.
[See the full application test](https://github.com/AliHoseinpoor/mason-chase/blob/develop/test.mp4)
68 changes: 41 additions & 27 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
errors:
close_sinks: error
avoid_print: warning
prefer_foreach: error
missing_return: error
prefer_is_empty: error
avoid_empty_else: error
camel_case_types: error
must_be_immutable: error
empty_statements: error
use_string_buffers: error
annotate_overrides: error
prefer_is_not_empty: error
prefer_final_locals: error
always_specify_types: error
cancel_subscriptions: error
missing_required_param: error
camel_case_extensions: error
unnecessary_statements: error
sort_constructors_first: error
sized_box_for_whitespace: error
prefer_final_in_for_each: error
constant_identifier_names: error
empty_constructor_bodies: error
prefer_const_constructors: error
prefer_const_declarations: error
sort_child_properties_last: error
always_declare_return_types: error
avoid_unnecessary_containers: error
non_constant_identifier_names: error
sort_unnamed_constructors_first: error
avoid_positional_boolean_parameters: warning
avoid_classes_with_only_static_members: warning
prefer_const_constructors_in_immutables: error
always_put_required_named_parameters_first: error
prefer_final_fields: error
avoid_redundant_argument_values: error
missing_enum_constant_in_switch: error
unrelated_type_equality_checks: error
deprecated_member_use: error
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mc_crud_test"
minSdkVersion flutter.minSdkVersion
minSdkVersion 18
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Binary file added assets/font/poppins/Poppins-Bold.ttf
Binary file not shown.
Binary file added assets/font/poppins/Poppins-Fat.ttf
Binary file not shown.
Binary file added assets/font/poppins/Poppins-Heavy.ttf
Binary file not shown.
Binary file added assets/font/poppins/Poppins-Medium.ttf
Binary file not shown.
Binary file added assets/font/poppins/Poppins-Regular.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions assets/image/icon/add_person.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/image/icon/arrow_ios_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/image/icon/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/image/icon/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/image/icon/close_circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/image/icon/close_circle_bold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/image/icon/customers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/image/icon/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/image/icon/email.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/image/icon/mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/image/icon/profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/image/icon/success.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/image/icon/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/image/icon/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/logo/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading