-
Notifications
You must be signed in to change notification settings - Fork 107
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
Updated some files for better GUI #41
Conversation
lib/screens/activity_edit_sheet.dart
Outdated
@@ -1,5 +1,8 @@ | |||
import 'package:flutter/cupertino.dart' as c; | |||
import 'package:flutter/widgets.dart'; | |||
import 'package:star_book/models/mood.dart'; | |||
import 'package:star_book/utils/color.dart'; | |||
import 'package:star_book/widgets/color_container.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.
Use relative import.
Add them below //Files
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.
Okay let me check what do you mean.
lib/screens/activity_edit_sheet.dart
Outdated
@@ -23,6 +26,7 @@ class _ActivityEditSheetState extends State<ActivityEditSheet> { | |||
Activity activity; | |||
final TextEditingController titleController = TextEditingController(); | |||
final TextEditingController noteController = TextEditingController(); | |||
var containerColor; |
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 think that there is no need for this variable
lib/screens/activity_edit_sheet.dart
Outdated
text: "Mood", | ||
icon: c.CupertinoIcons.right_chevron, | ||
color: containerColor, |
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.
Make a function to get container color
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.
Working on this
lib/screens/activity_edit_sheet.dart
Outdated
@@ -70,6 +74,14 @@ class _ActivityEditSheetState extends State<ActivityEditSheet> { | |||
} | |||
|
|||
Widget _buildBody(BuildContext context) { | |||
// Before we return the body of the main context/activity sheet, it checks the conditions everytime |
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.
return the result from that function based on the condition.
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.
Yes let me fix that using the method.
lib/widgets/color_container.dart
Outdated
), | ||
), | ||
Container( | ||
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), | ||
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8), |
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.
8 seems a bit small. what do you say?
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.
8 Looks better but Let me change it to 10
Completed all of the tasks, you can review them and let me know for any further changings |
lib/screens/activity_edit_sheet.dart
Outdated
import '../models/activity.dart'; | ||
import '../widgets/my_container.dart'; | ||
import '../controllers/activity.dart'; | ||
import '../styles/style.dart'; | ||
import 'package:star_book/utils/color.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.
import 'package:star_book/utils/color.dart'; | |
import '../utils/color.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.
fixed
lib/screens/activity_edit_sheet.dart
Outdated
import '../models/activity.dart'; | ||
import '../widgets/my_container.dart'; | ||
import '../controllers/activity.dart'; | ||
import '../styles/style.dart'; | ||
import 'package:star_book/utils/color.dart'; | ||
import 'package:star_book/widgets/color_container.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.
import 'package:star_book/widgets/color_container.dart'; | |
import '../widgets/color_container.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.
fixed
lib/screens/activity_edit_sheet.dart
Outdated
@@ -54,6 +55,14 @@ class _ActivityEditSheetState extends State<ActivityEditSheet> { | |||
Navigator.of(context, rootNavigator: true).pop(); | |||
} | |||
|
|||
c.CupertinoDynamicColor _getMoodColor() { | |||
return activity.moodId == null | |||
? c.CupertinoColors.systemGrey |
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.
? c.CupertinoColors.systemGrey | |
? c.CupertinoDynamicColor.resolve( c.CupertinoColors.tertiarySystemGroupedBackground, context) |
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.
fixed
lib/screens/activity_edit_sheet.dart
Outdated
return activity.moodId == null | ||
? c.CupertinoColors.systemGrey | ||
: getColor( | ||
EColor.values[activity.moodId], |
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.
EColor.values[activity.moodId], | |
c.CupertinoDynamicColor.resolve(EColor.values[activity.moodId], context) |
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.
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.
c.CupertinoDynamicColor _getMoodColor() {
return c.CupertinoDynamicColor.resolve(
activity.moodId == null
? c.CupertinoColors.tertiarySystemGroupedBackground
: getColor(
EColor.values[activity.moodId],
),
context,
);
Check the GUI please #40