-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit * Documentation * Added prof img * Profile page done * Added svgs * Minor padding fix * Updated home page
- Loading branch information
1 parent
fe9741a
commit a047d69
Showing
11 changed files
with
449 additions
and
214 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:game/utils/utility_functions.dart'; | ||
|
||
/** | ||
* Widget that represents each individual achievement | ||
* @param name: Name of the achievement | ||
* @param tasksFinished: Number of currently completed tasks towards the achievement | ||
* @param totalTasks: Total number of tasks needed to gain achievement | ||
* @param picture: picture that is associated with the achievement | ||
*/ | ||
Widget achievementCell( | ||
String name, int tasksFinished, int totalTasks, String picture) { | ||
return Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Container( | ||
width: 380, | ||
height: 100, | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.circular(10.0), | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Color.fromRGBO(0, 0, 0, 0.25), | ||
offset: Offset(0, 4), | ||
blurRadius: 4, | ||
), | ||
]), | ||
child: Row( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.only( | ||
left: 18.0, top: 15, bottom: 15, right: 15), | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(20), | ||
child: Image( | ||
width: 80, | ||
height: 80, | ||
image: AssetImage(picture), | ||
fit: BoxFit.cover, | ||
)), | ||
), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
Container( | ||
width: 250, | ||
child: Text( | ||
name, | ||
overflow: TextOverflow.ellipsis, | ||
maxLines: 2, | ||
style: TextStyle( | ||
fontWeight: FontWeight.w500, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
Row( | ||
children: [ | ||
Stack(children: [ | ||
Container( | ||
width: 200, | ||
height: 20, | ||
alignment: Alignment.centerLeft, | ||
child: Container( | ||
decoration: new BoxDecoration( | ||
color: Color.fromARGB(255, 241, 241, 241), | ||
shape: BoxShape.rectangle, | ||
borderRadius: | ||
BorderRadius.all(Radius.circular(16.0)), | ||
), | ||
), | ||
), | ||
Container( | ||
width: | ||
(totalTasks > 0 ? tasksFinished / totalTasks : 0) * | ||
200, | ||
height: 20, | ||
alignment: Alignment.centerLeft, | ||
child: Container( | ||
decoration: new BoxDecoration( | ||
color: Color.fromARGB(197, 237, 86, 86), | ||
shape: BoxShape.rectangle, | ||
borderRadius: | ||
BorderRadius.all(Radius.circular(16.0)), | ||
), | ||
), | ||
), | ||
]), | ||
Padding( | ||
padding: const EdgeInsets.only(left: 8.0), | ||
child: SvgPicture.asset("assets/icons/location.svg"), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.only(left: 8.0), | ||
child: Text( | ||
tasksFinished.toString() + "/" + totalTasks.toString(), | ||
), | ||
), | ||
], | ||
), | ||
], | ||
) | ||
], | ||
)), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:game/utils/utility_functions.dart'; | ||
|
||
/** | ||
* Widget that represents each individual completed journey or challenge | ||
* @param name: Name of the challenge or journey completed | ||
* @param type: an enum of type CompeltedType either a journey or challenge | ||
* @param date: Date that the journey / challenge was completed | ||
* @param location: picture that is associated with the achievement | ||
* @param difficulty: level of the task, either easy, medium, or hard | ||
* @param points: Points that the completed journey / challenge had | ||
*/ | ||
Widget completedCell(String name, String picture, String type, String date, | ||
String location, String difficulty, int points) { | ||
return Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Container( | ||
width: 380, | ||
height: 100, | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.circular(10.0), | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Color.fromRGBO(0, 0, 0, 0.25), | ||
offset: Offset(0, 4), | ||
blurRadius: 4, | ||
), | ||
]), | ||
child: Row( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.only( | ||
left: 18.0, top: 15, bottom: 15, right: 15), | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(20), | ||
child: Image( | ||
width: 80, | ||
height: 80, | ||
image: AssetImage(picture), | ||
fit: BoxFit.cover, | ||
)), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.only(left: 8.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.only(top: 8.0), | ||
child: Text( | ||
name, | ||
overflow: TextOverflow.ellipsis, | ||
maxLines: 1, | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
Row( | ||
children: [ | ||
Text( | ||
"From " + type + " - ", | ||
style: TextStyle(color: Colors.grey), | ||
), | ||
Text(date) | ||
], | ||
), | ||
Padding( | ||
padding: const EdgeInsets.only(top: 8.0), | ||
child: Container( | ||
width: 200, | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Container( | ||
width: 80, | ||
height: 30, | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
color: Colors.purple, // Set the outline color | ||
width: 2.0, // Set the outline width | ||
), | ||
borderRadius: BorderRadius.circular( | ||
15.0), // Set border radius | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
SvgPicture.asset( | ||
'assets/icons/flag.svg', | ||
), | ||
Text( | ||
location, | ||
style: TextStyle( | ||
color: Colors.purple, | ||
fontSize: 10, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
Container( | ||
width: 50, | ||
height: 30, | ||
decoration: BoxDecoration( | ||
color: Color.fromRGBO(249, 236, 217, 1), | ||
borderRadius: BorderRadius.circular( | ||
20.0), // Set border radius | ||
), | ||
child: Center( | ||
child: Text( | ||
difficulty, | ||
style: TextStyle( | ||
fontSize: 10, | ||
), | ||
), | ||
), | ||
), | ||
Container( | ||
width: 50, | ||
height: 30, | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
color: Color.fromRGBO( | ||
189, 135, 31, 1), // Set the outline color | ||
width: 1.38, // Set the outline width | ||
), | ||
color: Color.fromRGBO(255, 199, 55, 1), | ||
borderRadius: BorderRadius.circular( | ||
15.0), // Set border radius | ||
), | ||
child: Center( | ||
child: Text( | ||
points.toString() + " PTS", | ||
style: TextStyle( | ||
fontSize: 10, | ||
), | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
) | ||
], | ||
)), | ||
); | ||
} |
Oops, something went wrong.