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
3 changes: 3 additions & 0 deletions dart_dependency_validator.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
exclude:
- "example/**"

ignore:
- cupertino_icons # An asset repository.
80 changes: 80 additions & 0 deletions example/lib/dialogs/file_metadata.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/// A dialog to display file metadata information.
///
/// Copyright (C) 2024, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Dawei Chen

library;

import 'package:flutter/material.dart';

/// Shows a dialog displaying file metadata.

void showFileMetadataDialog({
required BuildContext context,
required String fileName,
required String contentLength,
required String lastModified,
required String contentType,
required String allowdAccess,
}) {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: const Text('File Information'),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_infoRow('File name', fileName),
_infoRow('Last modified', lastModified),
_infoRow('Content length', contentLength),
_infoRow('Content type', contentType),
_infoRow('Allowed operations', allowdAccess),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('Close'),
),
],
),
);
}

Widget _infoRow(String label, String value) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 120,
child: Text(
'$label:',
style: const TextStyle(fontWeight: FontWeight.bold),
),
),
Expanded(child: Text(value)),
],
),
);
}
4 changes: 2 additions & 2 deletions example/lib/features/create_acl_inherited_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ library;

import 'package:flutter/material.dart';

import 'package:demopod/constants/app.dart';

import 'package:solidpod/solidpod.dart' show writePod, setInheritKeyDir;

import 'package:demopod/constants/app.dart';

// A widget to create a resource with inherited ACL.
//
// The resource will be created inside a parent directory and the ACL of that
Expand Down
8 changes: 4 additions & 4 deletions example/lib/features/edit_keyvalue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ library;

import 'package:flutter/material.dart';

import 'package:demopod/constants/app.dart';
import 'package:demopod/dialogs/alert.dart';
import 'package:demopod/utils/rdf.dart';
import 'package:editable/editable.dart';
import 'package:solidpod/solidpod.dart' show isUserLoggedIn, writePod;
import 'package:solidui/solidui.dart' show getKeyFromUserIfRequired;

import 'package:solidpod/solidpod.dart' show isUserLoggedIn, writePod;
import 'package:demopod/constants/app.dart';
import 'package:demopod/dialogs/alert.dart';
import 'package:demopod/utils/rdf.dart';

class KeyValueEdit extends StatefulWidget {
/// Constructor
Expand Down
Loading
Loading