-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move widgets of Sharezone Plus page into it's own package (#1233)
This PR moves the UI widgets of the Sharezone Plus page into its own package called `sharezone_plus_page_ui`. The motivation behind this is to reuse these widgets on our website. This package only contains the UI not any logic, like `SharezonePlusPageController` because the logic is different between our app and the website (in our app you have an account, on our website you don't have an account).
- Loading branch information
1 parent
90a401d
commit 7bd1e84
Showing
32 changed files
with
1,780 additions
and
776 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
lib/sharezone_plus/sharezone_plus_page_ui/analysis_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2023 Sharezone UG (haftungsbeschränkt) | ||
# Licensed under the EUPL-1.2-or-later. | ||
# | ||
# You may obtain a copy of the Licence at: | ||
# https://joinup.ec.europa.eu/software/page/eupl | ||
# | ||
# SPDX-License-Identifier: EUPL-1.2 | ||
|
||
include: package:sharezone_lints/analysis_options.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) | ||
# Licensed under the EUPL-1.2-or-later. | ||
# | ||
# You may obtain a copy of the Licence at: | ||
# https://joinup.ec.europa.eu/software/page/eupl | ||
# | ||
# SPDX-License-Identifier: EUPL-1.2 | ||
|
||
tags: | ||
# The tag "golden" is used by the "golden_toolkit" package. | ||
# | ||
# This will indicate that goldens are an expected test tag. All tests that use | ||
# testGoldens() will automatically be given this tag. This allows you to | ||
# easily target golden tests from the command line. | ||
golden: |
19 changes: 19 additions & 0 deletions
19
lib/sharezone_plus/sharezone_plus_page_ui/lib/sharezone_plus_page_ui.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2023 Sharezone UG (haftungsbeschränkt) | ||
// Licensed under the EUPL-1.2-or-later. | ||
// | ||
// You may obtain a copy of the Licence at: | ||
// https://joinup.ec.europa.eu/software/page/eupl | ||
// | ||
// SPDX-License-Identifier: EUPL-1.2 | ||
|
||
library sharezone_plus_page_ui; | ||
|
||
export 'src/sharezone_plus_advantages.dart'; | ||
export 'src/sharezone_plus_faq.dart'; | ||
export 'src/sharezone_plus_legal_text.dart'; | ||
export 'src/sharezone_plus_page_header.dart'; | ||
export 'src/sharezone_plus_page_theme.dart'; | ||
export 'src/sharezone_plus_support_note.dart'; | ||
export 'src/why_sharezone_plus_card.dart'; | ||
export 'src/sharezone_plus_price.dart'; | ||
export 'src/call_to_action_button.dart'; |
52 changes: 52 additions & 0 deletions
52
lib/sharezone_plus/sharezone_plus_page_ui/lib/src/call_to_action_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) 2024 Sharezone UG (haftungsbeschränkt) | ||
// Licensed under the EUPL-1.2-or-later. | ||
// | ||
// You may obtain a copy of the Licence at: | ||
// https://joinup.ec.europa.eu/software/page/eupl | ||
// | ||
// SPDX-License-Identifier: EUPL-1.2 | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:sharezone_widgets/sharezone_widgets.dart'; | ||
|
||
class CallToActionButton extends StatelessWidget { | ||
const CallToActionButton({ | ||
required this.text, | ||
this.onPressed, | ||
this.backgroundColor, | ||
}) : super(key: const ValueKey('call-to-action-button')); | ||
|
||
final Widget text; | ||
final VoidCallback? onPressed; | ||
final Color? backgroundColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaxWidthConstraintBox( | ||
maxWidth: 300, | ||
child: SizedBox( | ||
width: double.infinity, | ||
child: ElevatedButton( | ||
onPressed: onPressed, | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: backgroundColor, | ||
textStyle: const TextStyle( | ||
fontSize: 20, | ||
fontWeight: FontWeight.w500, | ||
), | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(12.5), | ||
), | ||
foregroundColor: Colors.white, | ||
shadowColor: Colors.transparent, | ||
elevation: 0, | ||
), | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12), | ||
child: text, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
lib/sharezone_plus/sharezone_plus_page_ui/lib/src/markdown_centered_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2024 Sharezone UG (haftungsbeschränkt) | ||
// Licensed under the EUPL-1.2-or-later. | ||
// | ||
// You may obtain a copy of the Licence at: | ||
// https://joinup.ec.europa.eu/software/page/eupl | ||
// | ||
// SPDX-License-Identifier: EUPL-1.2 | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_markdown/flutter_markdown.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
class MarkdownCenteredText extends StatelessWidget { | ||
const MarkdownCenteredText({super.key, required this.text}); | ||
|
||
final String text; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MarkdownBody( | ||
data: text, | ||
styleSheet: MarkdownStyleSheet( | ||
a: TextStyle( | ||
color: Theme.of(context).primaryColor, | ||
decoration: TextDecoration.underline, | ||
), | ||
textAlign: WrapAlignment.center, | ||
), | ||
onTapLink: (text, href, title) async { | ||
if (href == null) return; | ||
|
||
if (href == 'https://sharezone.net/privacy-policy') { | ||
Navigator.pushNamed(context, 'privacy-policy'); | ||
return; | ||
} | ||
|
||
await launchUrl(Uri.parse(href)); | ||
}, | ||
); | ||
} | ||
} |
Oops, something went wrong.