home_page.dart 1.44 KB
Newer Older
1
import 'package:flutter/material.dart';
yenisleydi committed
2
import 'package:primer_practica/src/pages/category/lista_categorias.dart';
3 4

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
yenisleydi committed
10 11 12 13 14 15
      appBar: AppBar(
        title: const Text('Home'),
        backgroundColor: Colors.blue,
        actions: [
          IconButton(
            icon: const Icon(Icons.search),
yenisleydi committed
16 17
            onPressed: () {
              // Acción de búsqueda
yenisleydi committed
18 19 20
            },
          )
        ],
21
      ),
yenisleydi committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
      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'),
            ),
          ],
        ),
      ),
yenisleydi committed
44
      body: ListaCategorias(),
yenisleydi committed
45 46
      floatingActionButton: FloatingActionButton(
        onPressed: () {
yenisleydi committed
47
          Navigator.pushNamed(context, 'formulario');
yenisleydi committed
48 49 50 51 52
        },
        child: const Icon(Icons.add),
        tooltip: 'Agregar categoria',
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
53 54 55
    );
  }
}