Skip to content

Commit

Permalink
Remove LandingPage since it is not used anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuntu committed Dec 18, 2024
1 parent 63fbed2 commit 2af76cb
Showing 1 changed file with 0 additions and 101 deletions.
101 changes: 0 additions & 101 deletions gui/packages/ubuntupro/lib/pages/widgets/page_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,107 +69,6 @@ class Pro4WSLPage extends StatelessWidget {
}
}

// A more stylized page that mimics the design of the https://ubuntu.com/pro
// landing page, with a dark background and an [svgAsset] logo followed by
// a title with some opacity, rendering the [children] in a column layout.
class LandingPage extends StatelessWidget {
const LandingPage({
super.key,
required this.children,
this.svgAsset = 'assets/Ubuntu-tag.svg',
this.title = 'Ubuntu Pro',
this.centered = false,
});
final List<Widget> children;
final String svgAsset;
final String title;
final bool centered;

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);

return Pro4WSLPage(
body: Padding(
padding: const EdgeInsets.fromLTRB(32.0, 32.0, 32.0, 8.0),
child: centered
? Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 480.0),
child: _PageContent(
svgAsset: svgAsset,
title: title,
data: theme,
centered: true,
children: children,
),
),
)
: _PageContent(
svgAsset: svgAsset,
title: title,
data: theme,
children: children,
),
),
);
}
}

class _PageContent extends StatelessWidget {
const _PageContent({
required this.svgAsset,
required this.title,
required ThemeData data,
required this.children,
this.centered = false,
}) : _data = data;

final String svgAsset;
final String title;
final ThemeData _data;
final List<Widget> children;
final bool centered;

@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment:
centered ? CrossAxisAlignment.center : CrossAxisAlignment.start,
mainAxisAlignment:
centered ? MainAxisAlignment.center : MainAxisAlignment.start,
children: [
RichText(
text: TextSpan(
children: [
WidgetSpan(
child: SvgPicture.asset(
svgAsset,
height: 70,
),
),
const WidgetSpan(
child: SizedBox(
width: 8,
),
),
TextSpan(
text: title,
style: _data.textTheme.displaySmall
?.copyWith(fontWeight: FontWeight.w100),
),
],
),
),
const SizedBox(
height: 12,
),
...children,
],
);
}
}

class CenteredPage extends StatelessWidget {
const CenteredPage({
super.key,
Expand Down

0 comments on commit 2af76cb

Please sign in to comment.