Skip to content

Commit

Permalink
after form, yoga, yoga form, profile done
Browse files Browse the repository at this point in the history
  • Loading branch information
KaushalBinjola committed Nov 27, 2021
1 parent d3766f9 commit 99636a5
Show file tree
Hide file tree
Showing 9 changed files with 1,103 additions and 247 deletions.
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "athleap_flutter",
"request": "launch",
"type": "dart"
},
{
"name": "athleap_flutter (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
}
98 changes: 90 additions & 8 deletions lib/pages/afterForm.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import 'package:flutter/material.dart';
import 'package:scratcher/scratcher.dart';

var main_color = const Color(0xfffa9b70);

class AfterForm extends StatelessWidget {
const AfterForm({Key? key, required this.calories, this.fcoins})
: super(key: key);
class AfterForm extends StatefulWidget {
final calories;
final fcoins;
AfterForm({Key? key, required this.calories, this.fcoins}) : super(key: key);

@override
_AfterFormState createState() => _AfterFormState();
}

class _AfterFormState extends State<AfterForm> {
double _opacity = 0.0;

@override
Widget build(BuildContext context) {
Expand All @@ -19,11 +26,86 @@ class AfterForm extends StatelessWidget {
centerTitle: true,
backgroundColor: main_color,
),
body: Row(
children: <Widget>[
Text("Calories: $calories"),
Text(", Fcoins: $fcoins")
],
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(20),
child: Text(
"Scratch to get your Result!",
style: TextStyle(
// color: Color(0xfffa9b70)
fontSize: 20,
),
),
),
Scratcher(
accuracy: ScratchAccuracy.low,
threshold: 70,
brushSize: 50,
onThreshold: () {
setState(() {
_opacity = 1;
});
},
child: AnimatedOpacity(
duration: Duration(milliseconds: 250),
opacity: _opacity,
child: Container(
height: 300,
width: 300,
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
"Congratulations!",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 35,
color: Color(0xfffa9b70),
),
),
Text(
"Calories Burnt:",
style: TextStyle(
// fontWeight: FontWeight.bold,
fontSize: 25,
color: Color(0xfffa9b70),
),
),
Text(
"${widget.calories}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 50,
color: Color(0xfffa9b70),
),
),
Text(
"FCoins Earned:",
style: TextStyle(
// fontWeight: FontWeight.bold,
fontSize: 25,
color: Color(0xfffa9b70),
),
),
Text(
"${widget.fcoins}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 50,
color: Color(0xfffa9b70),
),
),
],
),
),
),
)
],
),
),
);
}
Expand Down
Loading

0 comments on commit 99636a5

Please sign in to comment.