Skip to content

Fixed profile image issue#83

Open
Shibai419 wants to merge 6 commits intoVJLIVE:mainfrom
Shibai419:sr1
Open

Fixed profile image issue#83
Shibai419 wants to merge 6 commits intoVJLIVE:mainfrom
Shibai419:sr1

Conversation

@Shibai419
Copy link

@Shibai419 Shibai419 commented Aug 7, 2025

🔥 Pull Request – Athletix

Thanks for contributing to Athletix! Please complete the following to help us review your changes efficiently.


🔖 Type of Change

  • 🚀 Feature – New functionality
  • 🐛 Fix – Bug fix
  • 🧹 Refactor – Code clean-up (no new features)
  • 🧪 Test – Added/updated tests
  • 📝 Docs – Documentation changes

📄 Description

There was an issue raised stating that the profile picture is static and when it is clicked the options to change the profile picture through gallery or camera should come so that it increases user engagement. And in this PR i have added that feature. Also i have tested it using my cloudinary account and to keep my Cloudinary credentials secret i have replaced them with placeholders. You can set your own _cloudName and _uploadPreset (preferably unsigned upload preset) variables in services/cloudinary_service.dart from your own Cloudinary account to make it completely working. I suggest to keep the secret credentials in a .env file and then replace the .env variables with the value of the variables in services/cloudinary_service.dart


🎯 Related Issue

Fixes #7


🧪 How to Test This

  1. Navigate to:

    • lib/screens/profile/profile_screen.dart
  2. Perform:

    • Tap on the profile picture.

    • A bottom sheet will appear with options:

      • Choose from Gallery

      • Take a Photo

    • Select either option and pick/capture an image.

  3. Expected behavior:

    • The selected image is uploaded to Cloudinary.

    • The profile picture on the screen updates with the new image.

    • The image URL is saved accordingly.

Tested on:

  • Android Emulator
  • Android Physical Device
  • iOS Simulator/Device (optional)

📸 UI Changes (if applicable)

Before After

|
athletix_before
athletix_after
| |


🔐 Firebase / Firestore Updates

  • New Firestore collection or document
  • Changed Firebase rules
  • Updated Auth or FCM logic

Describe briefly:


✅ Checklist

  • Code compiles and runs as expected
  • UI works well on common device sizes
  • No debug prints or commented code
  • Ran flutter pub get and dart format .
  • Code follows the project’s naming & folder structure
  • No sensitive keys or secrets in code
  • Documentation/code comments updated (if needed)

🙋 Additional Notes

To fully test the profile picture update feature, you need to configure your own Cloudinary credentials. In services/cloudinary_service.dart, replace the placeholder values of the _cloudName and _uploadPreset variables with the corresponding values from your own Cloudinary account. It is recommended to use an unsigned upload preset for this purpose. To keep these credentials secure, you should store them in a .env file and access them using the flutter_dotenv package. Then, update the code to read these values using dotenv.env['CLOUDINARY_CLOUD_NAME'] and dotenv.env['CLOUDINARY_UPLOAD_PRESET'] instead of hardcoding them. This ensures sensitive data is not exposed and the feature works seamlessly during development and deployment.

@Shibai419 Shibai419 changed the title Fixed peofile image issue Fixed profile image issue Aug 7, 2025
@Shibai419
Copy link
Author

Hey @VJLIVE ,
I solved it, you can merge it

Copy link
Owner

@VJLIVE VJLIVE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Shibai419 I saw ur PR, there are some merge conflicts which needs to be resolved.
And one more tip, please only change those files which are relevant to the issue

@Shibai419
Copy link
Author

@VJLIVE while i was creating a PR it was written to run flutter format . it was depreciated so i ran dart format . which formats all the files, other than that i did not change any file
Nvm i resolved the conflicts, you can merge it now

@Shibai419 Shibai419 requested a review from VJLIVE August 9, 2025 10:43
Copy link
Owner

@VJLIVE VJLIVE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Shibai419 I found some issues with ur PR, I had solved them, I will tell all of them

  1. Update the fetchQuotes logic with the below
Future<void> Fetchquotes() async {
    final response = await http.get(
      Uri.parse(
        'https://raw.githubusercontent.com/Keshav8605/Athletix/refs/heads/motivation_quote_feature_add/assets/motivational_quotes.json',
      ),
    );
    if (response.statusCode == 200) {
      final data = json.decode(response.body);
      quotes = data;

      // Generate random index based on the actual quotes list size
      setState(() {
        number_ = Random().nextInt(quotes.length);
      });
    } else {
      throw Exception('Failed to load quotes');
    }
  }
  1. Update the children container (line 301) with this
children: [
            Text("Today's Quote"),
            const SizedBox(height: 5),
            quotes.isNotEmpty
                ? Text(
              "${quotes[number_]['quote']}",
              style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
            )
                : const Text(
              "No quote available",
              style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
            ),
            SizedBox(height: 30),
            Lottie.asset(
              'assets/Athlete.json',
              width: 150,
              height: 150,
              fit: BoxFit.cover,
            ),
            SizedBox(height: 20),
            Row(
              children: [
                Container(
                  width: 70,
                  height: 70,
                  decoration: BoxDecoration(
                    gradient: const LinearGradient(
                      colors: [Color(0xFF667EEA), Color(0xFF764BA2)],
                    ),
                    borderRadius: BorderRadius.circular(20),
                  ),
                  child: const Icon(
                    Icons.person_rounded,
                    color: Colors.white,
                    size: 36,
                  ),
                ),
                const SizedBox(width: 20),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        greeting,
                        style: TextStyle(
                          fontSize: 14,
                          color: Colors.grey[600],
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      const SizedBox(height: 4),
                      Text(
                        name,
                        style: const TextStyle(
                          fontSize: 24,
                          fontWeight: FontWeight.bold,
                          color: Color(0xFF1A202C),
                        ),
                      ),
                      const SizedBox(height: 8),
                      Row(
                        children: [
                          _buildInfoChip(Icons.sports_rounded, sport),
                          const SizedBox(width: 12),
                          _buildInfoChip(Icons.cake_rounded, _formatDate(dob)),
                        ],
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ],
  1. Not ur issue, but important, update the cloudinary presets
static const String _cloudName = 'dgiqmo1t1';
  static const String _uploadPreset = 'flutter_unsigned';

Send the updated PR, and then it's good to go

Additional:
Please update the UI if possible for that profile picture

@Shibai419
Copy link
Author

@VJLIVE Did the changes, you can merge it now

@Shibai419 Shibai419 requested a review from VJLIVE August 11, 2025 13:23
@Shibai419
Copy link
Author

@VJLIVE its been 2 weeks, if you have some time then you can review this PR and merge it as i have solved the issues.

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.

feature : Implement Profile Picture Upload

3 participants