Improvements
This commit is contained in:
@@ -27,15 +27,19 @@ class Links extends ConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String dateString(DateTime date) {
|
String dateString(DateTime date) {
|
||||||
|
String addZeros(int value) {
|
||||||
|
return value.toString().padLeft(2, '0');
|
||||||
|
}
|
||||||
|
|
||||||
final today = DateTime.now();
|
final today = DateTime.now();
|
||||||
final yesterday = DateTime.now().subtract(const Duration(days: 1));
|
final yesterday = DateTime.now().subtract(const Duration(days: 1));
|
||||||
|
|
||||||
if (date.day == today.day && date.month == today.month && date.year == today.year) {
|
if (date.day == today.day && date.month == today.month && date.year == today.year) {
|
||||||
return t.links.dates.todayAt(time: "${date.hour}:${date.minute}");
|
return t.links.dates.todayAt(time: "${addZeros(date.hour)}:${addZeros(date.minute)}");
|
||||||
} else if (date.day == yesterday.day && date.month == yesterday.month && date.year == yesterday.year) {
|
} else if (date.day == yesterday.day && date.month == yesterday.month && date.year == yesterday.year) {
|
||||||
return t.links.dates.yesterdayAt(time: "${date.hour}:${date.minute}");
|
return t.links.dates.yesterdayAt(time: "${addZeros(date.hour)}:${addZeros(date.minute)}");
|
||||||
} else {
|
} else {
|
||||||
return "${date.day}/${date.month}/${date.year} - ${date.hour}:${date.minute}";
|
return "${date.day}/${date.month}/${date.year} - ${addZeros(date.hour)}:${addZeros(date.minute)}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +115,7 @@ class Links extends ConsumerWidget {
|
|||||||
validateStrings(link?.title, link?.websiteTitle),
|
validateStrings(link?.title, link?.websiteTitle),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
@@ -119,11 +124,13 @@ class Links extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
validateStrings(link?.description, link?.websiteDescription),
|
validateStrings(link?.description, link?.websiteDescription),
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
@@ -143,6 +150,7 @@ class Links extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (link?.dateModified != null) ...[
|
if (link?.dateModified != null) ...[
|
||||||
|
if (link?.tagNames?.isNotEmpty == true)
|
||||||
Container(
|
Container(
|
||||||
width: 1,
|
width: 1,
|
||||||
height: 12,
|
height: 12,
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class WebView extends ConsumerWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
title: Column(
|
title: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
bookmark.title != "" ? bookmark.title! : bookmark.websiteTitle!,
|
bookmark.title != "" ? bookmark.title! : bookmark.websiteTitle!,
|
||||||
@@ -69,9 +70,6 @@ class WebView extends ConsumerWidget {
|
|||||||
ref.read(webViewProvider.notifier).setLoadProgress(progress);
|
ref.read(webViewProvider.notifier).setLoadProgress(progress);
|
||||||
},
|
},
|
||||||
initialSettings: InAppWebViewSettings(
|
initialSettings: InAppWebViewSettings(
|
||||||
allowContentAccess: false,
|
|
||||||
allowFileAccess: false,
|
|
||||||
applePayAPIEnabled: false,
|
|
||||||
cacheEnabled: false,
|
cacheEnabled: false,
|
||||||
isInspectable: false,
|
isInspectable: false,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user