Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
thielepaul committed Apr 24, 2023
1 parent e799e66 commit 097c51c
Show file tree
Hide file tree
Showing 12 changed files with 495 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cirrusci/flutter:3.3.7
FROM docker pull ghcr.io/cirruslabs/flutter:3.7.12
RUN useradd -m flutter -s /bin/bash
RUN adduser flutter sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- run: sudo apt install -y libsqlite3-dev libjsoncpp-dev libsecret-1-dev libgtk-3-dev pkg-config clang ninja-build cmake
- uses: subosito/flutter-action@v1
with:
flutter-version: "3.3.x"
flutter-version: "3.7.x"
channel: "stable"
- run: flutter pub get
- run: flutter packages pub run build_runner build
Expand All @@ -40,7 +40,7 @@ jobs:
java-version: "11"
- uses: subosito/flutter-action@v1
with:
flutter-version: "3.3.x"
flutter-version: "3.7.x"
channel: "stable"
- run: flutter pub get
- run: flutter format --dry-run --set-exit-if-changed lib
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: "11"
- uses: subosito/flutter-action@v1
with:
flutter-version: "3.3.x"
flutter-version: "3.7.x"
channel: "stable"
- run: flutter pub get
- run: flutter format --dry-run --set-exit-if-changed lib
Expand Down
5 changes: 4 additions & 1 deletion lib/common/photoprism_uploader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:isar/isar.dart';
import 'package:path_provider/path_provider.dart';
import 'package:photo_manager/photo_manager.dart' as photolib;
import 'package:photo_manager/photo_manager.dart';
import 'package:photoprism/api/api.dart';
Expand Down Expand Up @@ -47,7 +48,9 @@ class PhotoprismUploader {
print('[BackgroundFetch] start FAILURE: $e');
});

isar = await Isar.open(<CollectionSchema<LocalFile>>[LocalFileSchema]);
final io.Directory dir = await getApplicationDocumentsDirectory();
isar = await Isar.open(<CollectionSchema<LocalFile>>[LocalFileSchema],
directory: dir.path);
updatePhotoSets();
}

Expand Down
52 changes: 49 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ class PhotoprismApp extends StatelessWidget {
final Color applicationColor =
HexColor(Provider.of<PhotoprismModel>(context).applicationColor!);

final ThemeData theme = ThemeData();
return MaterialApp(
title: 'PhotoPrism',
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
theme: ThemeData(
theme: theme.copyWith(
primaryColor: applicationColor,
backgroundColor: Colors.grey[300], // used for placeholders
colorScheme: ColorScheme.light(
primary: applicationColor,
background: Colors.grey[300]!, // used for placeholders
),
toggleableActiveColor: applicationColor,
textSelectionTheme: TextSelectionThemeData(
cursorColor: applicationColor,
selectionColor: applicationColor,
Expand All @@ -67,6 +67,52 @@ class PhotoprismApp extends StatelessWidget {
inputDecorationTheme: InputDecorationTheme(
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: applicationColor))),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return applicationColor;
}
return null;
}),
trackColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return applicationColor;
}
return null;
}),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return applicationColor;
}
return null;
}),
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return applicationColor;
}
return null;
}),
),
),
darkTheme: ThemeData.dark(),
themeMode: Provider.of<PhotoprismModel>(context).themeMode,
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/albums_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ class AlbumsPage extends StatelessWidget {
(BuildContext context, String url) =>
Container(
color: Theme.of(context)
.backgroundColor),
.colorScheme
.background),
errorWidget: (BuildContext context,
String url, Object? error) =>
const Icon(Icons.error),
Expand Down
10 changes: 5 additions & 5 deletions lib/pages/photos_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class PhotosPage extends StatelessWidget {
final PhotoprismModel model = Provider.of<PhotoprismModel>(context);
if (!(index < model.photos!.length)) {
return Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
);
}

Expand All @@ -174,15 +174,15 @@ class PhotosPage extends StatelessWidget {
(BuildContext context, AsyncSnapshot<PhotoWithFile?> snapshot) {
if (snapshot.data == null) {
return Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
);
}
final PhotoWithFile? photo = snapshot.data;
final String? imageUrl =
PhotoManager.getPhotoThumbnailUrl(context, photo);
if (imageUrl == null) {
return Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
);
}
return CachedNetworkImage(
Expand All @@ -192,11 +192,11 @@ class PhotosPage extends StatelessWidget {
fit: BoxFit.contain,
imageUrl: imageUrl,
placeholder: (BuildContext context, String url) => Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
),
errorWidget: (BuildContext context, String url, Object? error) =>
Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
child: const Icon(Icons.error),
alignment: Alignment.center,
),
Expand Down
6 changes: 3 additions & 3 deletions lib/widgets/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AboutWidget extends StatelessWidget {
text: TextSpan(
children: <InlineSpan>[
TextSpan(
style: theme.bodyText1,
style: theme.bodyLarge,
text:
'This PhotoPrism Flutter App is a community-maintained application to browse the photos on your PhotoPrism server.\n\nThe source code of the app is licensed under the GPLv3. The source code of the app can be found here: '),
TextSpan(
Expand All @@ -24,9 +24,9 @@ class AboutWidget extends StatelessWidget {
'https://github.com/photoprism/photoprism-mobile'));
},
),
TextSpan(style: theme.headline6, text: '\n\nTrademarks'),
TextSpan(style: theme.titleLarge, text: '\n\nTrademarks'),
TextSpan(
style: theme.bodyText1,
style: theme.bodyLarge,
text:
'\n\nPhotoPrism® is a registered trademark of Michael Mayer. You may use it as required to describe our software, run your server, for educational purposes, but not for offering commercial goods, products, or services without prior written permission.\n\nFeel free to reach out if you have questions:\n'),
TextSpan(
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/selectable_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _AnimatedSelectableTile extends AnimatedWidget {
return Stack(
children: <Widget>[
Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
padding: EdgeInsets.all(animation.value),
child: child,
),
Expand Down
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
#include "generated_plugin_registrant.h"

#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
Expand Down
1 change: 1 addition & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
flutter_secure_storage_linux
isar_flutter_libs
sqlite3_flutter_libs
url_launcher_linux
)
Expand Down
Loading

0 comments on commit 097c51c

Please sign in to comment.