Skip to content

Commit 097937a

Browse files
committed
📃Add about us screen
1 parent 6efd2ce commit 097937a

File tree

2 files changed

+165
-18
lines changed

2 files changed

+165
-18
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_github_connect/helper/GIcons.dart';
3+
import 'package:flutter_github_connect/helper/utility.dart';
4+
import 'package:flutter_github_connect/ui/theme/custom_theme.dart';
5+
import 'package:flutter_github_connect/ui/theme/export_theme.dart';
6+
import 'package:flutter_github_connect/ui/page/common/under_development.dart';
7+
import 'package:flutter_github_connect/ui/widgets/g_app_bar_title.dart';
8+
import 'package:flutter_github_connect/ui/widgets/g_card.dart';
9+
10+
class AboutUsPage extends StatelessWidget {
11+
const AboutUsPage({Key key}) : super(key: key);
12+
Widget _getUtilRos(context, String text,
13+
{Function onPressed,
14+
IconData icon = GIcons.chevron_right_24,
15+
String selectedText = ""}) {
16+
return Row(
17+
children: <Widget>[
18+
SizedBox(width: 16, height: 50),
19+
if (icon != null)
20+
Icon(
21+
icon,
22+
color: Theme.of(context).colorScheme.onSurface,
23+
size: 18,
24+
),
25+
SizedBox(width: 14),
26+
Text(
27+
text,
28+
style: Theme.of(context).textTheme.bodyText1,
29+
),
30+
Text(
31+
selectedText,
32+
style: Theme.of(context).textTheme.subtitle2,
33+
),
34+
Spacer(),
35+
Icon(
36+
GIcons.chevron_right_24,
37+
color: Theme.of(context).colorScheme.onSurface,
38+
size: 18,
39+
),
40+
SizedBox(width: 8, height: 50)
41+
],
42+
).ripple(onPressed ??
43+
() {
44+
// Underdevelopment.displaySnackbar(context, key: scaffoldKey);
45+
});
46+
}
47+
48+
Widget _section2(context) {
49+
return GCard(
50+
margin: EdgeInsets.symmetric(horizontal: 16),
51+
color: Theme.of(context).colorScheme.surface,
52+
child: Column(
53+
crossAxisAlignment: CrossAxisAlignment.start,
54+
children: <Widget>[
55+
_getUtilRos(context, "Twitter", icon: GIcons.twitter, onPressed: () {
56+
launch("https://twitter.com/TheAlphamerc");
57+
}),
58+
Divider(height: 0),
59+
_getUtilRos(context, "LinkedIn", icon: GIcons.linkedin,
60+
onPressed: () {
61+
launch("https://www.linkedin.com/in/thealphamerc/");
62+
}),
63+
Divider(height: 0),
64+
_getUtilRos(context, "Facebook", icon: GIcons.facebook,
65+
onPressed: () {
66+
launch("https://facebook.com/TheAlphaMerc");
67+
}),
68+
Divider(height: 0),
69+
_getUtilRos(context, "Github", icon: GIcons.github_2, onPressed: () {
70+
launch("https://github.com/TheAlphamerc");
71+
}),
72+
Divider(height: 0),
73+
_getUtilRos(context, "Youtube", icon: GIcons.youtube_play,
74+
onPressed: () {
75+
launch("https://www.youtube.com/user/sonusharma045sonu");
76+
}),
77+
Divider(height: 0),
78+
_getUtilRos(context, "Blog", icon: GIcons.link_external_24,
79+
onPressed: () {
80+
launch("https://dev.to/thealphamerc");
81+
}),
82+
],
83+
),
84+
);
85+
}
86+
87+
Widget _section1(context) {
88+
return GCard(
89+
margin: EdgeInsets.symmetric(horizontal: 16),
90+
color: Theme.of(context).colorScheme.surface,
91+
child: Column(
92+
crossAxisAlignment: CrossAxisAlignment.start,
93+
children: <Widget>[
94+
_getUtilRos(context, "App", icon: GIcons.link_external_24,
95+
onPressed: () {
96+
launch("");
97+
}),
98+
Divider(height: 0),
99+
_getUtilRos(context, "Project", icon: GIcons.link_external_24,
100+
onPressed: () {
101+
launch("https://github.com/TheAlphamerc/flutter-GitConnect");
102+
}),
103+
],
104+
),
105+
);
106+
}
107+
108+
void launch(String url) {
109+
Utility.launchTo(url);
110+
}
111+
112+
@override
113+
Widget build(BuildContext context) {
114+
return Scaffold(
115+
backgroundColor: Theme.of(context).backgroundColor,
116+
appBar: AppBar(
117+
title: GAppBarTitle(
118+
title: "About us",
119+
),
120+
),
121+
body: Container(
122+
padding: EdgeInsets.symmetric(horizontal: 0, vertical: 16),
123+
child: Column(
124+
crossAxisAlignment: CrossAxisAlignment.start,
125+
children: <Widget>[
126+
Text(
127+
"Git Connect ",
128+
style: Theme.of(context).textTheme.headline6,
129+
).hP16,
130+
SizedBox(height: 8),
131+
_section1(context),
132+
SizedBox(height: 20),
133+
Text(
134+
"Social Connect ",
135+
style: Theme.of(context).textTheme.headline6,
136+
).hP16,
137+
SizedBox(height: 8),
138+
_section2(context),
139+
SizedBox(height: 20),
140+
],
141+
),
142+
),
143+
);
144+
}
145+
}

‎lib/ui/page/settings/settings_page.dart‎

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_github_connect/helper/GIcons.dart';
33
import 'package:flutter_github_connect/helper/shared_prefrence_helper.dart';
44
import 'package:flutter_github_connect/ui/page/common/under_development.dart';
5+
import 'package:flutter_github_connect/ui/page/settings/about_us.dart';
56
import 'package:flutter_github_connect/ui/page/splash.dart';
67
import 'package:flutter_github_connect/ui/theme/custom_theme.dart';
78
import 'package:flutter_github_connect/ui/theme/export_theme.dart';
9+
import 'package:flutter_github_connect/ui/widgets/g_app_bar_title.dart';
810
import 'package:flutter_github_connect/ui/widgets/g_card.dart';
911
import 'package:get_it/get_it.dart';
1012

1113
class SettingsPage extends StatelessWidget {
12-
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
14+
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
1315
SettingsPage({Key key}) : super(key: key);
1416
Widget _getUtilRos(context, String text,
1517
{Function onPressed,
16-
Color color,
1718
IconData icon = GIcons.chevron_right_24,
1819
String selectedText = ""}) {
1920
return Row(
@@ -48,21 +49,22 @@ class SettingsPage extends StatelessWidget {
4849
child: Column(
4950
crossAxisAlignment: CrossAxisAlignment.start,
5051
children: <Widget>[
51-
_getUtilRos(context, "Appearence",
52-
color: GColors.green, selectedText: CustomTheme.instanceOf(context).isDarkMode ? "Dark Mode" : "Light Mode", onPressed: () {
53-
_changeTheme(
54-
context,
55-
CustomTheme.instanceOf(context).toggle);
52+
_getUtilRos(context, "About us", onPressed: () {
53+
Navigator.push(
54+
context, MaterialPageRoute(builder: (_) => AboutUsPage()));
5655
}),
5756
Divider(height: 0),
58-
_getUtilRos(context, "App Icon",
59-
color: GColors.blue, selectedText: " "),
57+
_getUtilRos(context, "Share App", selectedText: " "),
58+
Divider(height: 0),
59+
_getUtilRos(context, "Appearence",
60+
selectedText: CustomTheme.instanceOf(context).isDarkMode
61+
? "Dark Mode"
62+
: "Light Mode", onPressed: () {
63+
_changeTheme(context, CustomTheme.instanceOf(context).toggle);
64+
}),
6065
Divider(height: 0),
6166
_getUtilRos(context, "Push Notifications",
62-
color: GColors.purple,
6367
selectedText: "Direct mention"),
64-
Divider(height: 0),
65-
_getUtilRos(context, "Swipe Options", color: GColors.orange),
6668
],
6769
),
6870
);
@@ -77,7 +79,6 @@ class SettingsPage extends StatelessWidget {
7779
_getUtilRos(
7880
context,
7981
"Share Feedback",
80-
color: GColors.green,
8182
icon: GIcons.pencil_24,
8283
),
8384
],
@@ -91,9 +92,9 @@ class SettingsPage extends StatelessWidget {
9192
child: Column(
9293
crossAxisAlignment: CrossAxisAlignment.start,
9394
children: <Widget>[
94-
_getUtilRos(context, "Privacy Policy", color: GColors.green),
95+
_getUtilRos(context, "Privacy Policy"),
9596
Divider(height: 0),
96-
_getUtilRos(context, "Terms of Service", color: GColors.blue),
97+
_getUtilRos(context, "Terms of Service"),
9798
],
9899
),
99100
);
@@ -105,8 +106,7 @@ class SettingsPage extends StatelessWidget {
105106
child: Column(
106107
crossAxisAlignment: CrossAxisAlignment.start,
107108
children: <Widget>[
108-
_getUtilRos(context, "Sign out", color: GColors.green, icon: null,
109-
onPressed: () {
109+
_getUtilRos(context, "Sign out", icon: null, onPressed: () {
110110
/// [Todo] Temprary workaround for logout
111111
final getIt = GetIt.instance;
112112
final prefs = getIt<SharedPrefrenceHelper>();
@@ -134,7 +134,9 @@ class SettingsPage extends StatelessWidget {
134134
backgroundColor: Theme.of(context).backgroundColor,
135135
appBar: AppBar(
136136
elevation: 0,
137-
title: Text("Settings"),
137+
title: GAppBarTitle(
138+
title: "Settings",
139+
),
138140
backgroundColor: Theme.of(context).colorScheme.surface,
139141
),
140142
body: Container(

0 commit comments

Comments
 (0)