Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Map Page #1440

Draft
wants to merge 7 commits into
base: ui/page-layouts
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed packages/uni_app/assets/fonts/LocationIcons.ttf
Binary file not shown.
12 changes: 3 additions & 9 deletions packages/uni_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ import 'package:uni/view/faculty/faculty.dart';
import 'package:uni/view/home/home.dart';
import 'package:uni/view/library/library.dart';
import 'package:uni/view/locale_notifier.dart';
import 'package:uni/view/locations/locations.dart';
import 'package:uni/view/login/login.dart';
import 'package:uni/view/map/map.dart';
import 'package:uni/view/profile/profile.dart';
import 'package:uni/view/restaurant/restaurant_page_view.dart';
import 'package:uni/view/schedule/schedule.dart';
import 'package:uni/view/settings/settings.dart';
import 'package:uni/view/splash/splash.dart';
import 'package:uni/view/theme.dart';
import 'package:uni/view/theme_notifier.dart';
import 'package:uni/view/transports/transports.dart';
import 'package:uni_ui/theme.dart';
import 'package:upgrader/upgrader.dart';
import 'package:workmanager/workmanager.dart';
Expand Down Expand Up @@ -288,9 +287,9 @@ class ApplicationState extends State<Application> {
page: const CourseUnitsPageView(),
settings: settings,
),
'/${NavigationItem.navLocations.route}':
'/${NavigationItem.navMap.route}':
PageTransition.makePageTransition(
page: const LocationsPage(),
page: const MapPage(),
settings: settings,
),
'/${NavigationItem.navRestaurants.route}':
Expand Down Expand Up @@ -318,11 +317,6 @@ class ApplicationState extends State<Application> {
page: const AcademicPathPageView(),
settings: settings,
),
'/${NavigationItem.navMap.route}':
PageTransition.makePageTransition(
page: const TransportsPageView(),
settings: settings,
),
'/${NavigationItem.navProfile.route}':
MaterialPageRoute<ProfilePageView>(
builder: (__) => const ProfilePageView(),
Expand Down
4 changes: 2 additions & 2 deletions packages/uni_app/lib/model/entities/locations/atm.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:uni/model/entities/location.dart';
import 'package:uni/view/locations/widgets/icons.dart';
import 'package:uni_ui/icons.dart';

class Atm implements Location {
Atm(this.floor, {this.locationGroupId}) : super();
Expand All @@ -10,7 +10,7 @@ class Atm implements Location {
final weight = 2;

@override
final icon = LocationIcons.cashMultiple;
final icon = UniIcons.money;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:uni/model/entities/location.dart';
import 'package:uni/view/locations/widgets/icons.dart';
import 'package:uni_ui/icons.dart';

class CoffeeMachine implements Location {
CoffeeMachine(this.floor, {this.locationGroupId});
Expand All @@ -10,7 +10,7 @@ class CoffeeMachine implements Location {
final weight = 3;

@override
final icon = LocationIcons.coffee;
final icon = UniIcons.coffee;

final int? locationGroupId;

Expand Down
4 changes: 2 additions & 2 deletions packages/uni_app/lib/model/entities/locations/printer.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:uni/model/entities/location.dart';
import 'package:uni/view/locations/widgets/icons.dart';
import 'package:uni_ui/icons.dart';

class Printer implements Location {
Printer(this.floor, {this.locationGroupId});
Expand All @@ -10,7 +10,7 @@ class Printer implements Location {
final weight = 1;

@override
final icon = LocationIcons.printer;
final icon = UniIcons.printer;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:uni/model/entities/location.dart';
import 'package:uni_ui/icons.dart';

class RestaurantLocation implements Location {
RestaurantLocation(this.floor, this.name, {this.locationGroupId});
Expand All @@ -12,7 +12,7 @@ class RestaurantLocation implements Location {
final String name;

@override
final icon = Icons.restaurant;
final icon = UniIcons.restaurant;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:uni/model/entities/location.dart';
import 'package:uni/view/locations/widgets/icons.dart';
import 'package:uni_ui/icons.dart';

class RoomGroupLocation implements Location {
RoomGroupLocation(
Expand All @@ -17,7 +17,7 @@ class RoomGroupLocation implements Location {
final String firstRoomNumber;
final String secondRoomNumber;
@override
final icon = LocationIcons.bookOpenBlankVariant;
final icon = UniIcons.bookOpenUser;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:uni/model/entities/location.dart';
import 'package:uni/view/locations/widgets/icons.dart';
import 'package:uni_ui/icons.dart';

class RoomLocation implements Location {
RoomLocation(this.floor, this.roomNumber, {this.locationGroupId});
Expand All @@ -11,7 +11,7 @@ class RoomLocation implements Location {

final String roomNumber;
@override
final icon = LocationIcons.bookOpenBlankVariant;
final icon = UniIcons.bookOpen;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:uni/model/entities/location.dart';
import 'package:uni_ui/icons.dart';

class SpecialRoomLocation implements Location {
SpecialRoomLocation(
Expand All @@ -17,7 +18,7 @@ class SpecialRoomLocation implements Location {
final String roomNumber;
final String name;
@override
final icon = Icons.star;
final icon = UniIcons.starFour;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:uni/model/entities/location.dart';
import 'package:uni_ui/icons.dart';

class StoreLocation implements Location {
StoreLocation(this.floor, this.name, {this.locationGroupId});
Expand All @@ -11,7 +11,7 @@ class StoreLocation implements Location {

final String name;
@override
final icon = Icons.store;
final icon = UniIcons.storefront;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:uni/model/entities/location.dart';
import 'package:uni_ui/icons.dart';

class UnknownLocation implements Location {
UnknownLocation(this.floor, this.type, {this.locationGroupId});
Expand All @@ -10,7 +10,7 @@ class UnknownLocation implements Location {
final weight = 4;

@override
final icon = Icons.store;
final icon = UniIcons.questionMark;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:uni/model/entities/location.dart';
import 'package:uni/view/locations/widgets/icons.dart';
import 'package:uni_ui/icons.dart';

class VendingMachine implements Location {
VendingMachine(this.floor, {this.locationGroupId});
Expand All @@ -10,7 +10,7 @@ class VendingMachine implements Location {
final weight = 2;

@override
final icon = LocationIcons.bottleSodaClassic;
final icon = UniIcons.lockers;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:uni/model/entities/location.dart';
import 'package:uni_ui/icons.dart';

class WcLocation implements Location {
WcLocation(this.floor, {this.locationGroupId});
Expand All @@ -10,7 +10,7 @@ class WcLocation implements Location {
final weight = 1;

@override
final icon = Icons.wc;
final icon = UniIcons.toilet;

final int? locationGroupId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,20 @@ abstract class GeneralPageViewState<T extends StatefulWidget> extends State<T> {
context,
_loading
? const Center(child: CircularProgressIndicator())
// TODO: Add 100 of padding bottom
: getBody(context),
);
}

Widget getScaffold(BuildContext context, Widget body) {
return Scaffold(
resizeToAvoidBottomInset: false,
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(),
extendBody: true,
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: const AppBottomNavbar(),
floatingActionButtonAnimator: FloatingActionButtonAnimator.noAnimation,
body: RefreshState(
onRefresh: onRefresh,
header: getHeader(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ class AppTopNavbar extends StatelessWidget implements PreferredSizeWidget {
this.rightButton,
this.leftButton,
this.centerTitle = false,
this.heightSize = const Size.fromHeight(kToolbarHeight),
super.key,
});

final String? title;
final Widget? rightButton;
final Widget? leftButton;
final bool centerTitle;
final Size heightSize;

@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
Size get preferredSize => heightSize;

@override
AppBar build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ abstract class SecondaryPageViewState<T extends StatefulWidget>
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
appBar: getTopNavbar(context),
bottomNavigationBar: const AppBottomNavbar(),
extendBody: true,
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: const AppBottomNavbar(),
floatingActionButtonAnimator: FloatingActionButtonAnimator.noAnimation,
body: RefreshState(
onRefresh: onRefresh,
header: getHeader(context),
Expand Down
115 changes: 0 additions & 115 deletions packages/uni_app/lib/view/locations/locations.dart

This file was deleted.

Loading