feat: add link to profile page

This commit is contained in:
Ruidy 2021-07-06 10:07:46 +02:00
parent 5a7ac79d22
commit cb4d3b03af
3 changed files with 26 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'profile.dart';
import 'result.dart'; import 'result.dart';
class CalculatorPage extends StatefulWidget { class CalculatorPage extends StatefulWidget {
@ -34,6 +35,15 @@ class _CalculatorPageState extends State<CalculatorPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(widget.title), title: Text(widget.title),
actions: <Widget>[
IconButton(
icon: Icon(Icons.person),
tooltip: 'Open shopping cart',
onPressed: () {
Navigator.pushNamed(context, ProfilePage.routeName);
},
),
],
), ),
body: Center( body: Center(
child: Column( child: Column(

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'calculator.dart'; import 'calculator.dart';
import 'profile.dart';
import 'result.dart'; import 'result.dart';
void main() => runApp(BMIApp()); void main() => runApp(BMIApp());
@ -14,6 +15,7 @@ class BMIApp extends StatelessWidget {
routes: { routes: {
CalculatorPage.routeName: (context) => CalculatorPage(), CalculatorPage.routeName: (context) => CalculatorPage(),
ResultPage.routeName: (context) => ResultPage(), ResultPage.routeName: (context) => ResultPage(),
ProfilePage.routeName: (context) => ProfilePage(),
}, },
); );
} }

14
lib/profile.dart Normal file
View 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"),
);
}
}