diff --git a/ui/lib/APIs.dart b/ui/lib/APIs.dart index b5aa644..1adf7fe 100644 --- a/ui/lib/APIs.dart +++ b/ui/lib/APIs.dart @@ -1,4 +1,6 @@ class APIs { static const _baseUrl = "http://127.0.0.1:8080"; static const searchUrl = "$_baseUrl/api/v1/tv/search"; + + static const tmdbImgBaseUrl = "https://image.tmdb.org/t/p/w500/"; } diff --git a/ui/lib/main.dart b/ui/lib/main.dart index 0b8592e..f05d260 100644 --- a/ui/lib/main.dart +++ b/ui/lib/main.dart @@ -88,12 +88,13 @@ class _MyHomePageState extends State { // the App.build method, and use it to set our appbar title. title: Text(widget.title), ), - body: const Center( + body: Center( // Center is a layout widget. It takes a single child and positions it // in the middle of the parent. child: Row( children: [ NavDrawer(), + const VerticalDivider(thickness: 1, width: 1), SearchPage(), ], )), diff --git a/ui/lib/navdrawer.dart b/ui/lib/navdrawer.dart index 7f8d24d..b700e39 100644 --- a/ui/lib/navdrawer.dart +++ b/ui/lib/navdrawer.dart @@ -1,41 +1,55 @@ import 'package:flutter/material.dart'; class NavDrawer extends StatelessWidget { - const NavDrawer({super.key}); + var _counter = 0; @override Widget build(BuildContext context) { - return Drawer( - child: ListView( - padding: EdgeInsets.zero, - children: [ - ListTile( - leading: const Icon(Icons.input), - title: const Text('Welcome'), - onTap: () => {}, - ), - ListTile( - leading: const Icon(Icons.verified_user), - title: const Text('Profile'), - onTap: () => {Navigator.of(context).pop()}, - ), - ListTile( - leading: const Icon(Icons.settings), - title: const Text('Settings'), - onTap: () => {Navigator.of(context).pop()}, - ), - ListTile( - leading: const Icon(Icons.border_color), - title: const Text('Feedback'), - onTap: () => {Navigator.of(context).pop()}, - ), - ListTile( - leading: const Icon(Icons.exit_to_app), - title: const Text('Logout'), - onTap: () => {Navigator.of(context).pop()}, - ), - ], - ), - ); + return ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 300), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: NavigationRail( + selectedIndex: _counter, + onDestinationSelected: (value) {}, + extended: MediaQuery.of(context).size.width >= 850, + unselectedIconTheme: const IconThemeData(color: Colors.grey), + destinations: const [ + NavigationRailDestination( + icon: Icon(Icons.search), + label: Text('Buscar '), + ), + NavigationRailDestination( + icon: Icon(Icons.engineering), + label: Text('IngenierĂ­a '), + ), + NavigationRailDestination( + icon: Icon(Icons.business), + label: Text('Sociales '), + ), + NavigationRailDestination( + icon: Icon(Icons.local_hospital), + label: Text('Salud'), + ), + NavigationRailDestination( + icon: Icon(Icons.school), + label: Text('Iniciales'), + ), + NavigationRailDestination( + icon: Icon(Icons.design_services), + label: Text('Talleres y Extracurriculares'), + ), + ], + selectedLabelTextStyle: + TextStyle(color: Colors.lightBlue, fontSize: 20), + unselectedLabelTextStyle: + TextStyle(color: Colors.grey, fontSize: 18), + groupAlignment: -1, + minWidth: 56, + )) + ])); } } diff --git a/ui/lib/search.dart b/ui/lib/search.dart index 3345723..7849ac5 100644 --- a/ui/lib/search.dart +++ b/ui/lib/search.dart @@ -13,7 +13,6 @@ class SearchPage extends StatefulWidget { class _SearchPageState extends State { List list = List.empty(); - final tmdbImgBaseUrl = "https://image.tmdb.org/t/p/w500/"; void _queryResults(String q) async { final dio = Dio(); @@ -52,7 +51,7 @@ class _SearchPageState extends State { width: 150, height: 200, child: Image.network( - tmdbImgBaseUrl + m["poster_path"], + APIs.tmdbImgBaseUrl + m["poster_path"], fit: BoxFit.contain, ), ),