Compare commits
No commits in common. "306defc6df2cfe8ef6610b8bf8de91f12b552148" and "7ca45d2f7017e4db21b1e90683598b29db405354" have entirely different histories.
306defc6df
...
7ca45d2f70
|
@ -2,5 +2,5 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:furman_now/src/app.dart';
|
import 'package:furman_now/src/app.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(App());
|
runApp(const App());
|
||||||
}
|
}
|
||||||
|
|
145
lib/src/app.dart
145
lib/src/app.dart
|
@ -1,20 +1,147 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:furman_now/src/routes/index.gr.dart';
|
import 'package:furman_now/src/screens/events/index.dart';
|
||||||
|
import 'package:furman_now/src/screens/home/index.dart';
|
||||||
|
import 'package:furman_now/src/screens/info/index.dart';
|
||||||
|
import 'package:furman_now/src/screens/map/index.dart';
|
||||||
|
import 'package:furman_now/src/screens/student_id/index.dart';
|
||||||
import 'package:furman_now/src/utils/theme.dart';
|
import 'package:furman_now/src/utils/theme.dart';
|
||||||
|
import 'package:navbar_router/navbar_router.dart';
|
||||||
|
|
||||||
class App extends StatelessWidget {
|
class App extends StatelessWidget {
|
||||||
App({super.key});
|
const App({super.key});
|
||||||
|
|
||||||
final _appRouter = AppRouter();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp.router(
|
return MaterialApp(
|
||||||
title: "Furman Now!",
|
title: 'Furman Now!',
|
||||||
debugShowCheckedModeBanner: false,
|
home: const MainPage(),
|
||||||
routeInformationParser: _appRouter.defaultRouteParser(),
|
|
||||||
routerDelegate: _appRouter.delegate(),
|
|
||||||
theme: myFurmanTheme,
|
theme: myFurmanTheme,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MainPage extends StatefulWidget {
|
||||||
|
const MainPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MainPage> createState() => _MainPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MainPageState extends State<MainPage> {
|
||||||
|
List<NavbarItem> items = [
|
||||||
|
NavbarItem(Icons.home_outlined, 'Home', backgroundColor: colors[0]),
|
||||||
|
NavbarItem(Icons.map_outlined, 'Map', backgroundColor: colors[0]),
|
||||||
|
NavbarItem(Icons.person_outline, 'Meal ID', backgroundColor: colors[0]),
|
||||||
|
NavbarItem(Icons.calendar_month_outlined, 'Events', backgroundColor: colors[0]),
|
||||||
|
NavbarItem(Icons.info_outline, 'Info', backgroundColor: colors[0]),
|
||||||
|
];
|
||||||
|
|
||||||
|
final Map<int, Map<String, Widget>> _routes = const {
|
||||||
|
0: {
|
||||||
|
'/': HomeScreen(),
|
||||||
|
// FeedDetail.route: FeedDetail(),
|
||||||
|
},
|
||||||
|
1: {
|
||||||
|
'/': MapScreen(),
|
||||||
|
// ProductDetail.route: ProductDetail(),
|
||||||
|
// ProductComments.route: ProductComments(),
|
||||||
|
},
|
||||||
|
2: {
|
||||||
|
'/': StudentIdScreen(),
|
||||||
|
// ProductDetail.route: ProductDetail(),
|
||||||
|
// ProductComments.route: ProductComments(),
|
||||||
|
},
|
||||||
|
3: {
|
||||||
|
'/': EventsScreen(),
|
||||||
|
// ProfileEdit.route: ProfileEdit(),
|
||||||
|
},
|
||||||
|
4: {
|
||||||
|
'/': InfoScreen(),
|
||||||
|
// ProfileEdit.route: ProfileEdit(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
void showSnackBar() {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
duration: Duration(milliseconds: 600),
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
bottom: kBottomNavigationBarHeight + 2, right: 2, left: 2),
|
||||||
|
content: Text('Tap back button again to exit'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hideSnackBar() {
|
||||||
|
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime oldTime = DateTime.now();
|
||||||
|
DateTime newTime = DateTime.now();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final size = MediaQuery.of(context).size;
|
||||||
|
return Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
|
body: NavbarRouter(
|
||||||
|
errorBuilder: (context) {
|
||||||
|
return const Center(child: Text('Error 404'));
|
||||||
|
},
|
||||||
|
isDesktop: size.width > 600 ? true : false,
|
||||||
|
onBackButtonPressed: (isExitingApp) {
|
||||||
|
if (isExitingApp) {
|
||||||
|
newTime = DateTime.now();
|
||||||
|
int difference = newTime.difference(oldTime).inMilliseconds;
|
||||||
|
oldTime = newTime;
|
||||||
|
if (difference < 1000) {
|
||||||
|
hideSnackBar();
|
||||||
|
return isExitingApp;
|
||||||
|
} else {
|
||||||
|
showSnackBar();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return isExitingApp;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destinationAnimationCurve: Curves.fastOutSlowIn,
|
||||||
|
destinationAnimationDuration: 600,
|
||||||
|
decoration: NavbarDecoration(
|
||||||
|
selectedLabelTextStyle: const TextStyle(color: Colors.deepPurple),
|
||||||
|
showUnselectedLabels: true,
|
||||||
|
unselectedLabelTextStyle:
|
||||||
|
const TextStyle(color: Colors.black, fontSize: 10),
|
||||||
|
selectedIconTheme: const IconThemeData(color: Colors.deepPurple),
|
||||||
|
isExtended: size.width > 800 ? true : false,
|
||||||
|
navbarType: BottomNavigationBarType.fixed),
|
||||||
|
// onChanged: (x) {
|
||||||
|
// debugPrint('index changed $x');
|
||||||
|
// },
|
||||||
|
backButtonBehavior: BackButtonBehavior.rememberHistory,
|
||||||
|
destinations: [
|
||||||
|
for (int i = 0; i < items.length; i++)
|
||||||
|
DestinationRouter(
|
||||||
|
navbarItem: items[i],
|
||||||
|
destinations: [
|
||||||
|
for (int j = 0; j < _routes[i]!.keys.length; j++)
|
||||||
|
Destination(
|
||||||
|
route: _routes[i]!.keys.elementAt(j),
|
||||||
|
widget: _routes[i]!.values.elementAt(j),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
initialRoute: _routes[i]!.keys.first,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> navigate(BuildContext context, String route,
|
||||||
|
{bool isDialog = false,
|
||||||
|
bool isRootNavigator = true,
|
||||||
|
Map<String, dynamic>? arguments}) =>
|
||||||
|
Navigator.of(context, rootNavigator: isRootNavigator)
|
||||||
|
.pushNamed(route, arguments: arguments);
|
||||||
|
|
|
@ -1,67 +1,23 @@
|
||||||
import 'package:auto_route/auto_route.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:furman_now/src/routes/index.gr.dart';
|
|
||||||
|
|
||||||
class MainLayout extends StatefulWidget {
|
class MainLayout extends StatelessWidget {
|
||||||
const MainLayout({
|
const MainLayout({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
this.body,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
final Widget? body;
|
||||||
State<MainLayout> createState() => _MainLayoutState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MainLayoutState extends State<MainLayout> {
|
void _onItemTapped(int index) {
|
||||||
DateTime oldTime = DateTime.now();
|
// Navigate to the second screen using a named route.
|
||||||
DateTime newTime = DateTime.now();
|
// Navigator.pushNamed(context, '/second');
|
||||||
|
|
||||||
void showSnackBar() {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
const SnackBar(
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
duration: Duration(milliseconds: 600),
|
|
||||||
margin: EdgeInsets.only(bottom: 2, right: 2, left: 2),
|
|
||||||
content: Text('Tap back button again to exit'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void hideSnackBar() {
|
|
||||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AutoTabsScaffold(
|
return Scaffold(
|
||||||
routes: const [
|
body: body,
|
||||||
HomeRoute(),
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
MapRoute(),
|
|
||||||
StudentIdRoute(),
|
|
||||||
EventsRoute(),
|
|
||||||
InfoRoute(),
|
|
||||||
],
|
|
||||||
bottomNavigationBuilder: (_, tabsRouter) {
|
|
||||||
return WillPopScope(
|
|
||||||
onWillPop: () async {
|
|
||||||
if (tabsRouter.canNavigateBack) {
|
|
||||||
tabsRouter.navigateBack();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
// if can't navigate back then we're probably trying to exit
|
|
||||||
newTime = DateTime.now();
|
|
||||||
int difference = newTime.difference(oldTime).inMilliseconds;
|
|
||||||
oldTime = newTime;
|
|
||||||
if (difference < 1000) {
|
|
||||||
hideSnackBar();
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
showSnackBar();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: BottomNavigationBar(
|
|
||||||
items: const <BottomNavigationBarItem>[
|
items: const <BottomNavigationBarItem>[
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Icon(Icons.home),
|
icon: Icon(Icons.home),
|
||||||
|
@ -84,13 +40,10 @@ class _MainLayoutState extends State<MainLayout> {
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
currentIndex: tabsRouter.activeIndex,
|
currentIndex: 0,
|
||||||
selectedItemColor: Theme.of(context).primaryColor,
|
selectedItemColor: Colors.grey[700],
|
||||||
unselectedItemColor: Colors.grey[600],
|
onTap: _onItemTapped,
|
||||||
onTap: tabsRouter.setActiveIndex,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,22 +1,15 @@
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:furman_now/src/screens/events/index.dart';
|
|
||||||
import 'package:furman_now/src/screens/home/index.dart';
|
import 'package:furman_now/src/screens/home/index.dart';
|
||||||
import 'package:furman_now/src/screens/info/index.dart';
|
|
||||||
import 'package:furman_now/src/screens/map/index.dart';
|
|
||||||
import 'package:furman_now/src/screens/student_id/index.dart';
|
|
||||||
|
|
||||||
import '../layouts/main/index.dart';
|
Route routes(RouteSettings settings) {
|
||||||
|
switch (settings.name) {
|
||||||
@MaterialAutoRouter(
|
case '/':
|
||||||
replaceInRouteName: 'Screen,Route',
|
return MaterialPageRoute(builder: (_) => const HomeScreen());
|
||||||
routes: <AutoRoute>[
|
// case '/home':
|
||||||
AutoRoute(path: "/", page: MainLayout, children: [
|
// return MaterialPageRoute(builder: (_) => HomeScreen());
|
||||||
AutoRoute(path: "home", page: HomeScreen),
|
// case '/auth':
|
||||||
AutoRoute(path: "map", page: MapScreen),
|
// return MaterialPageRoute(builder: (_) => AuthenticationScreen());
|
||||||
AutoRoute(path: "student-id", page: StudentIdScreen),
|
default:
|
||||||
AutoRoute(path: "events", page: EventsScreen),
|
return MaterialPageRoute(builder: (_) => const HomeScreen());
|
||||||
AutoRoute(path: "info", page: InfoScreen),
|
}
|
||||||
]),
|
}
|
||||||
],
|
|
||||||
)
|
|
||||||
class $AppRouter {}
|
|
||||||
|
|
|
@ -1,118 +0,0 @@
|
||||||
// **************************************************************************
|
|
||||||
// AutoRouteGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// AutoRouteGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
//
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
|
|
||||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
|
||||||
import 'package:auto_route/auto_route.dart' as _i7;
|
|
||||||
import 'package:flutter/material.dart' as _i8;
|
|
||||||
|
|
||||||
import '../layouts/main/index.dart' as _i1;
|
|
||||||
import '../screens/events/index.dart' as _i5;
|
|
||||||
import '../screens/home/index.dart' as _i2;
|
|
||||||
import '../screens/info/index.dart' as _i6;
|
|
||||||
import '../screens/map/index.dart' as _i3;
|
|
||||||
import '../screens/student_id/index.dart' as _i4;
|
|
||||||
|
|
||||||
class AppRouter extends _i7.RootStackRouter {
|
|
||||||
AppRouter([_i8.GlobalKey<_i8.NavigatorState>? navigatorKey])
|
|
||||||
: super(navigatorKey);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final Map<String, _i7.PageFactory> pagesMap = {
|
|
||||||
MainLayout.name: (routeData) {
|
|
||||||
return _i7.MaterialPageX<dynamic>(
|
|
||||||
routeData: routeData, child: const _i1.MainLayout());
|
|
||||||
},
|
|
||||||
HomeRoute.name: (routeData) {
|
|
||||||
return _i7.MaterialPageX<dynamic>(
|
|
||||||
routeData: routeData, child: const _i2.HomeScreen());
|
|
||||||
},
|
|
||||||
MapRoute.name: (routeData) {
|
|
||||||
return _i7.MaterialPageX<dynamic>(
|
|
||||||
routeData: routeData, child: const _i3.MapScreen());
|
|
||||||
},
|
|
||||||
StudentIdRoute.name: (routeData) {
|
|
||||||
return _i7.MaterialPageX<dynamic>(
|
|
||||||
routeData: routeData, child: const _i4.StudentIdScreen());
|
|
||||||
},
|
|
||||||
EventsRoute.name: (routeData) {
|
|
||||||
return _i7.MaterialPageX<dynamic>(
|
|
||||||
routeData: routeData, child: const _i5.EventsScreen());
|
|
||||||
},
|
|
||||||
InfoRoute.name: (routeData) {
|
|
||||||
return _i7.MaterialPageX<dynamic>(
|
|
||||||
routeData: routeData, child: const _i6.InfoScreen());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<_i7.RouteConfig> get routes => [
|
|
||||||
_i7.RouteConfig(MainLayout.name, path: '/', children: [
|
|
||||||
_i7.RouteConfig(HomeRoute.name,
|
|
||||||
path: 'home', parent: MainLayout.name),
|
|
||||||
_i7.RouteConfig(MapRoute.name, path: 'map', parent: MainLayout.name),
|
|
||||||
_i7.RouteConfig(StudentIdRoute.name,
|
|
||||||
path: 'student-id', parent: MainLayout.name),
|
|
||||||
_i7.RouteConfig(EventsRoute.name,
|
|
||||||
path: 'events', parent: MainLayout.name),
|
|
||||||
_i7.RouteConfig(InfoRoute.name, path: 'info', parent: MainLayout.name)
|
|
||||||
])
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [_i1.MainLayout]
|
|
||||||
class MainLayout extends _i7.PageRouteInfo<void> {
|
|
||||||
const MainLayout({List<_i7.PageRouteInfo>? children})
|
|
||||||
: super(MainLayout.name, path: '/', initialChildren: children);
|
|
||||||
|
|
||||||
static const String name = 'MainLayout';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [_i2.HomeScreen]
|
|
||||||
class HomeRoute extends _i7.PageRouteInfo<void> {
|
|
||||||
const HomeRoute() : super(HomeRoute.name, path: 'home');
|
|
||||||
|
|
||||||
static const String name = 'HomeRoute';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [_i3.MapScreen]
|
|
||||||
class MapRoute extends _i7.PageRouteInfo<void> {
|
|
||||||
const MapRoute() : super(MapRoute.name, path: 'map');
|
|
||||||
|
|
||||||
static const String name = 'MapRoute';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [_i4.StudentIdScreen]
|
|
||||||
class StudentIdRoute extends _i7.PageRouteInfo<void> {
|
|
||||||
const StudentIdRoute() : super(StudentIdRoute.name, path: 'student-id');
|
|
||||||
|
|
||||||
static const String name = 'StudentIdRoute';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [_i5.EventsScreen]
|
|
||||||
class EventsRoute extends _i7.PageRouteInfo<void> {
|
|
||||||
const EventsRoute() : super(EventsRoute.name, path: 'events');
|
|
||||||
|
|
||||||
static const String name = 'EventsRoute';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [_i6.InfoScreen]
|
|
||||||
class InfoRoute extends _i7.PageRouteInfo<void> {
|
|
||||||
const InfoRoute() : super(InfoRoute.name, path: 'info');
|
|
||||||
|
|
||||||
static const String name = 'InfoRoute';
|
|
||||||
}
|
|
|
@ -15,6 +15,8 @@ class EventsScreen extends StatelessWidget {
|
||||||
body: Container(
|
body: Container(
|
||||||
color: Colors.grey[100],
|
color: Colors.grey[100],
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: kBottomNavigationBarHeight),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.loose,
|
fit: StackFit.loose,
|
||||||
children: [
|
children: [
|
||||||
|
@ -105,6 +107,7 @@ class EventsScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:furman_now/src/routes/index.gr.dart';
|
|
||||||
import 'package:furman_now/src/utils/greeting.dart';
|
import 'package:furman_now/src/utils/greeting.dart';
|
||||||
import 'package:furman_now/src/utils/theme.dart';
|
import 'package:furman_now/src/utils/theme.dart';
|
||||||
import 'package:furman_now/src/widgets/header.dart';
|
import 'package:furman_now/src/widgets/header.dart';
|
||||||
|
@ -19,6 +18,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.grey[100],
|
color: Colors.grey[100],
|
||||||
|
padding: const EdgeInsets.only(bottom: kBottomNavigationBarHeight),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.loose,
|
fit: StackFit.loose,
|
||||||
children: [
|
children: [
|
||||||
|
@ -68,7 +68,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
const HeaderWidget(
|
const HeaderWidget(
|
||||||
title: "Today's Events",
|
title: "Today's Events",
|
||||||
link: HeaderLink(text: "View more", href: EventsRoute()),
|
link: HeaderLink(text: "View more", href: ""),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
|
|
@ -12,6 +12,8 @@ class InfoScreen extends StatelessWidget {
|
||||||
body: Container(
|
body: Container(
|
||||||
color: Colors.grey[100],
|
color: Colors.grey[100],
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: kBottomNavigationBarHeight),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.loose,
|
fit: StackFit.loose,
|
||||||
children: [
|
children: [
|
||||||
|
@ -81,6 +83,7 @@ class InfoScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,8 @@ class _MapScreenState extends State<MapScreen>
|
||||||
color: const Color(0xffb7acc9),
|
color: const Color(0xffb7acc9),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: kBottomNavigationBarHeight),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
FlutterMap(
|
FlutterMap(
|
||||||
|
@ -221,6 +223,7 @@ class _MapScreenState extends State<MapScreen>
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,12 +35,12 @@ class _EventModalState extends State<_EventModal> {
|
||||||
|
|
||||||
void updateMaxHeight() {
|
void updateMaxHeight() {
|
||||||
if (_parentConstraints != null) {
|
if (_parentConstraints != null) {
|
||||||
|
print(_key.currentContext?.size?.height);
|
||||||
var listHeight = _key.currentContext?.size?.height;
|
var listHeight = _key.currentContext?.size?.height;
|
||||||
var parentHeight = _parentConstraints?.maxHeight;
|
var parentHeight = _parentConstraints?.maxHeight;
|
||||||
if (listHeight != null && parentHeight != null) {
|
if (listHeight != null && parentHeight != null) {
|
||||||
var maxHeight = (listHeight + 50) / parentHeight;
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_maxChildHeight = (maxHeight < 0.75) ? maxHeight : 0.75;
|
_maxChildHeight = (listHeight + 150) / parentHeight;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,8 @@ class _EventModalState extends State<_EventModal> {
|
||||||
builder: (_, controller) {
|
builder: (_, controller) {
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.grey.shade100,
|
color: Colors.grey.shade100,
|
||||||
|
margin: const EdgeInsets.only(
|
||||||
|
bottom: kBottomNavigationBarHeight),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Align(
|
const Align(
|
||||||
|
@ -117,7 +119,7 @@ class _EventModalContent extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
padding: const EdgeInsets.only(left: 40, right: 40, bottom: 40),
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
controller: controller,
|
controller: controller,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
// Title
|
// Title
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:auto_route/auto_route.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:furman_now/src/utils/theme.dart';
|
import 'package:furman_now/src/utils/theme.dart';
|
||||||
|
|
||||||
|
@ -29,9 +28,7 @@ class HeaderWidget extends StatelessWidget {
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
if (link != null)
|
if (link != null)
|
||||||
GestureDetector(
|
Text(
|
||||||
onTap: () => context.router.navigate(link!.href),
|
|
||||||
child: Text(
|
|
||||||
link!.text,
|
link!.text,
|
||||||
style: furmanTextStyle(const TextStyle(
|
style: furmanTextStyle(const TextStyle(
|
||||||
color: Color(0xff755898),
|
color: Color(0xff755898),
|
||||||
|
@ -39,7 +36,6 @@ class HeaderWidget extends StatelessWidget {
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -49,7 +45,7 @@ class HeaderWidget extends StatelessWidget {
|
||||||
@immutable
|
@immutable
|
||||||
class HeaderLink {
|
class HeaderLink {
|
||||||
final String text;
|
final String text;
|
||||||
final PageRouteInfo href;
|
final String href;
|
||||||
|
|
||||||
const HeaderLink({
|
const HeaderLink({
|
||||||
required this.text,
|
required this.text,
|
||||||
|
|
140
pubspec.lock
140
pubspec.lock
|
@ -36,13 +36,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.1"
|
version: "5.0.1"
|
||||||
auto_route_generator:
|
|
||||||
dependency: "direct dev"
|
|
||||||
description:
|
|
||||||
name: auto_route_generator
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "5.0.2"
|
|
||||||
barcode:
|
barcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -64,62 +57,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
build:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.0"
|
|
||||||
build_config:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build_config
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
build_daemon:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build_daemon
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.0"
|
|
||||||
build_resolvers:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build_resolvers
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.9"
|
|
||||||
build_runner:
|
|
||||||
dependency: "direct dev"
|
|
||||||
description:
|
|
||||||
name: build_runner
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.2.0"
|
|
||||||
build_runner_core:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build_runner_core
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "7.2.3"
|
|
||||||
built_collection:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: built_collection
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "5.1.1"
|
|
||||||
built_value:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: built_value
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "8.4.1"
|
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -134,13 +71,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
checked_yaml:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: checked_yaml
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.1"
|
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -148,13 +78,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
code_builder:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: code_builder
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "4.2.0"
|
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -190,13 +113,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
dart_style:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: dart_style
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.2.3"
|
|
||||||
english_words:
|
english_words:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -225,13 +141,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.4"
|
version: "6.1.4"
|
||||||
fixnum:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: fixnum
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -345,13 +254,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.1"
|
||||||
graphs:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: graphs
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.0"
|
|
||||||
http:
|
http:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -394,13 +296,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.4"
|
version: "0.6.4"
|
||||||
json_annotation:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: json_annotation
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "4.6.0"
|
|
||||||
latlong2:
|
latlong2:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -464,6 +359,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.2"
|
||||||
|
navbar_router:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: navbar_router
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.2"
|
||||||
node_preamble:
|
node_preamble:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -618,13 +520,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.1"
|
||||||
pubspec_parse:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: pubspec_parse
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.1"
|
|
||||||
qr:
|
qr:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -672,13 +567,6 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.99"
|
version: "0.0.99"
|
||||||
source_gen:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: source_gen
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.2"
|
|
||||||
source_map_stack_trace:
|
source_map_stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -714,13 +602,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
stream_transform:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: stream_transform
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.0"
|
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -756,13 +637,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.13"
|
version: "0.4.13"
|
||||||
timing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: timing
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
tuple:
|
tuple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -30,10 +30,12 @@ dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
english_words: ^4.0.0
|
english_words: ^4.0.0
|
||||||
|
navbar_router: ^0.3.2
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
google_fonts: ^3.0.1
|
google_fonts: ^3.0.1
|
||||||
http: ^0.13.5
|
http: ^0.13.5
|
||||||
|
@ -58,8 +60,6 @@ dev_dependencies:
|
||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^2.0.0
|
flutter_lints: ^2.0.0
|
||||||
auto_route_generator: ^5.0.1
|
|
||||||
build_runner: ^2.2.0
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
Loading…
Reference in New Issue