Skip to content

fix: clean arch#3

Open
JustWhiteForYou wants to merge 4 commits intomasterfrom
ClearArch
Open

fix: clean arch#3
JustWhiteForYou wants to merge 4 commits intomasterfrom
ClearArch

Conversation

@JustWhiteForYou
Copy link
Copy Markdown
Owner

Add some features to a clean arch:

  1. separated logic from markup;
  2. created file with consts;
  3. updated snackbar service for more comfotable usage;
  4. changed directories to make them easier to understand;

@Hohrenda

@JustWhiteForYou JustWhiteForYou self-assigned this Mar 24, 2023
Copy link
Copy Markdown
Collaborator

@Hohrenda Hohrenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! I've added a couple of naming suggestions - please take a look

@JustWhiteForYou
Copy link
Copy Markdown
Owner Author

Added Provider and some features for clean arch

@Hohrenda

Copy link
Copy Markdown
Collaborator

@Hohrenda Hohrenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work adding the Provider package. I added a couple of suggestions - please take a look

@JustWhiteForYou
Copy link
Copy Markdown
Owner Author

Add feature: database
Add ui on some screens
Refactored the code

Copy link
Copy Markdown
Collaborator

@Hohrenda Hohrenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! There are some minor suggestions though.

Comment on lines +1 to +6
export 'constants.dart';
export 'custom_button.dart';
export 'custom_drop_button.dart';
export 'custom_dropdown_items.dart';
export 'custom_text_field.dart';
export 'theme.dart'; No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't do this because there might be cases where not all imports from here are needed. I would prefer importing each widget on demand.

Comment on lines +31 to +33
contentPadding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 5),
labelText: labelText,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some int values are used multiple times. What do you think about creating a class called "SizeDimens" with frequently used values?

Comment on lines +37 to +40
Future.delayed(Duration.zero, () {
Navigator.pushNamedAndRemoveUntil(
context, '/main', (Route<dynamic> route) => false);
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please elaborate on why the Future.delayed is used here?

Comment on lines +59 to +62
Future.delayed(Duration.zero, () {
Navigator.pushNamedAndRemoveUntil(
context, '/', (Route<dynamic> route) => false);
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment on lines +1 to +3
export 'login.dart';
export 'signup.dart';
export 'verify_email.dart'; No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't do this because there might be cases where not all imports from here are needed. I prefer to import each widget on demand.

Comment on lines +31 to +34
case 'email-already-in-use':
return AuthErrorCode.emailAlreadyInUse;
case 'user-not-found':
case 'wrong-password':
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These cases can also be moved to the enum. Flutter supports enums with value:
image

Comment on lines +111 to +113
onTap: () {
// Navigator.pushNamed(context, '/navigate');
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants