diff --git a/frontend/lib/constants.dart b/frontend/lib/constants.dart index 973aec9..a063cdd 100644 --- a/frontend/lib/constants.dart +++ b/frontend/lib/constants.dart @@ -1,5 +1,6 @@ const String APP_NAME = 'AnyWay'; -String API_URL_BASE = 'https://anyway.kluster.moll.re'; +String API_URL_BASE = 'https://anyway.anydev.info'; +String PRIVACY_URL = 'https://anydev.info/privacy'; const String MAP_ID = '41c21ac9b81dbfd8'; diff --git a/frontend/lib/layout.dart b/frontend/lib/layout.dart index bfadd9b..b8f3f38 100644 --- a/frontend/lib/layout.dart +++ b/frontend/lib/layout.dart @@ -1,6 +1,3 @@ -import 'dart:collection'; - -import 'package:anyway/structs/landmark.dart'; import 'package:flutter/material.dart'; import 'package:anyway/constants.dart'; @@ -53,7 +50,21 @@ class _BasePageState extends State { if (availableTrips.isNotEmpty) { return TripPage(trip: availableTrips[0]); } else { - return Text("Wow, so empty!"); + return Scaffold( + body: Center( + child: Text("Wow, so empty!"), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const NewTripPage() + ) + ); + }, + label: Text("Plan a trip now"), + ), + ); } } else { return const Text("loading..."); diff --git a/frontend/lib/pages/profile.dart b/frontend/lib/pages/profile.dart index f9d3ca7..5ee1687 100644 --- a/frontend/lib/pages/profile.dart +++ b/frontend/lib/pages/profile.dart @@ -13,6 +13,40 @@ class ProfilePage extends StatefulWidget { class _ProfilePageState extends State { Future _prefs = loadUserPreferences(); + @override + Widget build(BuildContext context) { + return ListView( + children: [ + // First a round, centered image + Center( + child: CircleAvatar( + radius: 100, + child: Icon(Icons.person, size: 100), + ) + ), + Center( + child: Text('Curious traveler', style: TextStyle(fontSize: 24)) + ), + + Divider(indent: 25, endIndent: 25, height: 50), + + Center( + child: Padding( + padding: EdgeInsets.only(left: 10, right: 10, top: 0, bottom: 10), + child: Text('For a tailored experience, please rate your discovery preferences.', style: TextStyle(fontSize: 18)) + ), + ), + + FutureBuilder(future: _prefs, builder: futureSliders), + + Divider(indent: 25, endIndent: 25, height: 50), + + privacyInfo(), + + debugButton(), + ] + ); + } Widget debugButton() { return Padding( @@ -60,37 +94,6 @@ class _ProfilePageState extends State { } - - @override - Widget build(BuildContext context) { - return ListView( - children: [ - // First a round, centered image - Center( - child: CircleAvatar( - radius: 100, - child: Icon(Icons.person, size: 100), - ) - ), - Center( - child: Text('Curious traveler', style: TextStyle(fontSize: 24)) - ), - - Divider(indent: 25, endIndent: 25, height: 50), - - Center( - child: Padding( - padding: EdgeInsets.only(left: 10, right: 10, top: 0, bottom: 10), - child: Text('For a tailored experience, please rate your discovery preferences.', style: TextStyle(fontSize: 18)) - ), - ), - - FutureBuilder(future: _prefs, builder: futureSliders), - debugButton() - ] - ); - } - Widget futureSliders(BuildContext context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { UserPreferences prefs = snapshot.data!; @@ -106,6 +109,23 @@ class _ProfilePageState extends State { return CircularProgressIndicator(); } } + + Widget privacyInfo() { + return Padding( + padding: EdgeInsets.only(top: 20), + child: Row( + children: [ + Text('Privacy policy is available at '), + TextButton.icon( + icon: Icon(Icons.info), + label: Text(PRIVACY_URL), + onPressed: () { + } + ) + ], + ) + ); + } }