2023-03-30 15:19:24 +13:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
void main() {
|
2023-04-05 12:24:48 +12:00
|
|
|
runApp(MyApp());
|
2023-03-30 15:19:24 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
2023-04-05 12:24:48 +12:00
|
|
|
title: 'Gym App',
|
2023-03-30 15:19:24 +13:00
|
|
|
theme: ThemeData(
|
|
|
|
primarySwatch: Colors.blue,
|
2023-04-05 12:24:48 +12:00
|
|
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
2023-03-30 15:19:24 +13:00
|
|
|
),
|
2023-04-05 12:24:48 +12:00
|
|
|
home: HomePage(),
|
2023-03-30 15:19:24 +13:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
class HomePage extends StatelessWidget {
|
|
|
|
final List<String> _pageTitles = [
|
|
|
|
'Home',
|
|
|
|
'Plans',
|
|
|
|
'Best',
|
|
|
|
'Workouts',
|
|
|
|
'Timer',
|
|
|
|
'Settings'
|
|
|
|
];
|
2023-03-30 15:19:24 +13:00
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text(_pageTitles[0]),
|
|
|
|
),
|
|
|
|
drawer: Drawer(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: _pageTitles.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return ListTile(
|
|
|
|
title: Text(_pageTitles[index]),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pushNamed(
|
|
|
|
context, '/${_pageTitles[index].toLowerCase()}');
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: Center(
|
|
|
|
child: Text('Welcome to the Home Page!'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2023-03-30 15:19:24 +13:00
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
class PlansPage extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('Plans'),
|
|
|
|
),
|
|
|
|
body: Center(
|
|
|
|
child: Text('Welcome to the Plans Page!'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2023-03-30 15:19:24 +13:00
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
class BestPage extends StatelessWidget {
|
2023-03-30 15:19:24 +13:00
|
|
|
@override
|
2023-04-05 12:24:48 +12:00
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('Best'),
|
|
|
|
),
|
|
|
|
body: Center(
|
|
|
|
child: Text('Welcome to the Best Page!'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2023-03-30 15:19:24 +13:00
|
|
|
}
|
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
class WorkoutsPage extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('Workouts'),
|
|
|
|
),
|
|
|
|
body: Center(
|
|
|
|
child: Text('Welcome to the Workouts Page!'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2023-03-30 15:19:24 +13:00
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
class TimerPage extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('Timer'),
|
|
|
|
),
|
|
|
|
body: Center(
|
|
|
|
child: Text('Welcome to the Timer Page!'),
|
|
|
|
),
|
|
|
|
);
|
2023-03-30 15:19:24 +13:00
|
|
|
}
|
2023-04-05 12:24:48 +12:00
|
|
|
}
|
2023-03-30 15:19:24 +13:00
|
|
|
|
2023-04-05 12:24:48 +12:00
|
|
|
class SettingsPage extends StatelessWidget {
|
2023-03-30 15:19:24 +13:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
2023-04-05 12:24:48 +12:00
|
|
|
title: Text('Settings'),
|
2023-03-30 15:19:24 +13:00
|
|
|
),
|
|
|
|
body: Center(
|
2023-04-05 12:24:48 +12:00
|
|
|
child: Text('Welcome to the Settings Page!'),
|
2023-03-30 15:19:24 +13:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|