cleanup of application to satisfy google requirements

This commit is contained in:
Remy Moll 2024-09-18 15:06:13 +02:00
parent 7617c5788c
commit d4066a1726
3 changed files with 68 additions and 36 deletions

@ -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';

@ -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<BasePage> {
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...");

@ -13,6 +13,40 @@ class ProfilePage extends StatefulWidget {
class _ProfilePageState extends State<ProfilePage> {
Future<UserPreferences> _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<ProfilePage> {
}
@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<UserPreferences> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
UserPreferences prefs = snapshot.data!;
@ -106,6 +109,23 @@ class _ProfilePageState extends State<ProfilePage> {
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: () {
}
)
],
)
);
}
}