-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppLinks セクションを追加 #213
AppLinks セクションを追加 #213
Changes from all commits
672688c
5db1a30
ecf2e9f
233def1
f2b014f
4f1a15b
42f9115
efce6ee
6fbfc13
3838355
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ class _Accent { | |
], | ||
); | ||
|
||
Gradient get secoundary => const LinearGradient( | ||
Gradient get secondary => const LinearGradient( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typoの修正いただきありがとうございます!! |
||
colors: [ | ||
Color.fromARGB(255, 243, 239, 147), | ||
Color.fromARGB(255, 241, 122, 55), | ||
|
@@ -30,14 +30,6 @@ class _Accent { | |
class _Sponsor { | ||
const _Sponsor(); | ||
|
||
Gradient get diamond => const LinearGradient( | ||
colors: [ | ||
Color.fromARGB(255, 155, 202, 240), | ||
Color.fromARGB(255, 225, 253, 255), | ||
Color.fromARGB(255, 155, 202, 240), | ||
], | ||
); | ||
|
||
Comment on lines
-33
to
-40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
Gradient get platinum => const LinearGradient( | ||
colors: [ | ||
Color.fromARGB(255, 225, 236, 255), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:confwebsite2023/core/components/responsive_widget.dart'; | ||
import 'package:confwebsite2023/core/gen/assets.gen.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
final class AppLinks extends StatelessWidget { | ||
const AppLinks({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final screenSizeType = ResponsiveWidget.getScreenSizeType(context); | ||
final spacing = switch (screenSizeType) { | ||
ScreenSizeType.large || ScreenSizeType.medium => 40.0, | ||
ScreenSizeType.small => 24.0, | ||
}; | ||
return Wrap( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
alignment: WrapAlignment.center, | ||
spacing: spacing, | ||
runSpacing: spacing, | ||
children: const [ | ||
_AppLink.appStore(), | ||
_AppLink.googlePlay(), | ||
], | ||
); | ||
} | ||
} | ||
|
||
final class _AppLink extends StatelessWidget { | ||
const _AppLink.appStore() : _type = _AppLinkType.appStore; | ||
|
||
const _AppLink.googlePlay() : _type = _AppLinkType.googlePlay; | ||
|
||
final _AppLinkType _type; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final onTap = switch (_type) { | ||
_AppLinkType.appStore => () { | ||
final uri = Uri.parse( | ||
'https://apps.apple.com/app/id6469518498', | ||
); | ||
unawaited(launchUrl(uri)); | ||
}, | ||
_AppLinkType.googlePlay => () { | ||
final uri = Uri.parse( | ||
'https://play.google.com/store/apps/details?id=jp.flutterkaigi.conf2023', | ||
); | ||
unawaited(launchUrl(uri)); | ||
}, | ||
}; | ||
|
||
final assetName = switch (_type) { | ||
_AppLinkType.appStore => Assets.appLinks.appStore.keyName, | ||
_AppLinkType.googlePlay => Assets.appLinks.googlePlay.keyName, | ||
}; | ||
|
||
final imageButton = Material( | ||
color: Colors.transparent, | ||
child: Ink.image( | ||
image: AssetImage(assetName), | ||
fit: BoxFit.fitHeight, | ||
child: InkWell( | ||
onTap: onTap, | ||
borderRadius: BorderRadius.circular(8), | ||
), | ||
), | ||
); | ||
Comment on lines
+59
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
final screenSizeType = ResponsiveWidget.getScreenSizeType(context); | ||
final height = switch (screenSizeType) { | ||
ScreenSizeType.large || ScreenSizeType.medium => 54.0, | ||
ScreenSizeType.small => 42.0, | ||
}; | ||
|
||
final aspectRatio = switch (_type) { | ||
_AppLinkType.appStore => 148 / 54, | ||
_AppLinkType.googlePlay => 182 / 54, | ||
}; | ||
Comment on lines
+77
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
return SizedBox( | ||
height: height, | ||
child: AspectRatio( | ||
aspectRatio: aspectRatio, | ||
child: imageButton, | ||
), | ||
); | ||
} | ||
} | ||
|
||
enum _AppLinkType { | ||
appStore, | ||
googlePlay, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:confwebsite2023/core/components/responsive_widget.dart'; | ||
import 'package:confwebsite2023/core/components/section_header.dart'; | ||
import 'package:confwebsite2023/core/theme/app_text_style.dart'; | ||
import 'package:confwebsite2023/core/theme/gradient.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
final class AppLinksHeader extends StatelessWidget { | ||
const AppLinksHeader({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
const text = 'Application'; | ||
final gradient = GradientConstant.accent.secondary; | ||
return ResponsiveWidget( | ||
largeWidget: SectionHeader.centerAlignment( | ||
text: text, | ||
style: AppTextStyle.pcHeading2, | ||
gradient: gradient, | ||
), | ||
smallWidget: SectionHeader.centerAlignment( | ||
text: text, | ||
style: AppTextStyle.spHeading2, | ||
gradient: gradient, | ||
), | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:confwebsite2023/core/theme.dart'; | ||
import 'package:confwebsite2023/features/app_links/ui/app_links.dart'; | ||
import 'package:confwebsite2023/features/app_links/ui/app_links_header.dart'; | ||
import 'package:confwebsite2023/features/app_links/ui/app_links_summary.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
final class AppLinksSection extends StatelessWidget { | ||
const AppLinksSection({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Column( | ||
children: [ | ||
AppLinksHeader(), | ||
Spaces.vertical_28, | ||
AppLinksSummary(), | ||
Spaces.vertical_36, | ||
AppLinks(), | ||
], | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:confwebsite2023/core/components/responsive_widget.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
final class AppLinksSummary extends StatelessWidget { | ||
const AppLinksSummary({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final textColor = theme.colorScheme.onPrimaryContainer; | ||
final textStyle = theme.textTheme.bodyLarge?.copyWith( | ||
color: textColor, | ||
); | ||
final screenType = ResponsiveWidget.getScreenSizeType(context); | ||
final text = switch (screenType) { | ||
ScreenSizeType.large || | ||
ScreenSizeType.medium => | ||
'FlutterKaigi 2023 のカンファレンスアプリをダウンロード', | ||
ScreenSizeType.small => 'FlutterKaigi 2023 の\nカンファレンスアプリをダウンロード', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. とてもいい感じに実装されていますね!ありがとうございます!!! |
||
}; | ||
return Text( | ||
text, | ||
textAlign: TextAlign.center, | ||
style: textStyle, | ||
); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
↓でダウンロードしたものを Figma に配置して Google Play と同じ画像形式で扱えるように png としてダウンロードしてアプリで使いやすいようにしています。
https://developer.apple.com/jp/app-store/marketing/guidelines/