Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a transparent placeholder when transitioning Podcast chapter image #1295

Merged
merged 1 commit into from
May 20, 2024
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
45 changes: 28 additions & 17 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ void main() async {
final repository = SembastRepository();
await Firebase.initializeApp();
_configureEasyLoading();
SharedPreferences.getInstance().then((preferences) async {
await runMigration(preferences);
AppBlocs blocs = AppBlocs(repository.backupDatabaseListener);
runApp(AppBlocsProvider(
appBlocs: blocs,
child: AnytimePodcastApp(
SharedPreferences.getInstance().then(
(preferences) async {
await runMigration(preferences);
AppBlocs blocs = AppBlocs(repository.backupDatabaseListener);
runApp(
AppBlocsProvider(
appBlocs: blocs,
child: AnytimePodcastApp(
mobileService,
repository,
Provider<PodcastPaymentsBloc>(
Expand All @@ -65,17 +67,26 @@ void main() async {
),
dispose: (_, value) => value.dispose(),
child: PlayerControlsBuilder(
builder: playerBuilder,
child: PlaceholderBuilder(
builder: placeholderBuilder,
errorBuilder: errorPlaceholderBuilder,
child: SharePodcastButtonBuilder(
builder: sharePodcastButtonBuilder,
child: ShareEpisodeButtonBuilder(
builder: shareEpisodeButtonBuilder,
child: UserApp(repository.reloadDatabaseSink))))),
))));
});
builder: playerBuilder,
child: PlaceholderBuilder(
builder: placeholderBuilder,
errorBuilder: errorPlaceholderBuilder,
podcastImageBuilder: podcastImagePlaceholderBuilder,
child: SharePodcastButtonBuilder(
builder: sharePodcastButtonBuilder,
child: ShareEpisodeButtonBuilder(
builder: shareEpisodeButtonBuilder,
child: UserApp(repository.reloadDatabaseSink),
),
),
),
),
),
),
),
);
},
);
}, (error, stackTrace) async {
BreezBridge breezBridge = ServiceInjector().breezBridge;
if (error is! FlutterErrorDetails) {
Expand Down
8 changes: 8 additions & 0 deletions lib/routes/podcast/podcast_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ WidgetBuilder placeholderBuilder() {
return builder;
}

WidgetBuilder podcastImagePlaceholderBuilder() {
builder(BuildContext context) => Container(
color: Colors.transparent,
constraints: const BoxConstraints.expand(),
);
return builder;
}

WidgetBuilder errorPlaceholderBuilder() {
builder(BuildContext context) => Placeholder(
color: Theme.of(context).colorScheme.error,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "7ae0038eb14e1ebaa1eb8a26ae144a795e0b787d"
resolved-ref: "7ae0038eb14e1ebaa1eb8a26ae144a795e0b787d"
ref: db9f878aa640954aa272e92bd7a5c364683179a9
resolved-ref: db9f878aa640954aa272e92bd7a5c364683179a9
url: "https://github.com/breez/anytime_podcast_player.git"
source: git
version: "1.2.1+74-breez"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dependencies:
anytime:
git:
url: https://github.com/breez/anytime_podcast_player.git
ref: 7ae0038eb14e1ebaa1eb8a26ae144a795e0b787d
ref: db9f878aa640954aa272e92bd7a5c364683179a9
flutter_downloader:
git:
url: https://github.com/breez/flutter_downloader.git
Expand Down
Loading