Skip to content

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 3 commits into from
May 19, 2025
Merged

Conversation

Vidhijain20
Copy link

@Vidhijain20 Vidhijain20 commented May 18, 2025

Adds the About Us screen.

Screenshots / Recordings

about_us_screen.mp4

Checklist:

  • No hard coding: I have used resources from strings.xml, dimens.xml and colors.xml without hard coding any value.
  • No end of file edits: No modifications done at end of resource files strings.xml, dimens.xml or colors.xml.
  • Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • No extra space: My code does not contain any extra lines or extra spaces than the ones that are necessary.

Summary by Sourcery

Introduce an About Us screen showcasing project information and interactive contact/social links, integrate it into the app’s routing and navigation drawer, and consolidate related constants and dependencies

New Features:

  • Add About Us screen with PSLab description, feedback form link, app version, and social/contact links
  • Register '/aboutUs' route and incorporate About Us navigation in the drawer

Enhancements:

  • Centralize About Us labels, URLs, and link items in constants.dart
  • Refine navigation drawer tap logic to prevent stacking of the About Us route

Build:

  • Add font_awesome_flutter and package_info_plus dependencies in pubspec.yaml

Copy link

sourcery-ai bot commented May 18, 2025

Reviewer's Guide

Introduces a new About Us screen as a StatefulWidget, registers its route, populates it with resources from constants and external packages (url_launcher, font_awesome_flutter, package_info_plus), and updates navigation to include this screen.

Sequence Diagram for Navigating to About Us Screen

sequenceDiagram
    title Sequence Diagram for Navigating to About Us Screen
    actor User
    Participant NavDrawer as Navigation Drawer
    Participant Navigator
    Participant AboutUsScreen as About Us Screen

    User->>NavDrawer: Taps "About Us" item
    alt If AboutUsScreen is already on top and current route
        NavDrawer->>Navigator: popUntil(context, ModalRoute.withName('/aboutUs'))
    else Else
        NavDrawer->>Navigator: pushNamedAndRemoveUntil(context, "/aboutUs", (route) => route.isFirst)
    end
    Navigator->>AboutUsScreen: Creates and displays instance
    AboutUsScreen-->>User: Shows screen content with information and links
Loading

File-Level Changes

Change Details Files
Introduced About Us screen widget and route
  • Created AboutUsScreen StatefulWidget with MainScaffold layout
  • Built UI: logo, description text, feedback link, version info, and connect list
  • Imported url_launcher, font_awesome_flutter, and package_info_plus for interactions
lib/view/about_us_screen.dart
lib/main.dart
Extended constants with About Us resources
  • Added strings: aboutUs title, pslabDescription, links, and connectWithUs list
  • Centralized all new URLs and labels in constants.dart
lib/constants.dart
Updated navigation drawer for About Us routing
  • Adjusted ListTile onTap to push or pop to /aboutUs route
  • Ensured route uniqueness by removing intermediate routes
lib/view/widgets/navigation_drawer.dart
Added new dependencies
  • Included font_awesome_flutter for social icons
  • Included package_info_plus for app version retrieval
pubspec.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

github-actions bot commented May 18, 2025

@AsCress AsCress enabled auto-merge (squash) May 18, 2025 19:28
Copy link
Collaborator

@AsCress AsCress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vidhijain20 Looks amazing ! Thank you very much !

@AsCress AsCress requested a review from CloudyPadmal May 18, 2025 19:29
@AsCress AsCress force-pushed the about_us_screen, branch from 77cd561 to be388f4 Compare May 18, 2025 19:30
@AsCress
Copy link
Collaborator

AsCress commented May 18, 2025

@CloudyPadmal Looks nice, isn't it ?

Copy link
Collaborator

@CloudyPadmal CloudyPadmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few places with repetitive code.

Try,

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},
];

Create a widget

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: 14),
        ),
        onTap: () async {
          final uri = Uri.parse(item['url']);
          if (await canLaunchUrl(uri)) {
            await launchUrl(uri);
          } else {
            debugPrint('Could not launch ${item['url']}');
          }
        },
      );
    },
  );
}

Use buildContactList(contactItems) in the Scaffold.

auto-merge was automatically disabled May 19, 2025 09:27

Head branch was pushed to by a user without write access

@Vidhijain20
Copy link
Author

@CloudyPadmal Thank you very much for your comments. I’ve done the required changes and improved the layout a bit more.

@Vidhijain20 Vidhijain20 requested a review from CloudyPadmal May 19, 2025 09:40
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can create this widget in the about_us_screen.dart as we are not going to reuse this anywhere else.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CloudyPadmal Sure, I’ll move the widget to the screen itself.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vidhijain20 Vidhijain20 requested a review from CloudyPadmal May 19, 2025 14:23
Copy link
Collaborator

@CloudyPadmal CloudyPadmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@AsCress AsCress merged commit ac37438 into fossasia:flutter May 19, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants