home_page.dart 1.72 KB
Newer Older
1 2 3
import 'package:flutter/material.dart';

class HomePage extends StatelessWidget {
yenisleydi committed
4
  const HomePage({Key? key}) : super(key: key);
5 6 7 8

  @override
  Widget build(BuildContext context) {
    return Scaffold(
yenisleydi committed
9 10 11 12 13 14 15 16 17 18 19
      appBar: AppBar(
        title: const Text('Home'),
        backgroundColor: Colors.blue,
        actions: [
          IconButton(
            icon: const Icon(Icons.search),
            onPressed: (){

            },
          )
        ],
20
      ),
yenisleydi committed
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
      drawer: Drawer(
        child: ListView(
          padding: EdgeInsets.zero,
          children: [
            const DrawerHeader(
              decoration: BoxDecoration(
                color: Colors.blue,
              ),
              child: Text('Menu'),
            ),
            ListTile(
              title: const Text('Configuraciones'),
            ),
            ListTile(
              title: const Text('Ayuda'),
            ),
            ListTile(
              title: const Text('Exit'),
            ),
          ],
        ),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text('Hola home page'),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, 'articles');
52
              },
yenisleydi committed
53
              child: const Text('Ir a Articles Page'),
54 55 56
            ),
          ],
        ),
57
      ),
yenisleydi committed
58 59 60 61 62 63 64 65
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          Navigator.pushNamed(context, 'login');
        },
        child: const Icon(Icons.add),
        tooltip: 'Agregar categoria',
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
66 67 68
    );
  }
}