Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
New mission done(?)
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Nov 5, 2021
1 parent f906a44 commit cbadc2e
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 51 deletions.
4 changes: 4 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
"hard_missions_desc": "Attempt hard missions to get more awesome prices!",
"eat_less": "Eat less...",
"eat_more": "Eat more...",
"within": "Within",
"days": "days",
"i_can_do_this": "I can do this!",
"challenge_accepted": "Challenge Accepted!",
"no_data_this_day": "No Data found for this day",
"recorded_menu": "Recorded Menu",
"breakfast": "Breakfast",
Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/app_th.arb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
"hard_missions_desc": "ลองทำภารกิจที่ยากๆ เพื่อให้ได้ราคาที่คุ้มค่า!",
"eat_less": "กินสิ่งนี้ให้น้อยลง",
"eat_more": "กินสิ่งนี้ให้มากขึ้น",
"within": "ภายใน",
"days": "วัน",
"i_can_do_this": "ฉันทำได้!",
"no_data_this_day": "ไม่พบข้อมูลของวันนี้",
"recorded_menu": "เมนูที่บันทึกไว้",
"breakfast": "อาหารเช้า",
Expand Down
146 changes: 96 additions & 50 deletions lib/views/mission/new_mission.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,69 +44,115 @@ class _NewMissionPageState extends State<NewMissionPage> {
body: Stack(
children: [
bgImage("clouds/top_orange.png"),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
missionBlock(text, text.eat_less, lightOrange),
missionBlock(text, text.eat_more, lightGreen),
],
Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
missionBlock(text, text.eat_less, lightOrange),
missionBlock(text, text.eat_more, lightGreen),
],
),
),
),
],
),
);
}

Widget missionBlock(AppLocalizations text, String title, Color color) =>
Padding(
padding: const EdgeInsets.all(16.0),
child: Container(
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(12.0),
),
child: Column(
children: [
Text(title),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6.0),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: missionButtons(),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(6.0),
Widget missionBlock(AppLocalizations text, String title, Color color) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Container(
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(12.0),
),
child: Column(
children: [
Text(title),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6.0),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: missionButtons(),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(6.0),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(text.within),
Container(
width: 60,
height: 40,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: TextField(
textAlign: TextAlign.center,
),
),
),
Text(text.days),
],
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text("within"),
Text("days"),
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(text.challenge_accepted),
backgroundColor: lightGreen,
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(
text.window_close,
style: const TextStyle(color: Colors.black),
),
)
],
),
),
),
);
},
child: Text(text.i_can_do_this),
style: tanBtn,
),
],
),
),
],
),
),
],
),
),
],
),
);
),
);
}

Widget missionButtons() => Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.264+2640000
version: 1.0.267+2670000

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down

0 comments on commit cbadc2e

Please sign in to comment.