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

integrate the flutter_appavailability #266

Open
fredfalcon opened this issue Aug 13, 2022 · 34 comments
Open

integrate the flutter_appavailability #266

fredfalcon opened this issue Aug 13, 2022 · 34 comments

Comments

@fredfalcon
Copy link
Contributor

fredfalcon commented Aug 13, 2022

To integrate the flutter_appavailability package into your app, you can follow these steps:

  1. Add the flutter_appavailability package to your project by adding the following line to your pubspec.yaml file:
dependencies:
  flutter_appavailability: ^0.5.2+1

  1. Import the package in your Dart file where you want to use it:
import 'package:flutter_appavailability/flutter_appavailability.dart';

  1. Use the getInstalledApps() method to get a list of installed apps on the device:
List<Application> installedApps = [];

void getInstalledApps() async {
  List<Application> apps = await AppAvailability.getInstalledApps();
  setState(() {
    installedApps = apps;
  });
}

In this example, we're using the getInstalledApps() method from the flutter_appavailability package to get a list of all installed apps on the device. The getInstalledApps() method returns a List<Application> object containing information about each installed app, such as the app name, package name, and icon.

  1. Display the list of installed apps in your app's UI.
ListView.builder(
  itemCount: installedApps.length,
  itemBuilder: (context, index) {
    return ListTile(
      leading: CircleAvatar(
        backgroundImage: MemoryImage(installedApps[index].icon),
      ),
      title: Text(installedApps[index].appName),
      subtitle: Text(installedApps[index].packageName),
    );
  },
)

In this example, we're using a ListView.builder widget to display the list of installed apps in a scrollable list. Each app is displayed as a ListTile widget, with the app icon, name, and package name shown.

  1. Use the installed app list when reporting an issue.
    You can use the installed app list to provide additional information when reporting an issue in your app. For example, you could ask the user to select the app they were using when the issue occurred, and include this information in the bug report.
    Note that the getInstalledApps() method can take a long time to complete on devices with many installed apps, so you should consider using a loading indicator while the list is being fetched.
@fredfalcon fredfalcon changed the title import website list from apple import app id list from apple Jan 24, 2023
@fredfalcon fredfalcon transferred this issue from OWASP-BLT/BLT Mar 18, 2023
@fredfalcon fredfalcon changed the title import app id list from apple integrate the flutter_appavailability Mar 18, 2023
@justary27
Copy link
Collaborator

@fredfalcon What's this issue about? Show installed apps in our app?

@fredfalcon
Copy link
Contributor Author

Yes for reporting bugs about apps using identifiers like com.blt.apps

@WaniAthar
Copy link

i can do this please assign this issue to me

@justary27
Copy link
Collaborator

Done. @WaniAthar

@WaniAthar
Copy link

the package you mentioned(flutter_appavailability) uses a deprecated version of the Android embedding
and the last update to this package was 4 years ago...
should i use some alternative or i have to use this package only, i we use this unmaintained package, "consider removing it since a future release of Flutter will remove these deprecated APIs." this warning appeared while running the app

@fredfalcon
Copy link
Contributor Author

Yes please use a current package thanks

@WaniAthar
Copy link

do i have to only show the installed apps on a new screen?

@fredfalcon
Copy link
Contributor Author

It would be when you report a bug. So the address / url will be an autocomplete

@WaniAthar
Copy link

whenever i run the app it gets stuck on
Got dependencies!
Launching lib\main.dart on 2201116PI in debug mode...
Running Gradle task 'assembleDebug'...

i am using flutter 3

@fredfalcon
Copy link
Contributor Author

See if ChatGPT4 can help

@WaniAthar
Copy link

can i create a new project and copy all the files to the new project?

@fredfalcon
Copy link
Contributor Author

If you think that will help, sure. I think you could just talk it out with ChatGPT too and solve it faster.

@WaniAthar
Copy link

If you think that will help, sure. I think you could just talk it out with ChatGPT too and solve it faster.

ok ill try to fix this

@WaniAthar
Copy link

WaniAthar commented Mar 21, 2023

what should be stored in the _titleController.text the appname or the package name

@WaniAthar
Copy link

WaniAthar commented Mar 21, 2023

when a certain app is tapped from the listBuilder its name gets stored in _titleController's text field or I can change it to "app_name (com.example.app)"
The "bug hunt" screen has the same issue, one has to type the app name
I will fix that too
is there anything to do about this issue?
i am seeing a bug in "Bug hunt " screen with the prize money slider, it shifts to right when we slide to the right and shifts to the left when we slide back to initial position,

@fredfalcon
Copy link
Contributor Author

Let's store the name but also the identifier on a hidden field

@WaniAthar
Copy link

hidden field?

@fredfalcon
Copy link
Contributor Author

The user does not need to see it. The title would be fine but I think when we send the data to the API, we should have the title and the identifier and the platform when we add the issue.

@WaniAthar
Copy link

226603904-74c51550-9eef-439f-91af-f531e805865f.gif

what should be stored in the _titleController.text the appname or the package name

in these images the app list have their package ids too, shall i hide them or it is fine?

@fredfalcon
Copy link
Contributor Author

It's fine to show them

@WaniAthar
Copy link

shall i make a pr now

@WaniAthar
Copy link

WaniAthar commented Mar 21, 2023

one thing to mention is that the package(device_apps) used for retrieving the app metadata (icon, name, and packageId ) is only available for Android right now, I have put a condition in the code that if the platform is android then show the app list

@fredfalcon
Copy link
Contributor Author

yes, cool. Is there any way to get this on iOS too? Maybe we can connect to the API and pull the app names and identifiers to use in the autocomplete - just to confirm the field is an autocomplete right and not a dropdown?

@WaniAthar
Copy link

it is a dropdown

@fredfalcon
Copy link
Contributor Author

Can you please make it an autocomplete so that people can manually enter the name as well, this will also keep the existing functionality to enter a url

@fredfalcon fredfalcon pinned this issue Mar 21, 2023
@WaniAthar
Copy link

working on it
sorry for being late

@WaniAthar
Copy link

WaniAthar commented Mar 22, 2023

i have added the auto complete functionality to both the screens,(report and the Bug hunt)
please review the PR

video6116362475538483139.mp4

@WaniAthar
Copy link

did you review the PR, please let me know if there is something more to add or change.

@WaniAthar
Copy link

Hello @fredfalcon @just-ary27 i noticed a bug in the slider in bug hunt screen, did you notice?
When we slide from end to end, the whole slider mover to and fro, i guess it is because not fixed size of the price money widget,
Can u open an issue regarding that.

@WaniAthar
Copy link

/assign

@github-actions
Copy link
Contributor

You are already assigned to another open issue, please wait until until it's closed or remove your assignment to get assigned to this issue.

@WaniAthar
Copy link

@fredfalcon @just-ary27 please review the PR so that i can solve other issues

@WaniAthar
Copy link

/assign

@github-actions github-actions bot assigned WaniAthar and unassigned WaniAthar Mar 24, 2023
@fredfalcon fredfalcon unpinned this issue Apr 7, 2023
@DonnieBLT
Copy link
Collaborator

It looks like this didn't make it in to the code, it's still a useful feature.

@DonnieBLT DonnieBLT changed the title integrate the flutter_appavailability Task: integrate the flutter_appavailability Jan 27, 2024
@github-project-automation github-project-automation bot moved this to Backlog in 📌 All Mar 1, 2024
@DonnieBLT DonnieBLT removed the task label Mar 3, 2024
@DonnieBLT DonnieBLT changed the title Task: integrate the flutter_appavailability integrate the flutter_appavailability Mar 3, 2024
@DonnieBLT DonnieBLT moved this from Backlog to Ready in 📌 All Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

4 participants