cleanup of application to satisfy google requirements

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

View File

@@ -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: () {
}
)
],
)
);
}
}