Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Cursor Style and Other Fixes #434

Merged
merged 1 commit into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions lib/utils/showmodal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ void showSnackbar(BuildContext context, String title, String message) {
),
],
),
action: SnackBarAction(
label: 'Dissmiss',
textColor: theme(context).colorMessageForeground,
onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
},
),
),
);
}
67 changes: 35 additions & 32 deletions lib/widgets/home/overview/overview_metrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,44 @@ class OverviewMetrics extends StatelessWidget {
IconData icon, [
void Function()? onTap,
]) {
return InkWell(
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(
Constants.spacingMiddle,
),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: theme(context).colorShadow,
blurRadius: Constants.sizeBorderBlurRadius,
spreadRadius: Constants.sizeBorderSpreadRadius,
offset: const Offset(0.0, 0.0),
),
],
color: theme(context).colorCard,
borderRadius: const BorderRadius.all(
Radius.circular(Constants.sizeBorderRadius),
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(
Constants.spacingMiddle,
),
),
child: Column(
children: [
Icon(
icon,
color: theme(context).colorPrimary,
size: 64,
),
const SizedBox(height: Constants.spacingSmall),
Text(
title,
style: primaryTextStyle(
context,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: theme(context).colorShadow,
blurRadius: Constants.sizeBorderBlurRadius,
spreadRadius: Constants.sizeBorderSpreadRadius,
offset: const Offset(0.0, 0.0),
),
],
color: theme(context).colorCard,
borderRadius: const BorderRadius.all(
Radius.circular(Constants.sizeBorderRadius),
),
],
),
child: Column(
children: [
Icon(
icon,
color: theme(context).colorPrimary,
size: 64,
),
const SizedBox(height: Constants.spacingSmall),
Text(
title,
style: primaryTextStyle(
context,
),
),
],
),
),
),
);
Expand Down
10 changes: 2 additions & 8 deletions lib/widgets/resources/details/details_get_logs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ class _DetailsGetLogsState extends State<DetailsGetLogs> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down Expand Up @@ -262,10 +259,7 @@ class _DetailsGetLogsState extends State<DetailsGetLogs> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down
63 changes: 34 additions & 29 deletions lib/widgets/resources/details/details_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,44 +58,49 @@ class DetailsItemWidget extends StatelessWidget {
child: Wrap(
children: List.generate(
values.length,
(index) => InkWell(
onTap: () {
if (onTap != null) {
onTap(index);
} else {
showSnackbar(context, name, values[index]);
}
},
child: Container(
margin: const EdgeInsets.all(Constants.spacingExtraSmall),
child: Chip(
label: Text(values[index]),
),
(index) => Container(
margin: const EdgeInsets.all(Constants.spacingExtraSmall),
child: ActionChip(
onPressed: () {
if (onTap != null) {
onTap(index);
} else {
showSnackbar(context, name, values[index]);
}
},
label: Text(values[index]),
),
),
),
),
);
}

return Flexible(
child: InkWell(
onTap: () {
if (onTap != null) {
onTap(-1);
}
},
child: Text(
values.toString(),
softWrap: true,
style: onTap != null
? TextStyle(
if (onTap != null) {
return Flexible(
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
onTap(-1);
},
child: Text(values.toString(),
softWrap: true,
style: TextStyle(
color: theme(context).colorTextPrimary,
decoration: TextDecoration.underline,
)
: TextStyle(
color: theme(context).colorTextPrimary,
),
)),
),
),
);
}

return Flexible(
child: Text(
values.toString(),
softWrap: true,
style: TextStyle(
color: theme(context).colorTextPrimary,
),
),
);
Expand Down
74 changes: 39 additions & 35 deletions lib/widgets/resources/details/details_item_conditions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,44 +80,48 @@ class DetailsItemConditions extends StatelessWidget {
Radius.circular(Constants.sizeBorderRadius),
),
),
child: InkWell(
onTap: () {
final age = item['status']['conditions'][index]
['lastTransitionTime'] !=
null
? getAge(DateTime.parse(item['status']
['conditions'][index]
['lastTransitionTime']))
: '-';
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
final age = item['status']['conditions'][index]
['lastTransitionTime'] !=
null
? getAge(DateTime.parse(item['status']
['conditions'][index]
['lastTransitionTime']))
: '-';

showSnackbar(
context,
item['status']['conditions'][index]['type'],
'Status: ${item['status']['conditions'][index]['status']}\nAge: $age\nReason: ${item['status']['conditions'][index]['reason'] ?? '-'}\nMessage: ${item['status']['conditions'][index]['message'] ?? '-'}',
);
},
child: Row(
children: [
Icon(
item['status']['conditions'][index]['status'] ==
'True'
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24,
color: theme(context).colorPrimary,
),
const SizedBox(width: Constants.spacingSmall),
Expanded(
flex: 1,
child: Text(
item['status']['conditions'][index]['type'],
style: noramlTextStyle(
context,
showSnackbar(
context,
item['status']['conditions'][index]['type'],
'Status: ${item['status']['conditions'][index]['status']}\nAge: $age\nReason: ${item['status']['conditions'][index]['reason'] ?? '-'}\nMessage: ${item['status']['conditions'][index]['message'] ?? '-'}',
);
},
child: Row(
children: [
Icon(
item['status']['conditions'][index]
['status'] ==
'True'
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24,
color: theme(context).colorPrimary,
),
const SizedBox(width: Constants.spacingSmall),
Expanded(
flex: 1,
child: Text(
item['status']['conditions'][index]['type'],
style: noramlTextStyle(
context,
),
overflow: TextOverflow.ellipsis,
),
overflow: TextOverflow.ellipsis,
),
),
],
],
),
),
),
);
Expand Down
10 changes: 2 additions & 8 deletions lib/widgets/resources/details/details_terminal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,7 @@ class _DetailsTerminalState extends State<DetailsTerminal> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down Expand Up @@ -248,10 +245,7 @@ class _DetailsTerminalState extends State<DetailsTerminal> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,7 @@ class _SettingsAWSProviderState extends State<SettingsAWSProvider> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,7 @@ class _SettingsAWSSSOProviderState extends State<SettingsAWSSSOProvider> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down Expand Up @@ -439,10 +436,7 @@ class _SettingsAWSSSOProviderState extends State<SettingsAWSSSOProvider> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,7 @@ class _SettingsOIDCProviderState extends State<SettingsOIDCProvider> {
child: Text(
value,
style: TextStyle(
color: Theme.of(context)
.textTheme
.displayMedium!
.color,
color: theme(context).colorTextPrimary,
),
),
);
Expand Down