Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Visit the package at [pub.dev](https://pub.dev/packages/solidpod).

## 0.10 Further UI migrations

+ Standardise action message colors [0.9.11 20260116 jesscmoore]
+ Fixed sharing to public/auth users bug [0.9.10 20260115 jesscmoore]
+ Fixed error when reading large file as single chunk [0.9.9 20260117 cdawei]
+ Support custom folder structure [0.9.8 20260114 anushkavid]
Expand Down
20 changes: 20 additions & 0 deletions lib/src/solid/constants/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ library;

import 'package:flutter/material.dart';

// Standard colours for actions and results.

class ActionColors {
/// Green colour used for success

static const success = Colors.green;

// Red colour used for error/failure

static const error = Colors.red;

// Colour used for warning

static const warning = Color.fromARGB(255, 204, 99, 1);

// Red colour used for delete action

static const delete = Colors.red;
}

/// Colours used across security dialogs and prompts.

class SecurityColors {
Expand Down
2 changes: 0 additions & 2 deletions lib/src/solid/grant_permission_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ void debugPrintFailure(
debugPrint(getPermissionMsg(permissionList));
}

const warnBgColor = Color.fromARGB(255, 204, 99, 1);

/// Small vertical spacing for the widget.
const smallGapV = SizedBox(height: 10.0);

Expand Down
6 changes: 3 additions & 3 deletions lib/src/solid/grant_permission_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ class GrantPermissionUiState extends State<GrantPermissionUi>
}

if (result == SolidFunctionCallStatus.success) {
_showSnackBar(successMsg, Colors.green);
_showSnackBar(successMsg, ActionColors.success);
await _updatePermissions(
dataFile,
isFile: getIsFile(),
Expand All @@ -569,12 +569,12 @@ class GrantPermissionUiState extends State<GrantPermissionUi>
widget.onPermissionGranted?.call();
} else if (result == SolidFunctionCallStatus.fail) {
// More detailed error message with troubleshooting tips
_showSnackBar(failureMsg, Colors.red);
_showSnackBar(failureMsg, ActionColors.error);

// Also log to console for debugging
debugPrintFailure(dataFile, finalWebIdList, selectedPermList);
} else if (result == SolidFunctionCallStatus.notInitialised) {
_showSnackBar(podNotInitMsg, warnBgColor);
_showSnackBar(podNotInitMsg, ActionColors.warning);
} else {
await _alert(updatePermissionMsg);
}
Expand Down
5 changes: 3 additions & 2 deletions lib/src/widgets/file_permission_data_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ library;
import 'package:flutter/material.dart' hide Key;

import 'package:solidpod/src/solid/constants/common.dart';
import 'package:solidpod/src/solid/constants/ui.dart';
import 'package:solidpod/src/solid/constants/web_acl.dart';
import 'package:solidpod/src/solid/revoke_permission.dart';
import 'package:solidpod/src/solid/utils/snack_bar.dart';
Expand Down Expand Up @@ -127,7 +128,7 @@ Widget buildPermDataTable({
icon: const Icon(
Icons.delete,
size: 24.0,
color: Colors.red,
color: ActionColors.delete,
),
onPressed: () {
showDialog(
Expand Down Expand Up @@ -164,7 +165,7 @@ Widget buildPermDataTable({
showSnackBar(
context,
'Permission revoked successfully!',
Colors.red,
ActionColors.success,
);
}
await updatePermissionsFunction(
Expand Down