Social Login Configuration
This document explains how to configure which social login providers are enabled in the MartFury app.
Overview
The app supports four social login providers:
- Apple Sign In
- Google Sign In
- Facebook Login
- Twitter/X Login
You can enable or disable each provider individually through environment variables.
Configuration Options
Enable/Disable Social Login Providers
Add the following variables to your .env file to control which social login providers are available:
# Social Login Configuration
# Set to 'true' to enable, 'false' to disable each provider
ENABLE_APPLE_SIGN_IN=true
ENABLE_GOOGLE_SIGN_IN=true
ENABLE_FACEBOOK_SIGN_IN=true
ENABLE_TWITTER_SIGN_IN=trueDefault Values
If these variables are not set in your .env file, the following defaults apply:
| Provider | Default | Notes |
|---|---|---|
ENABLE_APPLE_SIGN_IN | false | Requires Apple Developer account |
ENABLE_GOOGLE_SIGN_IN | true | Enabled by default |
ENABLE_FACEBOOK_SIGN_IN | false | Requires Facebook App |
ENABLE_TWITTER_SIGN_IN | false | Requires Twitter Developer account |
Important: Even if a provider is enabled, it will only appear on the login screen if the required credentials are also configured (see Provider-Specific Configuration below).
Configuration Examples
Enable Only Google and Apple Sign In
ENABLE_APPLE_SIGN_IN=true
ENABLE_GOOGLE_SIGN_IN=true
ENABLE_FACEBOOK_SIGN_IN=false
ENABLE_TWITTER_SIGN_IN=falseDisable All Social Login
ENABLE_APPLE_SIGN_IN=false
ENABLE_GOOGLE_SIGN_IN=false
ENABLE_FACEBOOK_SIGN_IN=false
ENABLE_TWITTER_SIGN_IN=falseEnable Only Email/Password Login
ENABLE_APPLE_SIGN_IN=false
ENABLE_GOOGLE_SIGN_IN=false
ENABLE_FACEBOOK_SIGN_IN=false
ENABLE_TWITTER_SIGN_IN=falseUI Behavior
- When all social login providers are disabled, the "or continue with" section will be hidden completely
- When some providers are enabled, only those buttons will be displayed
- The spacing between buttons adjusts automatically based on which providers are enabled
Provider-Specific Configuration
Each social login provider also requires its own configuration keys. Make sure to set up the appropriate keys for the providers you want to enable:
Apple Sign In
APPLE_SERVICE_IDAPPLE_TEAM_ID
Google Sign In
GOOGLE_CLIENT_IDGOOGLE_SERVER_CLIENT_ID
Facebook Login
FACEBOOK_APP_IDFACEBOOK_CLIENT_TOKEN
Twitter/X Login
TWITTER_CONSUMER_KEYTWITTER_CONSUMER_SECRETTWITTER_REDIRECT_URI
Implementation Details
The configuration is implemented in lib/core/app_config.dart and used in lib/src/view/screen/sign_in_screen.dart. The app checks these configuration values at runtime and conditionally renders the social login buttons.
Testing
To test different configurations:
- Update your
.envfile with the desired settings - Restart the app
- Navigate to the sign-in screen
- Verify that only the enabled providers are displayed
Troubleshooting
- If no social login buttons appear, check that at least one provider is enabled
- If a specific provider button doesn't appear:
- Verify that its enable flag is set to
true - Verify that all required credentials are configured
- For Apple Sign-In on Android, it may not appear (iOS only by default)
- Verify that its enable flag is set to
- Make sure your
.envfile is properly formatted (no spaces around the=sign) - Stop the app completely and run
flutter runagain (hot reload does not apply.envchanges)
Configuration Priority
The app checks configuration in this order:
.envfile variables (highest priority)assets/config/social_sign_in.json(fallback)
If you set ENABLE_GOOGLE_SIGN_IN=false in .env, it will override any setting in social_sign_in.json.
