Add close underlay btn to collectibles and home menu
This commit is contained in:
parent
9463be0bcd
commit
a40f7c42ce
@ -87,19 +87,26 @@ class _BaseContentModal extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.all($styles.insets.lg),
|
||||
child: LightText(
|
||||
child: SeparatedColumn(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
separatorBuilder: () => Gap($styles.insets.md),
|
||||
children: [
|
||||
if (title != null) Text(title!, style: $styles.text.h2),
|
||||
if (child != null) child!,
|
||||
if (msg != null) Text(msg!, style: $styles.text.body),
|
||||
Gap($styles.insets.md),
|
||||
Column(children: buttons.map((e) => e).toList())
|
||||
],
|
||||
return IntrinsicHeight(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: $styles.sizes.maxContentWidth3,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all($styles.insets.lg),
|
||||
child: LightText(
|
||||
child: SeparatedColumn(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
separatorBuilder: () => Gap($styles.insets.md),
|
||||
children: [
|
||||
if (title != null) Text(title!, style: $styles.text.h2),
|
||||
if (child != null) child!,
|
||||
if (msg != null) Text(msg!, style: $styles.text.body),
|
||||
Gap($styles.insets.md),
|
||||
Column(children: buttons.map((e) => e).toList())
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
16
lib/ui/common/pop_navigator_underlay.dart
Normal file
16
lib/ui/common/pop_navigator_underlay.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import 'package:wonders/common_libs.dart';
|
||||
|
||||
class PopNavigatorUnderlay extends StatelessWidget {
|
||||
const PopNavigatorUnderlay({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ExcludeSemantics(
|
||||
child: AppBtn.basic(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
semanticLabel: '',
|
||||
child: const SizedBox.expand(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
import 'package:particle_field/particle_field.dart';
|
||||
import 'package:wonders/common_libs.dart';
|
||||
import 'package:wonders/logic/data/collectible_data.dart';
|
||||
import 'package:wonders/ui/common/app_backdrop.dart';
|
||||
import 'package:wonders/ui/common/centered_box.dart';
|
||||
import 'package:wonders/ui/common/pop_navigator_underlay.dart';
|
||||
|
||||
part 'widgets/_animated_ribbon.dart';
|
||||
part 'widgets/_celebration_particles.dart';
|
||||
@ -49,8 +51,19 @@ class CollectibleFoundScreen extends StatelessWidget {
|
||||
Widget _buildDetail(BuildContext context) {
|
||||
Duration t = $styles.times.fast;
|
||||
return Stack(key: ValueKey('detail'), children: [
|
||||
Animate().custom(duration: t, builder: (context, ratio, _) => _buildGradient(context, 1, ratio)),
|
||||
/// Background
|
||||
AppBackdrop(
|
||||
strength: .5,
|
||||
child: Container(color: $styles.colors.greyStrong.withOpacity(.96)),
|
||||
).animate().fadeIn(),
|
||||
|
||||
/// Particles
|
||||
_CelebrationParticles(fadeMs: (t * 6).inMilliseconds),
|
||||
|
||||
/// invisible close btn
|
||||
PopNavigatorUnderlay(),
|
||||
|
||||
/// Content
|
||||
SafeArea(
|
||||
child: CenteredBox(
|
||||
width: $styles.sizes.maxContentWidth3,
|
||||
|
@ -5,6 +5,7 @@ import 'package:wonders/logic/data/wonder_data.dart';
|
||||
import 'package:wonders/ui/common/app_backdrop.dart';
|
||||
import 'package:wonders/ui/common/app_icons.dart';
|
||||
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 {
|
||||
@ -48,11 +49,11 @@ class HomeMenu extends StatelessWidget {
|
||||
/// Backdrop / Underlay
|
||||
AppBackdrop(
|
||||
strength: .5,
|
||||
child: Container(
|
||||
color: $styles.colors.greyStrong.withOpacity(.7),
|
||||
),
|
||||
child: Container(color: $styles.colors.greyStrong.withOpacity(.7)),
|
||||
),
|
||||
|
||||
PopNavigatorUnderlay(),
|
||||
|
||||
SafeArea(
|
||||
child: PaddedRow(
|
||||
padding: EdgeInsets.symmetric(
|
||||
|
Loading…
x
Reference in New Issue
Block a user