import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Gym App', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: HomePage(), ); } } class HomePage extends StatelessWidget { final List _pageTitles = [ 'Home', 'Plans', 'Best', 'Workouts', 'Timer', 'Settings' ]; @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!'), ), ); } } 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!'), ), ); } } class BestPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Best'), ), body: Center( child: Text('Welcome to the Best Page!'), ), ); } } 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!'), ), ); } } 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!'), ), ); } } class SettingsPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Settings'), ), body: Center( child: Text('Welcome to the Settings Page!'), ), ); } }