-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
33 changed files
with
413 additions
and
202 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
part of 'community_view.dart'; | ||
|
||
class _CommunityContent extends StatelessWidget { | ||
const _CommunityContent(this.viewModel); | ||
|
||
final CommunityViewModel viewModel; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(tr('page.community.title')), | ||
), | ||
body: ListView( | ||
children: [ | ||
SizedBox(height: 8.0), | ||
CommunityCard(), | ||
SizedBox(height: 12.0), | ||
ListTile( | ||
leading: Icon(Icons.question_mark_outlined), | ||
title: Text(tr("list_tile.faq.title")), | ||
onTap: () => UrlOpenerService.openInCustomTab(context, RemoteConfigService.faqUrl.get()), | ||
), | ||
ListTile( | ||
leading: Icon(Icons.policy_outlined), | ||
title: Text(tr("list_tile.privacy_policy.title")), | ||
onTap: () => UrlOpenerService.openInCustomTab(context, RemoteConfigService.policyPrivacyUrl.get()), | ||
), | ||
Divider(), | ||
ListTile( | ||
leading: Icon(Icons.code), | ||
title: Text(tr("list_tile.source_code.title")), | ||
subtitle: Text(kPackageInfo.version), | ||
onTap: () => UrlOpenerService.openInCustomTab(context, RemoteConfigService.sourceCodeUrl.get()), | ||
), | ||
ListTile( | ||
leading: Icon(MdiIcons.license), | ||
title: Text(tr("list_tile.licenses.title")), | ||
onTap: () { | ||
AnalyticsService.instance.logLicenseView(); | ||
showLicensePage( | ||
context: context, | ||
applicationName: kPackageInfo.appName, | ||
applicationLegalese: '©${DateTime.now().year}', | ||
applicationVersion: "${kPackageInfo.version}+${kPackageInfo.buildNumber}", | ||
); | ||
}, | ||
), | ||
Divider(), | ||
ListTile( | ||
leading: Icon(Icons.star_border), | ||
title: Text(tr("list_tile.rate.title")), | ||
onTap: () => AppStoreOpenerService.call(), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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 @@ | ||
import 'package:easy_localization/easy_localization.dart'; | ||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart' show MdiIcons; | ||
import 'package:storypad/core/constants/app_constants.dart'; | ||
import 'package:storypad/core/services/analytics_service.dart'; | ||
import 'package:storypad/core/services/app_store_opener_service.dart' show AppStoreOpenerService; | ||
import 'package:storypad/core/services/remote_config/remote_config_service.dart'; | ||
import 'package:storypad/core/services/url_opener_service.dart'; | ||
import 'package:storypad/views/community/local_widgets/community_card.dart'; | ||
import 'package:storypad/widgets/view/view_model_provider.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:storypad/routes/base_route.dart'; | ||
|
||
import 'community_view_model.dart'; | ||
|
||
part 'community_content.dart'; | ||
|
||
class CommunityRoute extends BaseRoute { | ||
CommunityRoute(); | ||
|
||
@override | ||
Widget buildPage(BuildContext context) => CommunityView(params: this); | ||
} | ||
|
||
class CommunityView extends StatelessWidget { | ||
const CommunityView({ | ||
super.key, | ||
required this.params, | ||
}); | ||
|
||
final CommunityRoute params; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ViewModelProvider<CommunityViewModel>( | ||
create: (context) => CommunityViewModel(params: params), | ||
builder: (context, viewModel, child) { | ||
return _CommunityContent(viewModel); | ||
}, | ||
); | ||
} | ||
} |
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,10 @@ | ||
import 'package:storypad/widgets/view/base_view_model.dart'; | ||
import 'community_view.dart'; | ||
|
||
class CommunityViewModel extends BaseViewModel { | ||
final CommunityRoute params; | ||
|
||
CommunityViewModel({ | ||
required this.params, | ||
}); | ||
} |
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,75 @@ | ||
import 'package:easy_localization/easy_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:storypad/core/services/remote_config/remote_config_service.dart'; | ||
import 'package:storypad/core/services/url_opener_service.dart'; | ||
import 'package:storypad/gen/assets.gen.dart'; | ||
import 'package:storypad/widgets/sp_fade_in.dart'; | ||
import 'package:storypad/widgets/sp_tap_effect.dart'; | ||
|
||
class CommunityCard extends StatelessWidget { | ||
const CommunityCard({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SpTapEffect( | ||
effects: [SpTapEffectType.scaleDown], | ||
onTap: () => UrlOpenerService.openInCustomTab( | ||
context, | ||
RemoteConfigService.communityUrl.get(), | ||
prefersDeepLink: true, | ||
), | ||
child: Container( | ||
width: double.infinity, | ||
margin: EdgeInsets.symmetric(horizontal: 16.0), | ||
clipBehavior: Clip.hardEdge, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(8.0), | ||
color: Theme.of(context).colorScheme.tertiaryContainer, | ||
), | ||
child: Stack( | ||
children: [ | ||
Positioned( | ||
right: 16, | ||
bottom: 16, | ||
child: SpFadeIn.bound( | ||
delay: Durations.medium1, | ||
child: Assets.images.redditLogo500x500.image( | ||
height: 64, | ||
width: 64, | ||
fit: BoxFit.fitHeight, | ||
), | ||
), | ||
), | ||
Container( | ||
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), | ||
margin: EdgeInsets.only(right: 72), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
tr('list_tile.join_reddit.title'), | ||
style: TextTheme.of(context) | ||
.titleMedium | ||
?.copyWith(color: Theme.of(context).colorScheme.tertiary, fontWeight: FontWeight.bold), | ||
), | ||
Text( | ||
tr('list_tile.join_reddit.message'), | ||
style: TextTheme.of(context).bodyMedium?.copyWith(color: Theme.of(context).colorScheme.tertiary), | ||
), | ||
SizedBox(height: 12.0), | ||
], | ||
), | ||
), | ||
Positioned( | ||
top: 16.0, | ||
right: 16.0, | ||
child: Icon(Icons.keyboard_arrow_right), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import 'package:easy_localization/easy_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:storypad/core/extensions/color_scheme_extension.dart'; | ||
import 'package:storypad/views/community/community_view.dart'; | ||
|
||
class CommunityTile extends StatelessWidget { | ||
const CommunityTile({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
leading: const Icon(Icons.forum_outlined), | ||
title: RichText( | ||
textScaler: MediaQuery.textScalerOf(context), | ||
text: TextSpan( | ||
style: Theme.of(context).textTheme.bodyLarge, | ||
text: "${tr("page.community.title")} ", | ||
children: [ | ||
WidgetSpan( | ||
child: Material( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(4.0), | ||
side: BorderSide( | ||
color: ColorScheme.of(context).bootstrap.info.color, | ||
), | ||
), | ||
child: Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: MediaQuery.textScalerOf(context).scale(6), | ||
vertical: MediaQuery.textScalerOf(context).scale(1), | ||
), | ||
child: Text( | ||
tr('general.new'), | ||
style: TextTheme.of(context).labelMedium?.copyWith(color: ColorScheme.of(context).onSurface), | ||
), | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
onTap: () async { | ||
CommunityRoute().push(context); | ||
}, | ||
); | ||
} | ||
} |
Oops, something went wrong.