-
Notifications
You must be signed in to change notification settings - Fork 0
/
results_page.dart
83 lines (81 loc) · 2.45 KB
/
results_page.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
import 'package:Bmi/components/reusable_card.dart';
import 'package:Bmi/screens/manual_calculator.dart';
import 'package:flutter/material.dart';
import '../constants.dart';
import 'package:Bmi/components/bottom_button.dart';
class ResultsPage extends StatelessWidget {
ResultsPage(
{required this.interpretation,
required this.bmiResult,
required this.resultText});
final String bmiResult;
final String resultText;
final String interpretation;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Center(
child: Text(
'BMI Calculator ',
),
),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(15),
alignment: Alignment.bottomLeft,
child: Text(
'Your Result',
style: kTitleTextStyle,
),
),
),
Expanded(
flex: 5,
child: ReusableCard(
onPress: () {},
colour: kActiveCardColour,
cardChild: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
resultText.toUpperCase(),
style: kResultTextStyle,
),
Text(
bmiResult,
style: kBMITextStyle,
),
Text(
interpretation,
textAlign: TextAlign.center,
style: kBodyTextStyle,
),
],
),
),
),
BottomButton(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) {
return Calculator();
},
),
);
},
buttonTitle: 'Calculate Manually'),
],
),
);
}
}