-
Notifications
You must be signed in to change notification settings - Fork 815
feat: added About Us screen #2693
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
This file contains hidden or 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 |
---|---|---|
|
@@ -100,3 +100,27 @@ String bluetooth = 'BLUETOOTH'; | |
String wifi = 'WIFI'; | ||
String whatisPslab = 'What is PSLab Device?'; | ||
String pslabUrl = 'https://pslab.io'; | ||
|
||
String aboutUs = 'About Us'; | ||
String pslabDescription = | ||
'The goal of PSLab is to create an Open Source hardware device (open on all layers) that can be used for experiments by teachers, students and citizen scientists. Our tiny pocket lab provides an array of sensors for doing science and engineering experiments. It provides functions of numerous measurement devices including an oscilloscope, a waveform generator, a frequency generator, a frequency counter, a programmable voltage, current source and as a data logger.'; | ||
String feedbackNBugs = 'Feedback & Bugs'; | ||
String feedbackForm = 'https://goo.gl/forms/sHlmRAPFmzcGQ27u2'; | ||
String website = 'https://pslab.io/'; | ||
String github = 'https://github.com/fossasia/'; | ||
String facebook = 'https://www.facebook.com/pslabio/'; | ||
String x = 'https://x.com/pslabio/'; | ||
String youtube = 'https://www.youtube.com/channel/UCQprMsG-raCIMlBudm20iLQ/'; | ||
String mail = '[email protected]'; | ||
String developers = | ||
'https://github.com/fossasia/pslab-android/graphs/contributors'; | ||
List<String> connectWithUs = [ | ||
'Connect with us', | ||
'Contact us', | ||
'Visit our website', | ||
'Fork us on GitHub', | ||
'Like us on Facebook', | ||
'Follow us on X', | ||
'Watch us on Youtube', | ||
'Developers' | ||
]; |
This file contains hidden or 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 hidden or 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,171 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:pslab/constants.dart'; | ||
import 'package:pslab/view/widgets/main_scaffold_widget.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
|
||
class AboutUsScreen extends StatefulWidget { | ||
const AboutUsScreen({super.key}); | ||
|
||
@override | ||
State<StatefulWidget> createState() => _AboutUsScreenState(); | ||
} | ||
|
||
Widget buildContactList(List<Map<String, dynamic>> items) { | ||
return ListView.separated( | ||
physics: const NeverScrollableScrollPhysics(), | ||
shrinkWrap: true, | ||
itemCount: items.length, | ||
separatorBuilder: (_, __) => const Divider(thickness: 0.5, height: 1), | ||
itemBuilder: (context, index) { | ||
final item = items[index]; | ||
return ListTile( | ||
leading: item['icon'] as Icon, | ||
title: Text( | ||
item['title'], | ||
style: const TextStyle(fontSize: 15), | ||
), | ||
onTap: () async { | ||
final uri = Uri.parse(item['url']); | ||
if (await canLaunchUrl(uri)) { | ||
await launchUrl(uri); | ||
} else { | ||
debugPrint('Could not launch ${item['url']}'); | ||
} | ||
}, | ||
); | ||
}, | ||
); | ||
} | ||
|
||
class _AboutUsScreenState extends State<AboutUsScreen> { | ||
String get iconAboutUs => 'assets/images/logo.png'; | ||
final List<Map<String, dynamic>> contactItems = [ | ||
{ | ||
'icon': const Icon(Icons.mail), | ||
'title': connectWithUs[1], | ||
'url': 'mailto:$mail' | ||
}, | ||
{'icon': const Icon(Icons.link), 'title': connectWithUs[2], 'url': website}, | ||
{ | ||
'icon': const Icon(FontAwesomeIcons.github, size: 20), | ||
'title': connectWithUs[3], | ||
'url': github | ||
}, | ||
{ | ||
'icon': const Icon(Icons.facebook_sharp), | ||
'title': connectWithUs[4], | ||
'url': facebook | ||
}, | ||
{ | ||
'icon': const Icon(FontAwesomeIcons.xTwitter, size: 20), | ||
'title': connectWithUs[5], | ||
'url': x | ||
}, | ||
{ | ||
'icon': const Icon(FontAwesomeIcons.youtube, size: 20), | ||
'title': connectWithUs[6], | ||
'url': youtube | ||
}, | ||
{ | ||
'icon': const Icon(Icons.person), | ||
'title': connectWithUs[7], | ||
'url': developers | ||
}, | ||
]; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MainScaffold( | ||
title: aboutUs, | ||
index: 5, | ||
body: SafeArea( | ||
child: Center( | ||
child: SingleChildScrollView( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const SizedBox( | ||
height: 30, | ||
), | ||
Center( | ||
child: Image.asset( | ||
iconAboutUs, | ||
width: 250, | ||
height: 250, | ||
), | ||
), | ||
Center( | ||
child: Container( | ||
margin: const EdgeInsets.all(20), | ||
child: Text( | ||
pslabDescription, | ||
textAlign: TextAlign.center, | ||
style: const TextStyle( | ||
fontSize: 15, | ||
), | ||
), | ||
), | ||
), | ||
ListView( | ||
physics: const NeverScrollableScrollPhysics(), | ||
shrinkWrap: true, | ||
children: [ | ||
ListTile( | ||
leading: const Icon(Icons.link), | ||
title: Text(feedbackNBugs, | ||
style: const TextStyle( | ||
fontSize: 15, | ||
)), | ||
onTap: () async { | ||
await launchUrl(Uri.parse(feedbackForm)); | ||
}, | ||
), | ||
const Divider( | ||
thickness: 0.5, | ||
height: 1, | ||
), | ||
ListTile( | ||
leading: const Icon(Icons.widgets), | ||
title: FutureBuilder<PackageInfo>( | ||
future: PackageInfo.fromPlatform(), | ||
builder: (BuildContext context, | ||
AsyncSnapshot<PackageInfo> snapshot) { | ||
if (snapshot.hasData) { | ||
return Text( | ||
snapshot.data!.version, | ||
style: const TextStyle( | ||
fontSize: 15, | ||
), | ||
); | ||
} else { | ||
return const Text( | ||
'Loading...', | ||
style: TextStyle( | ||
fontSize: 15, | ||
), | ||
); | ||
} | ||
}), | ||
) | ||
], | ||
), | ||
Container( | ||
margin: const EdgeInsets.only(left: 15, top: 10, bottom: 10), | ||
alignment: Alignment.centerLeft, | ||
child: Text( | ||
connectWithUs[0], | ||
style: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w300, | ||
), | ||
), | ||
), | ||
buildContactList(contactItems) | ||
], | ||
), | ||
))), | ||
); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.