Co-authored-by: Azareth-Tr <Azareth-Tr@users.noreply.github.com> Co-authored-by: eddgranados12 <eddgranados12@users.noreply.github.com> implementacion de login, vistas, correcion de errores en vista registro, domicilios
51 lines
1.2 KiB
Dart
51 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
class CitizenShell extends StatefulWidget {
|
|
const CitizenShell({super.key, required this.child});
|
|
final Widget child;
|
|
|
|
@override
|
|
State<CitizenShell> createState() => _CitizenShellState();
|
|
}
|
|
|
|
class _CitizenShellState extends State<CitizenShell> {
|
|
int _currentIndex = 0;
|
|
|
|
void _onTap(int index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
switch (index) {
|
|
case 0:
|
|
context.go('/home');
|
|
break;
|
|
case 1:
|
|
context.go('/guide');
|
|
break;
|
|
case 2:
|
|
context.go('/feedback');
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: widget.child,
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: _currentIndex,
|
|
onTap: _onTap,
|
|
items: const [
|
|
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Inicio'),
|
|
BottomNavigationBarItem(icon: Icon(Icons.menu_book), label: 'Guía'),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.feedback),
|
|
label: 'Retroalimentación',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|