Skip to content

Commit c331c49

Browse files
committed
Restore the example app
1 parent d645d48 commit c331c49

25 files changed

Lines changed: 4413 additions & 0 deletions

example/.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
generated*
2+
Generated*
3+
pubspec.lock
4+
*~
5+
ignore
6+
7+
# Platform-specific build folders
8+
/android/
9+
/ios/
10+
/linux/
11+
/macos/
12+
/windows/
13+
/web/
14+
15+
# Miscellaneous
16+
*.class
17+
*.log
18+
*.pyc
19+
*.swp
20+
.DS_Store
21+
.atom/
22+
.build/
23+
.buildlog/
24+
.history
25+
.svn/
26+
.swiftpm/
27+
migrate_working_dir/
28+
29+
# IntelliJ related
30+
*.iml
31+
*.ipr
32+
*.iws
33+
.idea/
34+
35+
# The .vscode folder contains launch configuration and tasks you configure in
36+
# VS Code which you may wish to be included in version control, so this line
37+
# is commented out by default.
38+
#.vscode/
39+
40+
# Flutter/Dart/Pub related
41+
**/doc/api/
42+
**/ios/Flutter/.last_build_id
43+
.dart_tool/
44+
.flutter-plugins
45+
.flutter-plugins-dependencies
46+
.pub-cache/
47+
.pub/
48+
/build/
49+
50+
# Symbolication related
51+
app.*.symbols
52+
53+
# Obfuscation related
54+
app.*.map.json
55+
56+
# Android Studio will place build artifacts here
57+
/android/app/debug
58+
/android/app/profile
59+
/android/app/release

example/.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
17+
base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
18+
- platform: web
19+
create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
20+
base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/Makefile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
########################################################################
2+
#
3+
# Generic Makefile
4+
#
5+
# Time-stamp: <Thursday 2024-11-14 07:34:13 +1100 Graham Williams>
6+
#
7+
# Copyright (c) Graham.Williams@togaware.com
8+
#
9+
# License: Creative Commons Attribution-ShareAlike 4.0 International.
10+
#
11+
########################################################################
12+
13+
# App is often the current directory name.
14+
#
15+
# App version numbers
16+
# Major release
17+
# Minor update
18+
# Trivial update or bug fix
19+
20+
APP=$(shell pwd | xargs basename)
21+
VER=
22+
DATE=$(shell date +%Y-%m-%d)
23+
24+
# Identify a destination used by install.mk
25+
26+
DEST=/var/www/html/$(APP)
27+
28+
########################################################################
29+
# Supported Makefile modules.
30+
31+
# Often the support Makefiles will be in the local support folder, or
32+
# else installed in the local user's shares.
33+
34+
INC_BASE=../support
35+
36+
# Specific Makefiles will be loaded if they are found in
37+
# INC_BASE. Sometimes the INC_BASE is shared by multiple local
38+
# Makefiles and we want to skip specific makes. Simply define the
39+
# appropriate INC to a non-existant location and it will be skipped.
40+
41+
INC_DOCKER=skip
42+
INC_MLHUB=skip
43+
INC_WEBCAM=skip
44+
45+
# Load any modules available.
46+
47+
INC_MODULE=$(INC_BASE)/modules.mk
48+
49+
ifneq ("$(wildcard $(INC_MODULE))","")
50+
include $(INC_MODULE)
51+
endif
52+
53+
########################################################################
54+
# HELP
55+
#
56+
# Help for targets defined in this Makefile.
57+
58+
define HELP
59+
$(APP):
60+
61+
locals No local targets defined yet.
62+
63+
endef
64+
export HELP
65+
66+
help::
67+
@echo "$$HELP"
68+
69+
########################################################################
70+
# LOCAL TARGETS
71+
72+
locals:
73+
@echo "This might be the instructions to install $(APP)"
74+
75+
apk::
76+
rsync -avzh installers/$(APP)* solidcommunity.au:/var/www/html/installers/
77+
ssh solidcommunity.au chmod -R go+rX /var/www/html/installers/
78+
ssh solidcommunity.au chmod go=x /var/www/html/installers/
79+
80+
tgz::
81+
rsync -avzh installers/$(APP)* solidcommunity.au:/var/www/html/installers/
82+
ssh solidcommunity.au chmod -R go+rX /var/www/html/installers/
83+
ssh solidcommunity.au chmod go=x /var/www/html/installers/

example/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# A Demonstrator of SolidPod Functionality
2+
3+
Through this app we demonstrate the suite of functionality provided by
4+
the solidpod package.
5+
6+
Visit the [AU Solid Community](https://solidcommunity.au) for a suite
7+
of solidpod apps developed using the solidpod package.

example/analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

example/lib/constants/app.dart

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/// Constants used throughout the app.
2+
///
3+
// Time-stamp: <Wednesday 2024-05-15 10:07:05 +1000 Graham Williams>
4+
///
5+
/// Copyright (C) 2024, Software Innovation Institute, ANU.
6+
///
7+
/// Licensed under the GNU General Public License, Version 3 (the "License").
8+
///
9+
/// License: https://opensource.org/license/gpl-3-0.
10+
//
11+
// This program is free software: you can redistribute it and/or modify it under
12+
// the terms of the GNU General Public License as published by the Free Software
13+
// Foundation, either version 3 of the License, or (at your option) any later
14+
// version.
15+
//
16+
// This program is distributed in the hope that it will be useful, but WITHOUT
17+
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
// details.
20+
//
21+
// You should have received a copy of the GNU General Public License along with
22+
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
23+
///
24+
/// Authors: Graham Williams
25+
26+
library;
27+
28+
import 'package:flutter/material.dart';
29+
30+
const titleBackgroundColor = Color(0xFFF0E4D7);
31+
32+
// const dataFile = 'key-value.ttl';
33+
const dataFile = 'keyvalue/key-value.ttl';
34+
35+
//const dataFilePlain = 'key-value-plain.ttl';
36+
const dataFilePlain = dataFile;
37+
38+
String createDemoTtlStr(String fileName) {
39+
return '''@prefix demo: <#> .
40+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
41+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
42+
43+
demo:sampleData$fileName a demo:DemoResource ;
44+
rdfs:label "Demo File $fileName" ;
45+
demo:created "${DateTime.now().toIso8601String()}" ;
46+
demo:description "This is a file containing some demo ttl content" ;
47+
foaf:maker "Solid Demo" .
48+
49+
demo:exampleData$fileName
50+
demo:sampleProperty "Sample value" ;
51+
demo:category "demo-data".
52+
''';
53+
}

example/lib/dialogs/about.dart

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/// about dialog for the app
2+
///
3+
// Time-stamp: <Thursday 2024-06-27 13:38:24 +1000 Graham Williams>
4+
///
5+
/// Copyright (C) 2024, Software Innovation Institute, ANU.
6+
///
7+
/// Licensed under the GNU General Public License, Version 3 (the "License").
8+
///
9+
/// License: https://opensource.org/license/gpl-3-0.
10+
//
11+
// This program is free software: you can redistribute it and/or modify it under
12+
// the terms of the GNU General Public License as published by the Free Software
13+
// Foundation, either version 3 of the License, or (at your option) any later
14+
// version.
15+
//
16+
// This program is distributed in the hope that it will be useful, but WITHOUT
17+
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18+
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19+
// details.
20+
//
21+
// You should have received a copy of the GNU General Public License along with
22+
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
23+
///
24+
/// Authors: Kevin Wang
25+
26+
library;
27+
28+
import 'package:flutter/material.dart';
29+
30+
import 'package:solidpod/solidpod.dart';
31+
32+
Future<void> aboutDialog(BuildContext context) async {
33+
final appInfo = await getAppNameVersion();
34+
35+
// Fix the use_build_context_synchronously lint error.
36+
37+
if (context.mounted) {
38+
showAboutDialog(
39+
context: context,
40+
applicationName:
41+
'${appInfo.name[0].toUpperCase()}${appInfo.name.substring(1)}',
42+
applicationVersion: appInfo.version,
43+
applicationLegalese: '© 2024 Software Innovation Institute ANU',
44+
applicationIcon: Image.asset(
45+
'assets/images/demopod_logo.png',
46+
width: 100,
47+
height: 100,
48+
),
49+
children: [
50+
const SizedBox(
51+
width: 300, // Limit the width.
52+
child: SelectableText('\nA demostrator of SolidPod functionality.\n\n'
53+
'Demopod is a demonstrator app for the solidpod package.'
54+
' It provides a collection of buttons to exhibit the different'
55+
' calabilities provided by solidpod.\n\n'
56+
'Authors: Anuska Vidanage, Graham Williams, Dawei Chen.'),
57+
),
58+
],
59+
);
60+
}
61+
}

example/lib/dialogs/alert.dart

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/// Show an Alert dialog
2+
///
3+
/// Copyright (C) 2024, Software Innovation Institute, ANU.
4+
///
5+
/// Licensed under the GNU General Public License, Version 3 (the "License").
6+
///
7+
/// License: https://opensource.org/license/gpl-3-0.
8+
//
9+
// This program is free software: you can redistribute it and/or modify it under
10+
// the terms of the GNU General Public License as published by the Free Software
11+
// Foundation, either version 3 of the License, or (at your option) any later
12+
// version.
13+
//
14+
// This program is distributed in the hope that it will be useful, but WITHOUT
15+
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16+
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17+
// details.
18+
//
19+
// You should have received a copy of the GNU General Public License along with
20+
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
21+
///
22+
/// Authors: Dawei Chen
23+
24+
library;
25+
26+
import 'package:flutter/material.dart';
27+
28+
// Show an alert dialog
29+
Future<void> alert(BuildContext context, String msg,
30+
[String title = 'Notice']) async {
31+
await showDialog(
32+
context: context,
33+
builder: (context) => AlertDialog(
34+
title: Text(title),
35+
content: Text(msg),
36+
actions: [
37+
ElevatedButton(
38+
onPressed: () {
39+
Navigator.pop(context);
40+
},
41+
child: const Text('OK'))
42+
],
43+
));
44+
}

0 commit comments

Comments
 (0)