Skip to content
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

Add Named Parameter Method getInstalledAppsNamed for Improved Usability #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xharkirat
Copy link

This pull request introduces a new method for fetching installed apps using named parameters, updates the documentation, and modifies file paths for a specific development environment.

Introduction of named parameters:

  • lib/installed_apps.dart: Added a new method geInstalledAppsNamed that allows fetching installed apps using named parameters such as excludeSystemApps, withIcon, and packageNamePrefix.
  • example/lib/screens/app_list.dart: Updated the AppListScreen to use the new geInstalledAppsNamed method instead of the positional parameter method.

image

Documentation update:

  • README.md: Added a new section to demonstrate how to use the getInstalledAppsNamed method with named parameters.

Usage Examples

Example 1: Default Behavior

Fetch all installed apps (excluding system apps, without icons):

List<AppInfo> apps = await getInstalledAppsNamed();

Example 2: Include System Apps

Fetch all apps, including system apps:

List<AppInfo> apps = await getInstalledAppsNamed(
  excludeSystemApps: false,
);

Example 3: Fetch with Icons and Package Prefix

Fetch apps with icons and filter by a specific package name prefix:

List<AppInfo> apps = await getInstalledAppsNamed(
  withIcon: true,
  packageNamePrefix: "com.example",
);

Benefits

  1. Improved Usability:
    • Named parameters enhance code readability and make the method's intent more explicit.
  2. Backward Compatibility:
    • Existing users can continue using getInstalledApps without any changes.
  3. Better Documentation:
    • The new method is thoroughly documented, helping developers quickly understand its usage.

Testing

  • Verified that getInstalledAppsNamed correctly calls getInstalledApps with the specified parameters.
  • Tested with various combinations of parameters to ensure expected results.
  • Ensured no impact on the existing functionality of getInstalledApps.

Impact

  • Positive: This change introduces an alternative method that improves API usability while retaining the existing functionality.
  • No Breaking Changes: The original method remains intact and unaltered.

Request for Review

  • Please review the new method implementation and documentation.
  • Feedback on the examples and overall usability of getInstalledAppsNamed is welcome.

Checklist

  • Added new getInstalledAppsNamed method with named parameters.
  • Maintained backward compatibility by keeping the existing getInstalledApps method.
  • Provided thorough documentation and examples.
  • Verified functionality through testing.

@0xharkirat
Copy link
Author

@sharmadhiraj , still waiting for review. Thanks.

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.

1 participant