-
-
Notifications
You must be signed in to change notification settings - Fork 575
Open
Labels
dartPull requests that update Dart codePull requests that update Dart codesecuritySecurity fixSecurity fix
Description
Problem
The app lacks reusable OAuth UI widgets and a provider configuration to drive UX consistently.
Scope
- Widgets: OAuthButton, OAuthLoginSection.
- Config: oauth_config.dart storing constants for provider names/colors/scopes.
Approach
- Keep UI simple and composable; loading/disabled support.
Dependencies
- Blocked By:
- Blocks:
Files to Modify/Create
- talawa/lib/widgets/oauth/oauth_button.dart
- talawa/lib/widgets/oauth/oauth_login_section.dart
- talawa/lib/config/oauth_config.dart
Acceptance Criteria
- All existing functionality must be maintained
- Implementation must ensure no breaking changes when PR is merged
Testing Requirements
- All tests must pass successfully
- Code coverage must be >= 96%
Sample Code
This sample code is only representative of what could be done. It is provided only to give a general outline. You will need to use your initiative and industry best practices to find a solution that is suitable for the application.
// talawa/lib/widgets/oauth/oauth_button.dart
import 'package:flutter/material.dart';
class OAuthButton extends StatelessWidget {
final String label; final Color color; final VoidCallback onPressed; final bool loading;
const OAuthButton({super.key, required this.label, required this.color, required this.onPressed, this.loading=false});
@override Widget build(BuildContext context) {
return ElevatedButton(
onPressed: loading?null:onPressed,
style: ElevatedButton.styleFrom(backgroundColor: color),
child: loading? const CircularProgressIndicator.adaptive() : Text(label),
);
}
}// talawa/lib/config/oauth_config.dart
class OAuthConfig {
static const googleClientId = String.fromEnvironment('GOOGLE_CLIENT_ID', defaultValue: '');
static const googleRedirectUri = String.fromEnvironment('GOOGLE_REDIRECT_URI', defaultValue: 'talawa://oauth/callback');
static const githubClientId = String.fromEnvironment('GITHUB_CLIENT_ID', defaultValue: '');
static const githubRedirectUri = String.fromEnvironment('GITHUB_REDIRECT_URI', defaultValue: 'talawa://oauth/callback');
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dartPull requests that update Dart codePull requests that update Dart codesecuritySecurity fixSecurity fix