diff --git a/packages/uni_app/lib/generated/intl/messages_en.dart b/packages/uni_app/lib/generated/intl/messages_en.dart index 6202e906e..6a741b4cb 100644 --- a/packages/uni_app/lib/generated/intl/messages_en.dart +++ b/packages/uni_app/lib/generated/intl/messages_en.dart @@ -35,7 +35,7 @@ class MessageLookup extends MessageLookupByLibrary { 'calendario': 'Calendar', 'biblioteca': 'Library', 'percurso_academico': 'Academic Path', - 'transportes': 'Transports', + 'mapa': 'Map', 'faculdade': 'Faculty', 'other': 'Other', })}"; diff --git a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart index 0aa3756ff..c4ce2595f 100644 --- a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart +++ b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart @@ -35,7 +35,7 @@ class MessageLookup extends MessageLookupByLibrary { 'calendario': 'Calendário', 'biblioteca': 'Biblioteca', 'percurso_academico': 'Percurso Académico', - 'transportes': 'Transportes', + 'mapa': 'Mapa', 'faculdade': 'Faculdade', 'other': 'Outros', })}"; diff --git a/packages/uni_app/lib/generated/l10n.dart b/packages/uni_app/lib/generated/l10n.dart index 83ba9835f..339abb28b 100644 --- a/packages/uni_app/lib/generated/l10n.dart +++ b/packages/uni_app/lib/generated/l10n.dart @@ -903,7 +903,7 @@ class S { ); } - /// `{title, select, horario{Schedule} exames{Exams} area{Personal Area} cadeiras{Course Units} autocarros{Buses} locais{Places} restaurantes{Restaurants} calendario{Calendar} biblioteca{Library} percurso_academico{Academic Path} transportes{Transports} faculdade{Faculty} other{Other}}` + /// `{title, select, horario{Schedule} exames{Exams} area{Personal Area} cadeiras{Course Units} autocarros{Buses} locais{Places} restaurantes{Restaurants} calendario{Calendar} biblioteca{Library} percurso_academico{Academic Path} mapa{Map} faculdade{Faculty} other{Other}}` String nav_title(Object title) { return Intl.select( title, @@ -918,7 +918,7 @@ class S { 'calendario': 'Calendar', 'biblioteca': 'Library', 'percurso_academico': 'Academic Path', - 'transportes': 'Transports', + 'mapa': 'Map', 'faculdade': 'Faculty', 'other': 'Other', }, diff --git a/packages/uni_app/lib/l10n/intl_en.arb b/packages/uni_app/lib/l10n/intl_en.arb index 84932240e..941eae1ad 100644 --- a/packages/uni_app/lib/l10n/intl_en.arb +++ b/packages/uni_app/lib/l10n/intl_en.arb @@ -178,7 +178,7 @@ "@min_value_reference": {}, "multimedia_center": "Multimedia center", "@multimedia_center": {}, - "nav_title": "{title, select, horario{Schedule} exames{Exams} area{Personal Area} cadeiras{Course Units} autocarros{Buses} locais{Places} restaurantes{Restaurants} calendario{Calendar} biblioteca{Library} percurso_academico{Academic Path} transportes{Transports} faculdade{Faculty} other{Other}}", + "nav_title": "{title, select, horario{Schedule} exames{Exams} area{Personal Area} cadeiras{Course Units} autocarros{Buses} locais{Places} restaurantes{Restaurants} calendario{Calendar} biblioteca{Library} percurso_academico{Academic Path} mapa{Map} faculdade{Faculty} other{Other}}", "@nav_title": {}, "news": "News", "@news": {}, diff --git a/packages/uni_app/lib/l10n/intl_pt_PT.arb b/packages/uni_app/lib/l10n/intl_pt_PT.arb index 5a255d1f2..6089670c7 100644 --- a/packages/uni_app/lib/l10n/intl_pt_PT.arb +++ b/packages/uni_app/lib/l10n/intl_pt_PT.arb @@ -186,7 +186,7 @@ "@min_value_reference": {}, "multimedia_center": "Centro de multimédia", "@multimedia_center": {}, - "nav_title": "{title, select, horario{Horário} exames{Exames} area{Área Pessoal} cadeiras{Cadeiras} autocarros{Autocarros} locais{Locais} restaurantes{Restaurantes} calendario{Calendário} biblioteca{Biblioteca} percurso_academico{Percurso Académico} transportes{Transportes} faculdade{Faculdade} other{Outros}}", + "nav_title": "{title, select, horario{Horário} exames{Exames} area{Área Pessoal} cadeiras{Cadeiras} autocarros{Autocarros} locais{Locais} restaurantes{Restaurantes} calendario{Calendário} biblioteca{Biblioteca} percurso_academico{Percurso Académico} mapa{Mapa} faculdade{Faculdade} other{Outros}}", "@nav_title": {}, "news": "Notícias", "@news": {}, diff --git a/packages/uni_app/lib/main.dart b/packages/uni_app/lib/main.dart index cf6228b67..c48c2b6a0 100644 --- a/packages/uni_app/lib/main.dart +++ b/packages/uni_app/lib/main.dart @@ -320,7 +320,7 @@ class ApplicationState extends State { page: const AcademicPathPageView(), settings: settings, ), - '/${NavigationItem.navTransports.route}': + '/${NavigationItem.navMap.route}': PageTransition.makePageTransition( page: const TransportsPageView(), settings: settings, diff --git a/packages/uni_app/lib/utils/navbar_items.dart b/packages/uni_app/lib/utils/navbar_items.dart index aeb77a45e..19478cd8e 100644 --- a/packages/uni_app/lib/utils/navbar_items.dart +++ b/packages/uni_app/lib/utils/navbar_items.dart @@ -1,52 +1,34 @@ import 'package:flutter/material.dart'; -import 'package:uni/generated/l10n.dart'; import 'package:uni/utils/navigation_items.dart'; +import 'package:uni_ui/icons.dart'; enum NavbarItem { navPersonalArea( - Icons.home_outlined, - Icons.home, + UniIcons.home, NavigationItem.navPersonalArea, ), navAcademicPath( - Icons.school_outlined, - Icons.school, + UniIcons.graduationCap, NavigationItem.navAcademicPath, ), navRestaurants( - Icons.free_breakfast_outlined, - Icons.free_breakfast, + UniIcons.restaurant, NavigationItem.navRestaurants, ), - navFaculty(Icons.domain_outlined, Icons.domain, NavigationItem.navFaculty), - navTransports(Icons.map_outlined, Icons.map, NavigationItem.navTransports); + navFaculty( + UniIcons.faculty, + NavigationItem.navFaculty, + ), + navMap( + UniIcons.map, + NavigationItem.navMap, + ); - const NavbarItem(this.unselectedIcon, this.selectedIcon, this.item); + const NavbarItem(this.icon, this.item); - final IconData unselectedIcon; - final IconData selectedIcon; + final IconData icon; final NavigationItem item; - BottomNavigationBarItem toUnselectedBottomNavigationBarItem( - BuildContext context, - ) { - return BottomNavigationBarItem( - icon: Icon(unselectedIcon), - label: '', - tooltip: S.of(context).nav_title(item.route), - ); - } - - BottomNavigationBarItem toSelectedBottomNavigationBarItem( - BuildContext context, - ) { - return BottomNavigationBarItem( - icon: Icon(selectedIcon), - label: '', - tooltip: S.of(context).nav_title(item.route), - ); - } - String get route { return item.route; } diff --git a/packages/uni_app/lib/utils/navigation_items.dart b/packages/uni_app/lib/utils/navigation_items.dart index a31ff7b55..6c6dd720d 100644 --- a/packages/uni_app/lib/utils/navigation_items.dart +++ b/packages/uni_app/lib/utils/navigation_items.dart @@ -12,7 +12,7 @@ enum NavigationItem { navAcademicPath('percurso_academico'), navProfile('perfil'), navSettings('definicoes'), - navTransports('transportes'), + navMap('mapa'), navLogin('login'), navBugreport('bug_report'), navAboutus('sobre_nos'); diff --git a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/general.dart b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/general.dart index e91bffc7b..2532139a9 100644 --- a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/general.dart +++ b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/general.dart @@ -3,27 +3,48 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:logger/logger.dart'; -import 'package:provider/provider.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:uni/generated/l10n.dart'; -import 'package:uni/model/providers/startup/profile_provider.dart'; -import 'package:uni/model/providers/startup/session_provider.dart'; import 'package:uni/view/common_widgets/expanded_image_label.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart'; -import 'package:uni/view/common_widgets/pages_layouts/general/widgets/profile_button.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/widgets/refresh_state.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/widgets/top_navigation_bar.dart'; -/// Page with a hamburger menu and the user profile picture abstract class GeneralPageViewState extends State { bool _loadedOnce = false; bool _loading = true; bool _connected = true; + // Function called when the user pulls down the screen to refresh Future onRefresh(BuildContext context); + // Function called when the page is loaded Future onLoad(BuildContext context) async {} + // Right action button on the top navigation bar + Widget? getTopRightButton(BuildContext context) { + return null; + } + + // Top navigation bar + AppTopNavbar? getTopNavbar(BuildContext context) { + return AppTopNavbar( + title: this.getTitle(), + rightButton: getTopRightButton(context), + ); + } + + // This is the widget that will be displayed above the body and below the top navigation bar + Widget? getHeader(BuildContext context) { + return null; + } + + // The title of the page + String? getTitle(); + + // The content of the page + Widget getBody(BuildContext context); + @override Widget build(BuildContext context) { WidgetsBinding.instance.addPostFrameCallback((_) async { @@ -55,6 +76,7 @@ abstract class GeneralPageViewState extends State { } }); + // TODO:(thePeras): Is this stills a thing? if (!_connected) { return getScaffold( context, @@ -84,46 +106,13 @@ abstract class GeneralPageViewState extends State { ); } - Widget? getHeader(BuildContext context) { - return null; - } - - String? getTitle(); - - Widget getBody(BuildContext context); - - Future buildProfileDecorationImage( - BuildContext context, { - bool forceRetrieval = false, - }) async { - final sessionProvider = - Provider.of(context, listen: false); - await sessionProvider.ensureInitialized(context); - final profilePictureFile = - await ProfileProvider.fetchOrGetCachedProfilePicture( - sessionProvider.state!, - forceRetrieval: forceRetrieval, - ); - return getProfileDecorationImage(profilePictureFile); - } - - /// Returns the current user image. - /// - /// If the image is not found / doesn't exist returns a generic placeholder. - DecorationImage getProfileDecorationImage(File? profilePicture) { - const fallbackPicture = AssetImage('assets/images/profile_placeholder.png'); - final image = - profilePicture == null ? fallbackPicture : FileImage(profilePicture); - - final result = - DecorationImage(fit: BoxFit.cover, image: image as ImageProvider); - return result; - } - Widget getScaffold(BuildContext context, Widget body) { return Scaffold( backgroundColor: Theme.of(context).colorScheme.surface, appBar: getTopNavbar(context), + + // TODO:(thePeras): This should move to floating action button in order to be transparent in background + // See https://stackoverflow.com/questions/72246152/how-to-use-floating-bottom-navigation-bar-in-flutter bottomNavigationBar: const AppBottomNavbar(), body: RefreshState( onRefresh: onRefresh, @@ -132,11 +121,4 @@ abstract class GeneralPageViewState extends State { ), ); } - - AppTopNavbar? getTopNavbar(BuildContext context) { - return AppTopNavbar( - title: this.getTitle(), - rightButton: const ProfileButton(), - ); - } } diff --git a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart index 90e5a5ec0..85790655b 100644 --- a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart +++ b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:uni/utils/navbar_items.dart'; +import 'package:uni_ui/navbar/bottom_navbar.dart'; +import 'package:uni_ui/navbar/bottom_navbar_item.dart'; class AppBottomNavbar extends StatelessWidget { const AppBottomNavbar({super.key}); @@ -23,14 +25,12 @@ class AppBottomNavbar extends StatelessWidget { } void _onItemTapped(BuildContext context, int index) { - final prev = _getCurrentRoute(context); - final item = NavbarItem.values[index]; - final key = item.route; + final newRoute = NavbarItem.values[index].route; - if (prev != key) { + if (_getCurrentRoute(context) != newRoute) { Navigator.pushNamed( context, - '/$key', + '/$newRoute', ); } } @@ -38,38 +38,21 @@ class AppBottomNavbar extends StatelessWidget { @override Widget build(BuildContext context) { final currentIndex = _getCurrentIndex(context); - final navbarItems = []; + final navbarItems = []; for (var index = 0; index < NavbarItem.values.length; index++) { final item = NavbarItem.values[index]; navbarItems.insert( index, - index == currentIndex - ? item.toSelectedBottomNavigationBarItem(context) - : item.toUnselectedBottomNavigationBarItem(context), + BottomNavbarItem( + icon: item.icon, + isSelected: () => currentIndex == index, + onTap: () => _onItemTapped(context, index), + ), ); } - return Theme( - data: Theme.of(context).copyWith( - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - ), - child: BottomNavigationBar( - backgroundColor: Theme.of(context).colorScheme.surface, - items: navbarItems, - onTap: (index) => _onItemTapped(context, index), - currentIndex: currentIndex == -1 ? 0 : currentIndex, - type: BottomNavigationBarType.fixed, - iconSize: 32, - selectedItemColor: currentIndex == -1 - ? Theme.of(context).colorScheme.onSurface - : Theme.of(context).colorScheme.secondary, - unselectedItemColor: Theme.of(context).colorScheme.onSurface, - selectedFontSize: 0, - unselectedFontSize: 0, - showSelectedLabels: false, - showUnselectedLabels: false, - ), + return BottomNavbar( + items: navbarItems, ); } } diff --git a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/drawer_navigation_option.dart b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/drawer_navigation_option.dart deleted file mode 100644 index b7092271d..000000000 --- a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/drawer_navigation_option.dart +++ /dev/null @@ -1,62 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:uni/utils/navigation_items.dart'; - -class DrawerNavigationOption extends StatelessWidget { - const DrawerNavigationOption({required this.item, super.key}); - - final NavigationItem item; - - String getCurrentRoute(BuildContext context) => - ModalRoute.of(context)!.settings.name == null - ? NavigationItem.values.toList()[0].route - : ModalRoute.of(context)!.settings.name!.substring(1); - - void onSelectPage(String key, BuildContext context) { - final prev = getCurrentRoute(context); - - Navigator.of(context).pop(); - - if (prev != key) { - Navigator.pushNamed(context, '/$key'); - } - } - - BoxDecoration? _getSelectionDecoration(String name, BuildContext context) { - return (name == getCurrentRoute(context)) - ? BoxDecoration( - border: Border( - left: BorderSide( - color: Theme.of(context).primaryColor, - width: 3, - ), - ), - color: Theme.of(context).dividerColor, - ) - : null; - } - - @override - Widget build(BuildContext context) { - return DecoratedBox( - decoration: - _getSelectionDecoration(item.route, context) ?? const BoxDecoration(), - child: ListTile( - title: Container( - padding: const EdgeInsets.only(bottom: 3, left: 20), - child: Text( - item.route, - style: TextStyle( - fontSize: 18, - color: Theme.of(context).primaryColor, - fontWeight: FontWeight.normal, - ), - ), - ), - dense: true, - contentPadding: EdgeInsets.zero, - selected: item.route == getCurrentRoute(context), - onTap: () => onSelectPage(item.route, context), - ), - ); - } -} diff --git a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/top_navigation_bar.dart b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/top_navigation_bar.dart index a22633b05..0b066e8bc 100644 --- a/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/top_navigation_bar.dart +++ b/packages/uni_app/lib/view/common_widgets/pages_layouts/general/widgets/top_navigation_bar.dart @@ -1,46 +1,18 @@ import 'package:flutter/material.dart'; -import 'package:uni/view/common_widgets/page_title.dart'; class AppTopNavbar extends StatelessWidget implements PreferredSizeWidget { const AppTopNavbar({ this.title, this.rightButton, this.leftButton, + this.centerTitle = false, super.key, }); - static const double borderMargin = 18; - final String? title; final Widget? rightButton; final Widget? leftButton; - - Widget _createTopWidgets(BuildContext context) { - return Padding( - padding: EdgeInsets.fromLTRB(leftButton == null ? 20 : 12, 0, 20, 0), - child: Row( - children: [ - if (leftButton != null) - Padding( - padding: const EdgeInsets.only(right: 8), - child: leftButton, - ), - Expanded( - child: PageTitle( - name: title ?? '', - pad: false, - center: false, - ), - ), - if (rightButton != null) - Padding( - padding: const EdgeInsets.only(left: 8), - child: rightButton, - ), - ], - ), - ); - } + final bool centerTitle; @override Size get preferredSize => const Size.fromHeight(kToolbarHeight); @@ -49,13 +21,37 @@ class AppTopNavbar extends StatelessWidget implements PreferredSizeWidget { AppBar build(BuildContext context) { return AppBar( automaticallyImplyLeading: false, - elevation: 0, - iconTheme: Theme.of(context).iconTheme, - backgroundColor: Theme.of(context).colorScheme.surface, - shadowColor: Theme.of(context).dividerColor, - surfaceTintColor: Theme.of(context).colorScheme.onSecondary, - titleSpacing: 0, - title: _createTopWidgets(context), + title: Padding( + padding: EdgeInsets.fromLTRB(leftButton == null ? 5 : 0, 0, 5, 0), + child: Row( + children: [ + if (leftButton != null) + Padding( + padding: const EdgeInsets.only(right: 5), + child: leftButton, + ), + Expanded( + child: centerTitle + ? Center( + child: Text( + title ?? '', + style: Theme.of(context).textTheme.headlineLarge, + ), + ) + : Text( + title ?? '', + style: Theme.of(context).textTheme.displaySmall, + ), + ), + if (rightButton == null && centerTitle) const SizedBox(width: 45), + if (rightButton != null) + Padding( + padding: const EdgeInsets.only(left: 5), + child: rightButton, + ), + ], + ), + ), ); } } diff --git a/packages/uni_app/lib/view/common_widgets/pages_layouts/secondary/secondary.dart b/packages/uni_app/lib/view/common_widgets/pages_layouts/secondary/secondary.dart index 8ef0fcd48..22dd8fdd0 100644 --- a/packages/uni_app/lib/view/common_widgets/pages_layouts/secondary/secondary.dart +++ b/packages/uni_app/lib/view/common_widgets/pages_layouts/secondary/secondary.dart @@ -25,16 +25,18 @@ abstract class SecondaryPageViewState @override String? getTitle(); - Widget? getTopRightButton(BuildContext context) { - return null; - } - @override @nonVirtual AppTopNavbar? getTopNavbar(BuildContext context) { return AppTopNavbar( title: getTitle(), - leftButton: const BackButton(), + centerTitle: true, + leftButton: BackButton( + style: ButtonStyle( + iconColor: + WidgetStateProperty.all(Theme.of(context).colorScheme.primary), + ), + ), rightButton: getTopRightButton(context), ); } diff --git a/packages/uni_app/lib/view/transports/transports.dart b/packages/uni_app/lib/view/transports/transports.dart index fa51ab31b..eeb5b26ee 100644 --- a/packages/uni_app/lib/view/transports/transports.dart +++ b/packages/uni_app/lib/view/transports/transports.dart @@ -21,8 +21,7 @@ class TransportsPageViewState extends GeneralPageViewState { ]; @override - String? getTitle() => - S.of(context).nav_title(NavigationItem.navTransports.route); + String? getTitle() => S.of(context).nav_title(NavigationItem.navMap.route); @override Widget getBody(BuildContext context) { diff --git a/packages/uni_app/pubspec.lock b/packages/uni_app/pubspec.lock index ee787c2ac..0bd7483ed 100644 --- a/packages/uni_app/pubspec.lock +++ b/packages/uni_app/pubspec.lock @@ -1047,10 +1047,10 @@ packages: dependency: "direct main" description: name: percent_indicator - sha256: c37099ad833a883c9d71782321cb65c3a848c21b6939b6185f0ff6640d05814c + sha256: "0d77d5c6fa9b7f60202cedf748b568ba9ba38d3f30405d6ceae4da76f5185462" url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.2.4" petitparser: dependency: transitive description: diff --git a/packages/uni_ui/.gitignore b/packages/uni_ui/.gitignore index 43d7987bd..d5b25bf17 100644 --- a/packages/uni_ui/.gitignore +++ b/packages/uni_ui/.gitignore @@ -43,3 +43,4 @@ app.*.map.json /android/app/release /lib/main.dart +pubspec.lock \ No newline at end of file diff --git a/packages/uni_ui/lib/cards/restaurant_card.dart b/packages/uni_ui/lib/cards/restaurant_card.dart index eebf175a6..c828ef1c5 100644 --- a/packages/uni_ui/lib/cards/restaurant_card.dart +++ b/packages/uni_ui/lib/cards/restaurant_card.dart @@ -31,8 +31,7 @@ class RestaurantCard extends StatelessWidget { icon: icon, isFavorite: isFavorite, onFavoriteToggle: onFavoriteToggle), - Column( - children: menuItems), + Column(children: menuItems), ], )); } @@ -66,9 +65,7 @@ class RestaurantCardHeader extends StatelessWidget { ), child: Row( children: [ - Expanded( - flex: 1, - child: icon), + Expanded(flex: 1, child: icon), Expanded( flex: 4, child: Text( @@ -83,12 +80,12 @@ class RestaurantCardHeader extends StatelessWidget { onPressed: onFavoriteToggle, icon: isFavorite ? Icon(PhosphorIconsFill.heart, - color: Theme.of(context).primaryColor) + color: Theme.of(context).primaryColor) : Icon(PhosphorIconsRegular.heart, - color: Theme.of(context).primaryColor)), + color: Theme.of(context).primaryColor)), ), ], ), ); } -} \ No newline at end of file +} diff --git a/packages/uni_ui/lib/cards/widgets/restaurant_menu_item.dart b/packages/uni_ui/lib/cards/widgets/restaurant_menu_item.dart index 94ab43541..9a3458a54 100644 --- a/packages/uni_ui/lib/cards/widgets/restaurant_menu_item.dart +++ b/packages/uni_ui/lib/cards/widgets/restaurant_menu_item.dart @@ -1,10 +1,7 @@ import 'package:flutter/material.dart'; class RestaurantMenuItem extends StatelessWidget { - const RestaurantMenuItem({ - super.key, - required this.name, - required this.icon}); + const RestaurantMenuItem({super.key, required this.name, required this.icon}); final String name; final Icon icon; @@ -16,9 +13,7 @@ class RestaurantMenuItem extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - flex: 1, - child: icon), + Expanded(flex: 1, child: icon), Expanded( flex: 5, child: Text( @@ -31,4 +26,4 @@ class RestaurantMenuItem extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/packages/uni_ui/lib/icons.dart b/packages/uni_ui/lib/icons.dart index 72ee466b8..0b6a89eb8 100644 --- a/packages/uni_ui/lib/icons.dart +++ b/packages/uni_ui/lib/icons.dart @@ -6,6 +6,12 @@ class UniIcons { static const lecture = PhosphorIconsDuotone.lectern; static const exam = PhosphorIconsDuotone.exam; static const course = PhosphorIconsDuotone.certificate; + + static const home = PhosphorIconsDuotone.house; + static const graduationCap = PhosphorIconsDuotone.graduationCap; + static const restaurant = PhosphorIconsDuotone.forkKnife; + static const faculty = PhosphorIconsDuotone.buildings; + static const map = PhosphorIconsDuotone.mapTrifold; } // The same as default Icon class from material.dart but allowing to use PhosphorIcons duotone icons diff --git a/packages/uni_ui/lib/navbar/bottom_navbar_item.dart b/packages/uni_ui/lib/navbar/bottom_navbar_item.dart index e34db91bf..c8ec718c4 100644 --- a/packages/uni_ui/lib/navbar/bottom_navbar_item.dart +++ b/packages/uni_ui/lib/navbar/bottom_navbar_item.dart @@ -1,14 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; - -abstract class NavbarDefaultIcons { - static final home = PhosphorIcons.house(PhosphorIconsStyle.duotone); - static final academic = - PhosphorIcons.graduationCap(PhosphorIconsStyle.duotone); - static final restaurant = PhosphorIcons.forkKnife(PhosphorIconsStyle.duotone); - static final faculty = PhosphorIcons.buildings(PhosphorIconsStyle.duotone); - static final map = PhosphorIcons.mapTrifold(PhosphorIconsStyle.duotone); -} +import 'package:uni_ui/icons.dart'; class BottomNavbarItem { BottomNavbarItem({ @@ -31,7 +22,7 @@ class BottomNavbarItem { borderRadius: BorderRadius.circular(10), ) : null, - child: PhosphorIcon( + child: UniIcon( icon, color: Theme.of(context).colorScheme.secondary, ), diff --git a/packages/uni_ui/pubspec.lock b/packages/uni_ui/pubspec.lock deleted file mode 100644 index 5cf7c207a..000000000 --- a/packages/uni_ui/pubspec.lock +++ /dev/null @@ -1,621 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" - url: "https://pub.dev" - source: hosted - version: "67.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" - url: "https://pub.dev" - source: hosted - version: "6.4.1" - analyzer_plugin: - dependency: transitive - description: - name: analyzer_plugin - sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" - url: "https://pub.dev" - source: hosted - version: "0.11.3" - args: - dependency: transitive - description: - name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://pub.dev" - source: hosted - version: "2.5.0" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" - ci: - dependency: transitive - description: - name: ci - sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" - url: "https://pub.dev" - source: hosted - version: "0.1.0" - cli_util: - dependency: transitive - description: - name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 - url: "https://pub.dev" - source: hosted - version: "0.4.1" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" - source: hosted - version: "1.18.0" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" - url: "https://pub.dev" - source: hosted - version: "1.8.0" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - custom_lint: - dependency: "direct dev" - description: - name: custom_lint - sha256: "7c0aec12df22f9082146c354692056677f1e70bc43471644d1fdb36c6fdda799" - url: "https://pub.dev" - source: hosted - version: "0.6.4" - custom_lint_builder: - dependency: transitive - description: - name: custom_lint_builder - sha256: d7dc41e709dde223806660268678be7993559e523eb3164e2a1425fd6f7615a9 - url: "https://pub.dev" - source: hosted - version: "0.6.4" - custom_lint_core: - dependency: transitive - description: - name: custom_lint_core - sha256: a85e8f78f4c52f6c63cdaf8c872eb573db0231dcdf3c3a5906d493c1f8bc20e6 - url: "https://pub.dev" - source: hosted - version: "0.6.3" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" - url: "https://pub.dev" - source: hosted - version: "2.3.6" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - figma_squircle: - dependency: "direct main" - description: - name: figma_squircle - sha256: "790b91a9505e90d246f6efe2fa065ff7fffe658c7b44fe9b5b20c7b0ad3818c0" - url: "https://pub.dev" - source: hosted - version: "0.5.3" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - freezed_annotation: - dependency: transitive - description: - name: freezed_annotation - sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 - url: "https://pub.dev" - source: hosted - version: "2.4.4" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 - url: "https://pub.dev" - source: hosted - version: "4.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - hotreloader: - dependency: transitive - description: - name: hotreloader - sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e - url: "https://pub.dev" - source: hosted - version: "4.2.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - io: - dependency: transitive - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.dev" - source: hosted - version: "4.9.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" - url: "https://pub.dev" - source: hosted - version: "10.0.5" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" - url: "https://pub.dev" - source: hosted - version: "3.0.5" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - leancode_lint: - dependency: "direct dev" - description: - name: leancode_lint - sha256: "85b7c09c806400083faa37304c701fd1bd5dbcb826882438dd50f0e465f30fd8" - url: "https://pub.dev" - source: hosted - version: "13.0.0" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.dev" - source: hosted - version: "0.12.16+1" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://pub.dev" - source: hosted - version: "0.11.1" - meta: - dependency: transitive - description: - name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 - url: "https://pub.dev" - source: hosted - version: "1.15.0" - mime: - dependency: transitive - description: - name: mime - sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" - url: "https://pub.dev" - source: hosted - version: "1.0.5" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - path: - dependency: transitive - description: - name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.dev" - source: hosted - version: "1.9.0" - phosphor_flutter: - dependency: "direct main" - description: - name: phosphor_flutter - sha256: "8a14f238f28a0b54842c5a4dc20676598dd4811fcba284ed828bd5a262c11fde" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - rxdart: - dependency: transitive - description: - name: rxdart - sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" - url: "https://pub.dev" - source: hosted - version: "0.27.7" - scrollable_positioned_list: - dependency: "direct main" - description: - name: scrollable_positioned_list - sha256: "1b54d5f1329a1e263269abc9e2543d90806131aa14fe7c6062a8054d57249287" - url: "https://pub.dev" - source: hosted - version: "0.3.8" - shelf: - dependency: transitive - description: - name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.dev" - source: hosted - version: "1.4.1" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e - url: "https://pub.dev" - source: hosted - version: "1.1.2" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" - url: "https://pub.dev" - source: hosted - version: "0.10.12" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - sprintf: - dependency: transitive - description: - name: sprintf - sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - stream_transform: - dependency: transitive - description: - name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test: - dependency: "direct dev" - description: - name: test - sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" - url: "https://pub.dev" - source: hosted - version: "1.25.7" - test_api: - dependency: transitive - description: - name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" - url: "https://pub.dev" - source: hosted - version: "0.7.2" - test_core: - dependency: transitive - description: - name: test_core - sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" - url: "https://pub.dev" - source: hosted - version: "0.6.4" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - uuid: - dependency: transitive - description: - name: uuid - sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" - url: "https://pub.dev" - source: hosted - version: "4.4.2" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" - url: "https://pub.dev" - source: hosted - version: "14.2.5" - watcher: - dependency: transitive - description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" - url: "https://pub.dev" - source: hosted - version: "0.5.1" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" - url: "https://pub.dev" - source: hosted - version: "2.4.5" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - yaml: - dependency: transitive - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" -sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0"