Skip to content

Commit

Permalink
Wrap up empty view
Browse files Browse the repository at this point in the history
  • Loading branch information
shockbytes committed Nov 14, 2023
1 parent d2d7321 commit 8bf16da
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
22 changes: 16 additions & 6 deletions lib/src/ui/core/lottie_view.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';

class LottieView extends StatelessWidget {
Expand All @@ -13,11 +13,21 @@ class LottieView extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Column(
children: [
LottieBuilder.asset(lottieAsset),
Text(text),
],
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
LottieBuilder.asset(lottieAsset),
Text(
text,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
textAlign: TextAlign.center,
),
],
),
);
}
}
2 changes: 1 addition & 1 deletion lib/src/ui/core/themed_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ThemedAppBar extends StatelessWidget implements PreferredSizeWidget {
backgroundColor: Theme.of(context).colorScheme.background,
// Disable coloring of action bar on scroll
surfaceTintColor: Theme.of(context).colorScheme.background,
scrolledUnderElevation: 8,
scrolledUnderElevation: 4,
shadowColor: Theme.of(context).colorScheme.onBackground,
centerTitle: true,
elevation: 0,
Expand Down
8 changes: 3 additions & 5 deletions lib/src/ui/timeline/timeline_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ class TimelinePage extends ConsumerWidget {
}

Widget _buildEmptyScreen() {
return Center(
child: LottieView(
lottieAsset: '/assets/lottie/books-staple.json',
text: 'timeline.empty'.tr(),
),
return LottieView(
lottieAsset: 'assets/lottie/books-staple.json',
text: 'timeline.empty'.tr(),
);
}

Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ flutter:
assets:
- assets/data/
- assets/logo/
- assets/lottie/
- assets/images/
- assets/translations/

0 comments on commit 8bf16da

Please sign in to comment.