{"id":18965844,"url":"https://github.com/wso2/asgardeo-flutter-b2c-sample-app","last_synced_at":"2026-01-30T06:34:31.616Z","repository":{"id":192986206,"uuid":"687871197","full_name":"wso2/asgardeo-flutter-b2c-sample-app","owner":"wso2","description":"Flutter sample mobile application to integrate with Asgardeo for B2C Usecases","archived":false,"fork":false,"pushed_at":"2024-08-18T11:23:48.000Z","size":804,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":50,"default_branch":"main","last_synced_at":"2025-06-11T13:17:03.771Z","etag":null,"topics":["asgardeo","b2c","flutter","iam","sample-app"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wso2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T07:20:19.000Z","updated_at":"2023-10-15T05:37:35.000Z","dependencies_parsed_at":"2024-08-18T12:34:28.407Z","dependency_job_id":"add376ff-42e2-465b-a062-5d218da5d0c6","html_url":"https://github.com/wso2/asgardeo-flutter-b2c-sample-app","commit_stats":null,"previous_names":["wso2/asgardeo-flutter-b2c-sample-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wso2/asgardeo-flutter-b2c-sample-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-flutter-b2c-sample-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-flutter-b2c-sample-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-flutter-b2c-sample-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-flutter-b2c-sample-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wso2","download_url":"https://codeload.github.com/wso2/asgardeo-flutter-b2c-sample-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-flutter-b2c-sample-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28906660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asgardeo","b2c","flutter","iam","sample-app"],"created_at":"2024-11-08T14:33:14.673Z","updated_at":"2026-01-30T06:34:31.597Z","avatar_url":"https://github.com/wso2.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asgardeo-flutter-b2c-sample-app\n\nA Flutter mobile application integrated with Asgardeo. This can be used as a reference implementation to build a mobile application with Flutter.\nDevelopers can use this as a boilerplate to build an app from scratch or as a reference to find the respective code snippets.\n\n### Features\n- User sign-up\n- User sign-in\n- Sign-out\n- Secured External API calling\n- View the user profile\n- Edit the user profile\n\n## Prerequisites\n\n### Install Flutter\nFollow Flutter Installation [Documentation](https://docs.flutter.dev/get-started/install) to Install flutter.\n\nThis application is tested with Flutter version **3.10.4** and following versions of the dependencies\n\n`http` - 0.13.5\n\n`flutter_appauth` - 4.2.1\n\n`webview_flutter` - 4.2.2\n\n`provider` - 6.0.5\n\n`logger` - 2.0.1\n\nThese dependencies and the versions are available at *asgardeo-flutter-boilerplate-app/pubspec.yaml* file.\n\nCompatible versions of the above dependencies may change with the Flutter version\n\n### Setup IDE for Development\nYou can use one of the following IDEs for development\n\n- Android Studio\n- Intellij IDEA\n- Visual Studio\n\n### Setup Mobile Device or an Emulator\nYou can use one of the following options to try out the mobile application\n\n- Connect your mobile device to the computer via USB and your OS will detect the plugged-in device. Make sure to enable development mode on your mobile device.\n- Use Android Studio Emulator - If you have Android Studio installed then you can use this.\n- Use iPhone emulator in MacOS - If you have a Macbook, then you can install XCODE and use this emulator\n\n## Setup the Asgardeo Application\n1. Access Asgardeo at [https://console.asgardeo.io/](https://console.asgardeo.io/) and log in.\n2. Click **Applications** in left navigation menu and then select **Mobile Application**\n3. Create a new Mobile Application. Fill the details and click **Register**.\n    - Name: asgardeo-flutter-mobile-app\n    - Authorized Redirect URLs: *wso2.asgardeo.flutterapp://login-callback* (Use the Add New option)\n\n   See [documentation](https://wso2.com/asgardeo/docs/guides/applications/register-mobile-app/#register-the-app) for more details.\n\n\n\u003cimg src=\"resources/images/mobile_app_creation.png\"  width=\"60%\" height=\"50%\"\u003e\n\n4. Configure User attributes in the Application’s User Attributes tab.\n   Make sure to select following user attributes\n- Country attribute  in Address\n- Mobile attribute in Phone\n- First Name, Last Name, Photo Url, username attributes in Profile\n\n\u003cimg src=\"resources/images/user_attributes.png\"  width=\"60%\" height=\"50%\"\u003e\n\n5. Add following scopes as the required scopes in the Application’s User Attributes tab.\n   Required scopes:\n\nopenid address phone profile\n\n\u003cimg src=\"resources/images/scopes.png\"  width=\"60%\" height=\"50%\"\u003e\n\n6. Configure Access URL In Application’s General Tab.\n   **Access URL**: *wso2.asgardeo.flutterapp://signup*\n\n\u003cimg src=\"resources/images/accessURL.png\"  width=\"60%\" height=\"50%\"\u003e\n\n## Getting started with the Mobile Application\n\n1. Clone this Git repository.\n\n`git clone https://github.com/Dinithi-Hasanika/Asgardeo-Flutter-APP.git`\n\n2. Update configurations in the file `\u003cproject\u003e/lib/configs/configs.dart` in the flutter project\n\n```\nconst clientId = '\u003cApplication-client_id\u003e'; // client Id of the application\nconst redirectUrl = 'wso2.asgardeo.flutterapp://login-callback'; // application redirect url\nconst organizationName = '\u003cAsgardeo-organization-name\u003e'; // your asgardeo organization name\nconst spName = '\u003cApplication-name\u003e'; // application name \nconst externalAPIEndpoint = '\u003cexternal-api-url\u003e'; // external sample rest api url here if you want to call a rest API with bearer access token\nconst accessURL = 'wso2.asgardeo.flutterapp://signup'; // configured access URL\n\n//optional\nconst defaultPhotoURL = '\u003cdefault-photo-url\u003e'\n```\n\nThe specified default photo in the above configs will be shown in the user profile if the user has not added any photo URL.\n\n3. Run following command to download the dependencies\n\n`flutter pub get`\n\n4. Run the flutter application with the following command in flutter terminal\n\n`flutter run`\n\n## Build your own application\n\nWhen integrating this application as the base for your business application, you may need to make specific modifications to align it with your unique requirements.\nThis process may involve removing certain existing features and styles while introducing new styles and components tailored to your specific use cases.\n\n### Remove Styles and Add your own Styles\n\nDo Following value changes in `\u003cproject\u003e/lib/configs/configs.dart` file as per your preference.\n\n- Set Primary Color - Change hexa value of **primaryColor** constant\n- Set Button Radius - Change button radius **buttonRadius** constant\n\nFor other widget style changes, you need to change them from the relevant widgets.\n\n### Remove Components\n\nSteps to remove Edit User profile option available in this application.\n\n1. Remove Edit Profile button widget available in the View User Profile page. Then the app users will not have access to edit the profile.\n2. To remove source code, remove page Index condition for edit user profile page available in MyApp Class.\n\n`\u003cproject\u003e/lib/pages/my_asgardeo_app.dart` -\u003e MyApp Class -\u003e build function -\u003e Scaffold widget -\u003e body\n\nRemove following condition\n\n```\n: pageIndex == AppConstants.editProfilePage\n            ? const SingleChildScrollView(child: EditProfilePage())\n```\n\n3. Remove import statements of \u003cproject\u003e/lib/pages/edit_profile_page.dart of in \u003cproject\u003e/lib/pages/my_asgardeo_app.dart\n   `import 'edit_profile_page.dart';`\n\n4. Remove `\u003cproject\u003e/lib/pages/edit_profile_page.dart`\n\n### Add New Components\nSteps to add a new component.\n\n1. Create a \u003cnew_page_name\u003e.dart file in \u003cproject\u003e/lib/pages.\n2. Import \u003cnew_page_name\u003e.dart file to `\u003cproject\u003e/lib/pages/my_asgardeo_app.dart` file\n3. Define page Index to new page in  `\u003cproject\u003e/lib/constants/app_constants.dart` file\n\n`static const int newPage = 7;`\n\n4. Add button widget to relevant existing page and upon clicking button set Page Index of the new page calling the `CurrentPage` provider.\n\nFor more details refer `CurrentPage` provider implementation in `\u003cproject\u003e/lib/providers/page.dart`\n\n5. Add page Index to the existing conditional statement to render new page in\n\n`\u003cproject\u003e/lib/pages/my_asgardeo_app.dart` -\u003e MyApp  Class -\u003e build function -\u003e Scaffold widget -\u003e body\n \n```\n: pageIndex == AppConstants.newPage\n            ? const SingleChildScrollView(child: newPage())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwso2%2Fasgardeo-flutter-b2c-sample-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwso2%2Fasgardeo-flutter-b2c-sample-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwso2%2Fasgardeo-flutter-b2c-sample-app/lists"}