Add subtitle for account creation date, tweaks

This commit is contained in:
tommyxchow 2022-01-07 22:25:55 -05:00
parent 2ca1221fb1
commit be9819aef9
2 changed files with 29 additions and 23 deletions

View file

@ -26,7 +26,7 @@ class AccountSettings extends StatelessWidget {
padding: EdgeInsets.all(10.0),
),
ProfileCard(authStore: authStore),
if (authStore.isLoggedIn)
if (authStore.isLoggedIn) ...[
ListTile(
title: const Text('Blocked Users'),
trailing: Icon(Icons.adaptive.arrow_forward),
@ -39,28 +39,29 @@ class AccountSettings extends StatelessWidget {
),
),
),
ListTile(
isThreeLine: true,
title: const Text('Log in to WebView'),
subtitle: const Text('Lets you avoid ads on your subscribed streamers or if you have Turbo.'),
trailing: Icon(Icons.adaptive.arrow_forward),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) {
return Scaffold(
appBar: AppBar(
title: const Text('Log In to WebView'),
),
body: const WebView(
initialUrl: 'https://www.twitch.tv/login',
javascriptMode: JavascriptMode.unrestricted,
),
);
},
ListTile(
isThreeLine: true,
title: const Text('Log in to WebView'),
subtitle: const Text('Lets you avoid ads on your subscribed streamers or if you have Turbo.'),
trailing: Icon(Icons.adaptive.arrow_forward),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) {
return Scaffold(
appBar: AppBar(
title: const Text('Log In to WebView'),
),
body: const WebView(
initialUrl: 'https://www.twitch.tv/login',
javascriptMode: JavascriptMode.unrestricted,
),
);
},
),
),
),
),
],
],
);
}

View file

@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:frosty/core/auth/auth_store.dart';
import 'package:intl/intl.dart';
class ProfileCard extends StatelessWidget {
final AuthStore authStore;
@ -44,6 +45,7 @@ class ProfileCard extends StatelessWidget {
foregroundImage: CachedNetworkImageProvider(authStore.user.details!.profileImageUrl),
),
title: Text(authStore.user.details!.displayName),
subtitle: Text('Joined on ${DateFormat.yMMMd().format(DateTime.parse(authStore.user.details!.createdAt))}'),
trailing: OutlinedButton(
onPressed: () => _showDialog(context),
child: const Text('Log Out'),
@ -53,9 +55,12 @@ class ProfileCard extends StatelessWidget {
}
return ListTile(
isThreeLine: true,
leading: const Icon(Icons.account_circle_outlined),
leading: const Icon(
Icons.account_circle_outlined,
size: 40,
),
title: const Text('Anonymous User'),
subtitle: const Text('Log in with your Twitch account to view your followed streams, send chat messages, and more.'),
subtitle: const Text('Log in with to view your followed streams, send chat messages, and more.'),
trailing: OutlinedButton(
onPressed: authStore.login,
child: const Text('Log In'),