Skip to content

Use filled button instead of elevated button for better Material3 design#68

Open
Crucialjun wants to merge 5 commits into
berkaycatak:mainfrom
Crucialjun:main
Open

Use filled button instead of elevated button for better Material3 design#68
Crucialjun wants to merge 5 commits into
berkaycatak:mainfrom
Crucialjun:main

Conversation

@Crucialjun

Copy link
Copy Markdown
Contributor

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • [* ] Performance improvement

Related Issues

Closes #

Changes Made

  • Use filled button instead of elevated button for better Material3 design

Testing

Automated Tests ⚠️ REQUIRED

  • I have added unit/widget tests for my changes
  • [ *] All new and existing tests pass locally (flutter test)
  • [* ] Code analysis passes with no errors (flutter analyze)
  • [ *] Code formatting is correct (dart format)
  • [* ] Test coverage is adequate (>80% for new code)

Manual Testing

  • iOS 26+ tested
  • iOS <26 tested
  • [ *] Android tested
  • Web tested (if applicable)
  • [ *] Tested in both light and dark mode
  • Tested with different screen sizes
  • Tested with accessibility features (large fonts, screen readers, etc.)

Screenshots/Videos

Before

After

Checklist

  • [* ] My code follows the style guidelines of this project
  • [* ] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [* ] My changes generate no new warnings
  • I have checked that my code does not introduce any accessibility issues
  • I have updated the CHANGELOG.md file (if applicable)
  • I have updated version number in pubspec.yaml (if applicable)
  • I have added examples to the example app (if adding new widgets)

Breaking Changes

Additional Notes

Demo Code

// Example usage

Copilot AI review requested due to automatic review settings February 12, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Android/Material implementation of AdaptiveButton to better align with Material 3 by using a FilledButton for the “filled” style, but it also includes a number of accidentally committed Gradle build/cache artifacts under android/ that should be removed before merging.

Changes:

  • Switch AdaptiveButtonStyle.filled on Material to use FilledButton (Material 3) instead of ElevatedButton.
  • Minor formatting change to Cupertino button padding.
  • (Unintended) Adds generated Gradle report/cache files under android/build/ and android/.gradle/.

Reviewed changes

Copilot reviewed 3 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/src/widgets/adaptive_button.dart Updates Material “filled” style to use FilledButton and reformats Cupertino padding.
android/build/reports/problems/problems-report.html Generated Gradle problems report (should not be committed).
android/.gradle/workspace-id.txt.lock Local Gradle cache lockfile (should not be committed).
android/.gradle/workspace-id.txt Local Gradle workspace id (should not be committed).
android/.gradle/vcs-1/gc.properties Local Gradle cache file (should not be committed).
android/.gradle/config.properties Local Gradle config (machine-specific; should not be committed).
android/.gradle/buildOutputCleanup/cache.properties Local Gradle cache metadata (should not be committed).
android/.gradle/buildOutputCleanup/buildOutputCleanup.lock Local Gradle lockfile (should not be committed).
android/.gradle/9.0-milestone-1/gc.properties Local Gradle cache file (should not be committed).
android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock Local Gradle lockfile (should not be committed).
android/.gradle/9.0-milestone-1/fileChanges/last-build.bin Local Gradle state file (should not be committed).
android/.gradle/9.0-milestone-1/checksums/checksums.lock Local Gradle lockfile (should not be committed).
Comments suppressed due to low confidence (1)

lib/src/widgets/adaptive_button.dart:456

  • There are widget tests for AdaptiveButton, but none assert that the filled style renders the intended Material3 FilledButton. Adding an assertion (e.g., that AdaptiveButton(style: filled) builds a FilledButton) would prevent regressions back to ElevatedButton and ensure the Material3 change is covered.
      case AdaptiveButtonStyle.filled:
        // Use theme's ElevatedButton style and only override explicitly provided values
        return FilledButton(
          onPressed: effectiveOnPressed,
          style: FilledButton.styleFrom(
            backgroundColor: color, // null = use theme
            foregroundColor: textColor, // null = use theme
            padding: padding, // null = use theme
            minimumSize: minSize, // null = use theme
            shape: borderRadius != null
                ? RoundedRectangleBorder(borderRadius: borderRadius!)
                : null, // null = use theme
          ),
          child: buttonChild,
        );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread android/.gradle/config.properties Outdated
Comment on lines +1 to +2
#Sun Feb 08 16:56:38 EAT 2026
java.home=C\:\\Program Files\\Android\\Android Studio\\jbr

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

This file is generated by Gradle and contains machine-specific configuration (e.g., local java.home). It should not be checked in; please remove it from version control and ensure android/.gradle/ is ignored.

Suggested change
#Sun Feb 08 16:56:38 EAT 2026
java.home=C\:\\Program Files\\Android\\Android Studio\\jbr
# This file is generated by Gradle and should not be committed to version control.

Copilot uses AI. Check for mistakes.
Comment thread lib/src/widgets/adaptive_button.dart Outdated
@@ -439,9 +441,9 @@ class AdaptiveButton extends StatelessWidget {
switch (style) {
case AdaptiveButtonStyle.filled:
// Use theme's ElevatedButton style and only override explicitly provided values

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

The inline comment says this branch uses the theme's ElevatedButton style, but the implementation now returns a FilledButton. Update the comment to match the actual widget/theme being used to avoid misleading future maintenance.

Suggested change
// Use theme's ElevatedButton style and only override explicitly provided values
// Use theme's FilledButton style and only override explicitly provided values

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
#Sun Feb 08 16:56:59 EAT 2026
gradle.version=9.0-milestone-1

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

Gradle buildOutputCleanup cache metadata is generated during local builds and should not be tracked. Remove it from the PR and ignore android/.gradle/ (or **/.gradle/).

Suggested change
#Sun Feb 08 16:56:59 EAT 2026
gradle.version=9.0-milestone-1
# This file is intentionally left without Gradle cache metadata.
# Gradle .gradle/ directories are generated during local builds and should not be tracked.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
<!DOCTYPE html>

<html lang="en">
<head>
<!-- Required meta tags -->

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

This appears to be a generated Gradle build report (android/build/...). Build outputs should not be committed to source control; please remove this file from the PR and add an ignore rule (e.g., android/build/ or **/build/) so it won't be re-added.

Copilot uses AI. Check for mistakes.
@berkaycatak

Copy link
Copy Markdown
Owner

Hello, thank you for your support. However, as Copilot stated, it appears that files that shouldn't have been sent have been sent. Could you please remove these files? Thank you.

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.

3 participants