-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use only one library .dart
file in sharezone_widgets
package. #538
#543
Conversation
…le to correct spelling
To view this pull requests documentation preview, visit the following URL: docs.page/sharezoneapp/sharezone-app~543 Documentation is deployed and generated using docs.page. |
.dart
file in sharezone_widgets
package. #538
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks for your PR! :)
Looks good so far, although there are some things that still need to be changed:
- Your auto-formatting seemed to have mode some changes to Strings inside our code (see the example I commented on below). For this PR I would like to not make these kind of changes. If possible please revert these changes.
- Under
[...]/sharezone_widgets/lib
there are still the filesanimated_visibility.dart
,expanded_chip.dart
,sharezone_widgets.dart
,wrapper.dart
. These can be moved tosharezone_widgets/lib/src
and also be exported insidesharezone_widgets/lib/sharezone_widgets.dart
. - I get the error that
The imported package 'flare_flutter' isn't a dependency of the importing package. Try adding a dependency for 'flare_flutter' in the 'pubspec.yaml' file.
I don't know why this wasn't an error before, but it needs to be fixed anyways. So this means thatflare_flutter: ^3.0.2
needs to be added to thesharezone_widgets/pubspec.yaml
(this is the same version that is in theapp/pubspec.yaml
) - There are several lints that are shown in my IDE. These need to be fixed, otherwise our pipeline will fail.
Analyzer lints:
sharezone_widgets (lib/sharezone_widgets):
error - Target of URI doesn't exist: 'package:flare_flutter/flare_actor.dart' at lib\src\placeholder.dart:9:8 - (uri_does_not_exist)
error - The method 'FlareActor' isn't defined for the type '_Rive' at lib\src\placeholder.dart:219:14 - (undefined_method)
info - The import of '../../dialog_wrapper.dart' is unnecessary because all of the used elements are also provided by the import of 'package:sharezone_widgets/sharezone_widgets.dart' at lib\src\adaptive_dialog\left_and_right_action_dialog\left_and_right_action_adaptive_dialog.dart:15:8 - (unnecessary_import)
info - The import of '../adaptive_dialog_action.dart' is unnecessary because all of the used elements are also provided by the import of 'package:sharezone_widgets/sharezone_widgets.dart' at lib\src\adaptive_dialog\left_and_right_action_dialog\left_and_right_action_adaptive_dialog.dart:16:8 - (unnecessary_import)
info - The import of 'long_press.dart' is unnecessary because all of the used elements are also provided by the import of 'package:sharezone_widgets/sharezone_widgets.dart' at lib\src\adaptive_dialog\long_press_dialog\long_press_adaptive_dialog.dart:15:8 - (unnecessary_import)
info - The imported package 'flare_flutter' isn't a dependency of the importing package at lib\src\placeholder.dart:9:8 - (depend_on_referenced_packages)
info - Constructors for public widgets should have a named 'key' parameter at lib\src\placeholder.dart:18:9 - (use_key_in_widget_constructors)
info - Use 'const' with the constructor to improve performance at lib\src\placeholder.dart:88:26 - (prefer_const_constructors)
info - The import of 'package:sharezone_widgets/src/state_sheet/state_dialog_content.dart' is unnecessary because all of the used elements are also provided by the import of 'package:sharezone_widgets/sharezone_widgets.dart' at lib\src\state_sheet\dialog.dart:11:8 - (unnecessary_import)
info - The import of '../dialog_wrapper.dart' is unnecessary because all of the used elements are also provided by the import of 'package:sharezone_widgets/sharezone_widgets.dart' at lib\src\state_sheet\dialog.dart:14:8 - (unnecessary_import)
info - The import of 'state_sheet_content.dart' is unnecessary because all of the used elements are also provided by the import of 'package:sharezone_widgets/sharezone_widgets.dart' at lib\src\state_sheet\sheet.dart:12:8 - (unnecessary_import)
sharezone_app (app):
info - Sort directive sections alphabetically at lib\blackboard\details\blackboard_details.dart:28:1 - (directives_ordering)
info - Unused import: 'package:sharezone/homework/shared/placeholder_templates.dart' at lib\pages\homework\homework_details\submissions\homework_create_submission_page.dart:17:8 - (unused_import)
content: Text( | ||
'Möchtest du den Kurs "$courseName" wirklich endgültig löschen?\n\nEs werden alle Stunden & Termine aus dem Stundenplan, Hausaufgaben und Einträge aus dem Schwarzen Brett und gelöscht.\n\nAuf den Kurs kann von niemanden mehr zugegriffen werden!')); | ||
context: context, | ||
right: AdaptiveDialogAction.delete, | ||
defaultValue: false, | ||
title: "Kurs löschen?", | ||
content: Text( | ||
'Möchtest du den Kurs "$courseName" wirklich endgültig löschen?\n\n' | ||
'Es werden alle Stunden & Termine aus dem Stundenplan, Hausaufgaben ' | ||
'und Einträge aus dem Schwarzen Brett und gelöscht.\n\n' | ||
'Auf den Kurs kann von niemanden mehr zugegriffen werden!', | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this was done by some auto-formatting on your end? This change was made in several places in this PR.
I mean it's not a bad change per se but as we don't use that kind of String formatting currently I would be more comfortable if you could revert these kind of changes in this PR.
Some actions (should be |
…idgets/pubspec.yaml
…rapper.dart to sharezone_widgets.dart bundle
Thanks for the feedback. I moved the remaining files to I also tried fixing the I am still working on reverting the strings. This may well be a result of my formatter, as I find strings more readable that way, and the autoformat key is quickly pressed - I apologise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only two more minor changes needed, otherwise it LGTM! :)
.gitignore
Outdated
# IDE | ||
|
||
## VS Code | ||
.vscode/* | ||
!.vscode/launch.json | ||
!.vscode/settings.json | ||
|
||
## Android Studio / IntelliJ | ||
.idea/ | ||
|
||
# FVM will create a relative symlink in your project from .fvm/flutter_sdk to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert since it has nothing todo with the goal of this PR.
app/pubspec.yaml
Outdated
@@ -74,7 +74,6 @@ dependencies: | |||
firebase_messaging: ^14.2.5 | |||
firebase_performance: ^0.9.0+14 | |||
firebase_storage: ^11.0.14 | |||
flare_flutter: ^3.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove it here. We need it both in app/pubspec.yaml
and lib/sharezone_widgets/pubspec.yaml
.
This reverts commit 061d902.
# Conflicts: # app/lib/donate/page/donate_page.dart # app/lib/navigation/models/navigation_item.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💙🎉
@nilsreichardt How should we go about merging this? Just force-merge? Might the merge queue cause problems? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -54,7 +54,10 @@ class _Title extends StatelessWidget { | |||
Widget build(BuildContext context) { | |||
return Text( | |||
name, | |||
style: const TextStyle(color: Colors.white, fontFamily: rubik), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note for future PRs: Would be great to only have changes in a PR that fit the purpose of the PR. This purpose of the PR is to refactor the imports of the sharezone_widgets
package and should not contain any formatting changes like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I guess thats the same kind of auto-formatting that would happen if we save the file again to edit the imports ourselves, no? So I don't know if thats the case I don't have a problem with it really 🤷♂️
Or is it different formatting from ours?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, in this case a comma has been added manually after fontFamily: rubit
and then it was formatted
Yes, just force merging. Force merging also skips the merge queue. |
Alright, thanks again @Marc-R2 :) |
Description
All files in
lib/sharezone_widgets/lib/[...].dart
that contained only exports were merged into onesharezone_widgets/lib/sharezone_widgets.dart
and the individual export files were removed.Note:
There were two duplicate widgets
PlaceholderModel && PlaceholderWidgetWithAnimation
implemented in bothapp/lib/homework/shared/placeholder_templates.dart
andlib/sharezone_widgets/lib/src/placeholder.dart
.This caused an import conflict as both were imported due to the bundling. Since the widgets were (almost) identical, I merged them into
lib/sharezone_widgets/lib/src/placeholder.dart
and removed them fromapp/lib/homework/shared/placeholder_templates.dart
(and the associated private widgets were also moved).Related Tickets
Closes #538