prepare for multiple apps

This commit is contained in:
Fabian Freund
2026-04-06 12:23:11 +02:00
parent bd1600e8dc
commit 5afc323f04
904 changed files with 29 additions and 29 deletions
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2024-2026 Fabian Freund.
*
* This file is part of WebLibre
* (see https://weblibre.eu).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:home_widget/home_widget.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:rxdart/rxdart.dart';
import 'package:weblibre/data/models/received_intent_parameter.dart';
part 'home_widget.g.dart';
@Riverpod(keepAlive: true)
Future<bool> widgetPinnable(Ref ref) async {
return await HomeWidget.isRequestPinWidgetSupported() ?? false;
}
@Riverpod()
Raw<Stream<ReceivedIntentParameter>> appWidgetLaunchStream(Ref ref) {
final initialStream = HomeWidget.initiallyLaunchedFromHomeWidget().asStream();
return ConcatStream([
initialStream,
HomeWidget.widgetClicked,
]).whereNotNull().map((uri) => ReceivedIntentParameter(null, uri.host));
}
@@ -0,0 +1,92 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'home_widget.dart';
// **************************************************************************
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(widgetPinnable)
final widgetPinnableProvider = WidgetPinnableProvider._();
final class WidgetPinnableProvider
extends $FunctionalProvider<AsyncValue<bool>, bool, FutureOr<bool>>
with $FutureModifier<bool>, $FutureProvider<bool> {
WidgetPinnableProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'widgetPinnableProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$widgetPinnableHash();
@$internal
@override
$FutureProviderElement<bool> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<bool> create(Ref ref) {
return widgetPinnable(ref);
}
}
String _$widgetPinnableHash() => r'3181e5e3e69e7e796e6429ca7507bbbc239f6c21';
@ProviderFor(appWidgetLaunchStream)
final appWidgetLaunchStreamProvider = AppWidgetLaunchStreamProvider._();
final class AppWidgetLaunchStreamProvider
extends
$FunctionalProvider<
Raw<Stream<ReceivedIntentParameter>>,
Raw<Stream<ReceivedIntentParameter>>,
Raw<Stream<ReceivedIntentParameter>>
>
with $Provider<Raw<Stream<ReceivedIntentParameter>>> {
AppWidgetLaunchStreamProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'appWidgetLaunchStreamProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$appWidgetLaunchStreamHash();
@$internal
@override
$ProviderElement<Raw<Stream<ReceivedIntentParameter>>> $createElement(
$ProviderPointer pointer,
) => $ProviderElement(pointer);
@override
Raw<Stream<ReceivedIntentParameter>> create(Ref ref) {
return appWidgetLaunchStream(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(Raw<Stream<ReceivedIntentParameter>> value) {
return $ProviderOverride(
origin: this,
providerOverride:
$SyncValueProvider<Raw<Stream<ReceivedIntentParameter>>>(value),
);
}
}
String _$appWidgetLaunchStreamHash() =>
r'ed042d1391ae3dbc26f806d6fa2e9a4a2464ae44';