This commit is contained in:
Shawn 2022-12-21 10:57:31 -07:00
parent fdd9b1073b
commit 8b997644ab
2 changed files with 16 additions and 22 deletions

View File

@ -8,14 +8,18 @@ import 'package:wonders/ui/common/controls/locale_switcher.dart';
import 'package:wonders/ui/common/pop_navigator_underlay.dart';
import 'package:wonders/ui/screens/home_menu/about_dialog_content.dart';
class HomeMenu extends StatelessWidget {
class HomeMenu extends StatefulWidget {
const HomeMenu({Key? key, required this.data}) : super(key: key);
final WonderData data;
@override
State<HomeMenu> createState() => _HomeMenuState();
}
class _HomeMenuState extends State<HomeMenu> {
void _handleAboutPressed(BuildContext context) async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
// ignore: use_build_context_synchronously
if (!context.mounted) return;
if (!mounted) return;
showAboutDialog(
context: context,
applicationName: $strings.appName,
@ -37,7 +41,7 @@ class HomeMenu extends StatelessWidget {
void _handleCollectionPressed(BuildContext context) => context.push(ScreenPaths.collection(''));
void _handleTimelinePressed(BuildContext context) => context.push(ScreenPaths.timeline(data.type));
void _handleTimelinePressed(BuildContext context) => context.push(ScreenPaths.timeline(widget.data.type));
void _handleWonderPressed(BuildContext context, WonderData data) => Navigator.pop(context, data.type);
@ -162,7 +166,7 @@ class HomeMenu extends StatelessWidget {
}
Widget _buildGridBtn(BuildContext context, WonderData btnData) {
bool isSelected = btnData == data;
bool isSelected = btnData == widget.data;
return AspectRatio(
aspectRatio: 1,
child: Container(

View File

@ -1,19 +1,17 @@
part of '../wonder_events.dart';
class _EventsList extends StatefulWidget {
const _EventsList(
{Key? key,
const _EventsList({
Key? key,
required this.data,
this.topHeight = 0,
this.blurOnScroll = false,
this.showTopGradient = true,
this.showBottomGradient = true})
: super(key: key);
}) : super(key: key);
final WonderData data;
final double topHeight;
final bool blurOnScroll;
final bool showTopGradient;
final bool showBottomGradient;
@override
State<_EventsList> createState() => _EventsListState();
@ -82,14 +80,6 @@ class _EventsListState extends State<_EventsList> {
],
),
),
/// Vertical gradient on btm
if (widget.showBottomGradient)
Positioned.fill(
child: BottomCenter(
child: ListOverscollGradient(bottomUp: true, size: 100),
),
),
if (widget.showTopGradient)
Positioned.fill(
child: TopCenter(