mirror of
https://github.com/rjNemo/bmi_calculator_app
synced 2026-06-06 02:16:41 +00:00
feat: add link to profile page
This commit is contained in:
parent
5a7ac79d22
commit
cb4d3b03af
3 changed files with 26 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'profile.dart';
|
||||
import 'result.dart';
|
||||
|
||||
class CalculatorPage extends StatefulWidget {
|
||||
|
|
@ -34,6 +35,15 @@ class _CalculatorPageState extends State<CalculatorPage> {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(Icons.person),
|
||||
tooltip: 'Open shopping cart',
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, ProfilePage.routeName);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'calculator.dart';
|
||||
import 'profile.dart';
|
||||
import 'result.dart';
|
||||
|
||||
void main() => runApp(BMIApp());
|
||||
|
|
@ -14,6 +15,7 @@ class BMIApp extends StatelessWidget {
|
|||
routes: {
|
||||
CalculatorPage.routeName: (context) => CalculatorPage(),
|
||||
ResultPage.routeName: (context) => ResultPage(),
|
||||
ProfilePage.routeName: (context) => ProfilePage(),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
14
lib/profile.dart
Normal file
14
lib/profile.dart
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProfilePage extends StatelessWidget {
|
||||
static const routeName = "/profile";
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Profile"),
|
||||
),
|
||||
body: Text("Hey"),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue