Some UI changes

This commit is contained in:
Juan Gilsanz Polo 2022-10-21 12:33:22 +02:00
parent 26d89730ef
commit 4beaa862e9
15 changed files with 244 additions and 141 deletions

View file

@ -130,13 +130,13 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
filterStatusListItem(
id: "processed",
icon: Icons.verified_user_rounded,
label: AppLocalizations.of(context)!.processed,
label: AppLocalizations.of(context)!.processedRow,
onChanged: (value) => setState(() => selectedResultStatus = value!)
),
filterStatusListItem(
id: "whitelisted",
icon: Icons.verified_user_rounded,
label: AppLocalizations.of(context)!.processedWhitelist,
label: AppLocalizations.of(context)!.processedWhitelistRow,
onChanged: (value) => setState(() => selectedResultStatus = value!)
),
filterStatusListItem(
@ -148,19 +148,19 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
filterStatusListItem(
id: "blocked_safebrowsing",
icon: Icons.gpp_bad_rounded,
label: AppLocalizations.of(context)!.blockedSafeBrowsing,
label: AppLocalizations.of(context)!.blockedSafeBrowsingRow,
onChanged: (value) => setState(() => selectedResultStatus = value!)
),
filterStatusListItem(
id: "blocked_parental",
icon: Icons.gpp_bad_rounded,
label: AppLocalizations.of(context)!.blockedParental,
label: AppLocalizations.of(context)!.blockedParentalRow,
onChanged: (value) => setState(() => selectedResultStatus = value!)
),
filterStatusListItem(
id: "safe_search",
icon: Icons.gpp_bad_rounded,
label: AppLocalizations.of(context)!.blockedSafeSearch,
label: AppLocalizations.of(context)!.blockedSafeSearchRow,
onChanged: (value) => setState(() => selectedResultStatus = value!)
),

View file

@ -22,7 +22,7 @@ class LogDetailsModal extends StatelessWidget {
@override
Widget build(BuildContext context) {
Widget getResult() {
final filter = getFilteredStatus(context, log.reason);
final filter = getFilteredStatus(context, log.reason, true);
return Text(
filter['label'],
style: TextStyle(
@ -189,11 +189,11 @@ class LogDetailsModal extends StatelessWidget {
children: [
TextButton(
onPressed: () {
blockUnblock(log, getFilteredStatus(context, log.reason)['filtered'] == true ? 'unblock' : 'block');
blockUnblock(log, getFilteredStatus(context, log.reason, true)['filtered'] == true ? 'unblock' : 'block');
Navigator.pop(context);
},
child: Text(
getFilteredStatus(context, log.reason)['filtered'] == true
getFilteredStatus(context, log.reason, true)['filtered'] == true
? AppLocalizations.of(context)!.unblockDomain
: AppLocalizations.of(context)!.blockDomain
)

View file

@ -21,7 +21,7 @@ class LogListTile extends StatelessWidget {
final width = MediaQuery.of(context).size.width;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -38,8 +38,7 @@ class LogListTile extends StatelessWidget {
Text(
title,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500
fontSize: 18,
),
),
const SizedBox(height: 5),
@ -47,7 +46,6 @@ class LogListTile extends StatelessWidget {
width: width-100,
child: Text(
subtitle!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).listTileTheme.iconColor,

View file

@ -40,28 +40,30 @@ class LogTile extends StatelessWidget {
required Color color,
required String text
}) {
return Row(
children: [
Icon(
icon,
color: color,
size: 14,
),
const SizedBox(width: 10),
Text(
text,
style: TextStyle(
return Flexible(
child: Column(
children: [
Icon(
icon,
color: color,
fontWeight: FontWeight.bold,
fontSize: 12
),
)
]
size: 14,
),
const SizedBox(height: 5),
Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
color: color,
fontSize: 12
),
)
]
),
);
}
Widget generateLogStatus() {
final filter = getFilteredStatus(context, log.reason);
final filter = getFilteredStatus(context, log.reason, false);
return logStatusWidget(
icon: filter['icon'],
color: filter['color'],
@ -148,7 +150,7 @@ class LogTile extends StatelessWidget {
onTap: openLogDetailsModal,
child: Container(
width: double.maxFinite,
padding: const EdgeInsets.all(10),
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 15),
decoration: BoxDecoration(
border: index < length
? Border(
@ -161,39 +163,110 @@ class LogTile extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
generateLogStatus(),
const SizedBox(height: 10),
SizedBox(
width: width-100,
child: Text(
SizedBox(
width: width-130,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
log.question.name,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16
fontSize: 18
),
),
),
const SizedBox(height: 10),
SizedBox(
width: width-100,
child: Text(
log.client,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
fontSize: 13
),
const SizedBox(height: 10),
if (log.client.length <= 15) Row(
children: [
...[
Icon(
Icons.smartphone_rounded,
size: 16,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 5),
SizedBox(
child: Text(
log.client,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
fontSize: 13
),
),
)
],
const SizedBox(width: 15),
...[
Icon(
Icons.schedule_rounded,
size: 16,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 5),
SizedBox(
child: Text(
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss'),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
fontSize: 13
),
),
)
],
],
),
)
],
),
Text(
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss')
if (log.client.length > 15) Column(
children: [
Row(
children: [
Icon(
Icons.smartphone_rounded,
size: 16,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 15),
SizedBox(
child: Text(
log.client,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
fontSize: 13
),
),
)
],
),
const SizedBox(height: 10),
Row(
children: [
Icon(
Icons.schedule_rounded,
size: 16,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 15),
SizedBox(
child: Text(
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss'),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
fontSize: 13
),
),
)
],
),
],
),
],
),
),
const SizedBox(width: 10),
generateLogStatus()
],
),
),

View file

@ -57,12 +57,12 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
final Map<String, String> translatedString = {
"all": AppLocalizations.of(context)!.all,
"filtered": AppLocalizations.of(context)!.filtered,
"processed": AppLocalizations.of(context)!.processed,
"whitelisted": AppLocalizations.of(context)!.processedWhitelist,
"processed": AppLocalizations.of(context)!.processedRow,
"whitelisted": AppLocalizations.of(context)!.processedWhitelistRow,
"blocked": AppLocalizations.of(context)!.blocked,
"blocked_safebrowsing": AppLocalizations.of(context)!.blockedSafeBrowsing,
"blocked_parental": AppLocalizations.of(context)!.blockedParental,
"safe_search": AppLocalizations.of(context)!.safeSearch,
"blocked_safebrowsing": AppLocalizations.of(context)!.blockedSafeBrowsingRow,
"blocked_parental": AppLocalizations.of(context)!.blockedParentalRow,
"safe_search": AppLocalizations.of(context)!.blockedSafeSearchRow,
};
void selectTime() async {