Skip to content

Commit

Permalink
Added contribute us page
Browse files Browse the repository at this point in the history
  • Loading branch information
guyluz11 committed Nov 20, 2024
1 parent 67e69d3 commit 12f0341
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 27 deletions.
17 changes: 14 additions & 3 deletions lib/presentation/atoms/button_atom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ class ButtonAtom extends StatelessWidget {
this.disableActionType = false,
this.translate = true,
this.isVibrating = true,
this.onBlueBackground = false,
});

final ButtonVariant variant;
final VoidCallback onPressed;
final String? text;
final IconData? icon;
final bool isVibrating;
final bool onBlueBackground;

double get width => 150;

Expand Down Expand Up @@ -125,15 +127,24 @@ class ButtonAtom extends StatelessWidget {
return buttonConstraints(
child: OutlinedButton(
onPressed: disabled ? null : onPressVibrate,
child: label(textTheme, color: colorScheme.primary),
child: label(
textTheme,
color: onBlueBackground ? Colors.white : colorScheme.primary,
),
),
);
}
return buttonConstraints(
child: OutlinedButton.icon(
onPressed: disabled ? null : onPressVibrate,
icon: Icon(icon, color: colorScheme.primary),
label: label(textTheme, color: colorScheme.primary),
icon: Icon(
icon,
color: onBlueBackground ? Colors.white : colorScheme.primary,
),
label: label(
textTheme,
color: onBlueBackground ? Colors.white : colorScheme.primary,
),
),
);
case ButtonVariant.lowEmphasisText:
Expand Down
119 changes: 119 additions & 0 deletions lib/presentation/pages/contribute_us_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:infinite_horizons/domain/controllers/controllers.dart';
import 'package:infinite_horizons/presentation/atoms/atoms.dart';
import 'package:infinite_horizons/presentation/core/theme_data.dart';
import 'package:infinite_horizons/presentation/molecules/molecules.dart';
import 'package:infinite_horizons/presentation/pages/pages.dart';

class ContributeUsPage extends StatelessWidget {
void continueOnPressed(BuildContext context) {
PreferencesController.instance
.setBool(PreferenceKeys.finishedIntroduction, true);

Navigator.of(context).pop();

Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: ColoredBox(
color: AppThemeData.logoBackgroundColor,
child: Column(
children: [
const TopBarMolecule(topBarType: TopBarType.none, margin: false),
MarginedExpandedAtom(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(width: double.infinity),
TextAtom(
'Open App',
style: Theme.of(context)
.textTheme
.displaySmall!
.copyWith(color: Colors.white),
),
const SeparatorAtom(),
const SeparatorAtom(),
TextAtom(
'The app is open source and intended to be collaborative effort.',
style: Theme.of(context)
.textTheme
.titleLarge!
.copyWith(color: Colors.white),
),
const SeparatorAtom(),
const SeparatorAtom(),
TextAtom(
'If you have any suggestions and want to contribute feel free to join us at the following links.',
style: Theme.of(context)
.textTheme
.titleLarge!
.copyWith(color: Colors.white),
),
const SeparatorAtom(),
const SeparatorAtom(),
Row(
children: [
Expanded(
child: Row(
children: [
ButtonAtom(
text: 'GitHub',
variant: ButtonVariant.mediumEmphasisOutlined,
onPressed: () =>
WebBrowserController.instance.lunchLink(
'https://github.com/guyluz11/infinite_horizons',
),
icon: FontAwesomeIcons.github,
onBlueBackground: true,
),
],
),
),
Expanded(
child: Row(
children: [
ButtonAtom(
variant: ButtonVariant.mediumEmphasisOutlined,
text: 'Contact Us',
onPressed: () =>
WebBrowserController.instance.lunchLink(
'https://github.com/guyluz11/infinite_horizons/issues',
),
icon: FontAwesomeIcons.message,
onBlueBackground: true,
),
],
),
),
],
),
],
),
),
const Expanded(
child: SizedBox(),
),
ButtonAtom(
variant: ButtonVariant.highEmphasisFilled,
onPressed: () => continueOnPressed(context),
text: 'Finish Intro',
),
const SeparatorAtom(),
const SafeArea(
child: SizedBox(),
),
],
),
),
);
}
}
26 changes: 10 additions & 16 deletions lib/presentation/pages/convincing_page.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import 'package:flutter/material.dart';
import 'package:infinite_horizons/domain/controllers/controllers.dart';
import 'package:infinite_horizons/presentation/atoms/atoms.dart';
import 'package:infinite_horizons/presentation/core/theme_data.dart';
import 'package:infinite_horizons/presentation/molecules/molecules.dart';
import 'package:infinite_horizons/presentation/pages/home_page.dart';
import 'package:infinite_horizons/presentation/pages/contribute_us_page.dart';

class ConvincingPage extends StatelessWidget {
void continueOnPressed(BuildContext context) => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => ContributeUsPage(),
),
);

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down Expand Up @@ -59,24 +64,13 @@ class ConvincingPage extends StatelessWidget {
duration: const Duration(seconds: 2),
child: ButtonAtom(
variant: ButtonVariant.highEmphasisFilled,
onPressed: () {
PreferencesController.instance
.setBool(PreferenceKeys.finishedIntroduction, true);

Navigator.of(context).pop();

Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
},
text: 'Home Page',
onPressed: () => continueOnPressed(context),
text: 'Next',
),
),
const SeparatorAtom(),
const SafeArea(
child: Text(''),
child: SizedBox(),
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/presentation/pages/pages.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export 'package:infinite_horizons/presentation/pages/activity_page.dart';
export 'package:infinite_horizons/presentation/pages/contribute_us_page.dart';
export 'package:infinite_horizons/presentation/pages/convincing_page.dart';
export 'package:infinite_horizons/presentation/pages/energy_tips_page.dart';
export 'package:infinite_horizons/presentation/pages/home_page.dart';
Expand Down
7 changes: 0 additions & 7 deletions lib/presentation/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
ButtonAtom(
variant: ButtonVariant.lowEmphasisIcon,
onPressed: () => WebBrowserController.instance.lunchLink(
'https://github.com/guyluz11/infinite_horizons/issues',
),
icon: FontAwesomeIcons.circleDot,
),
ButtonAtom(
variant: ButtonVariant.lowEmphasisIcon,
onPressed: () => WebBrowserController.instance.lunchLink(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ dependencies:
git:
url: https://github.com/guyluz11/introduction_screen.git
ref: master
# Small, easy to use and extensible logger which prints beautiful logs.
liquid_progress_indicator_v2: ^0.5.0
# Logger which prints beautiful logs
logger: ^2.2.0
permission_handler: ^11.3.1
progress_tracker:
Expand Down

0 comments on commit 12f0341

Please sign in to comment.