Skip to content

Conversation

@victorsanni
Copy link
Contributor

@victorsanni victorsanni commented May 6, 2024

Currently, Checkbox.adaptive delegates to CupertinoCheckbox when the current platform is iOS or macOS. This PR serves to make Material Checkbox configure to a Cupertino look and feel when the Checkbox.adaptive constructor is used on iOS or macOS.

Currently, delegating to CupertinoCheckbox means that many parameters to material Checkbox are ignored:

///
/// If a [CupertinoCheckbox] is created, the following parameters are ignored:
/// [mouseCursor], [fillColor], [hoverColor], [overlayColor], [splashRadius],
/// [materialTapTargetSize], [visualDensity], [isError]. However, [shape] and
/// [side] will still affect the [CupertinoCheckbox] and should be handled if
/// native fidelity is important.
///

This PR allows for an adaptive checkbox that keeps all the parameters to the regular material Checkbox, allowing for the same levels of customization, thus fixing issues like #134917.

#134917 (comment) provides the value proposal behind this PR.

Before:
328349166-9c285f7d-98ec-4efa-8759-6f5fbc08f701-ezgif com-video-to-gif-converter

After:
aftercheckboxadaptive-ezgif com-video-to-gif-converter

code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/// Flutter code sample for [Checkbox].

void main() => runApp(const CheckboxExampleApp());

class CheckboxExampleApp extends StatelessWidget {
  const CheckboxExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Checkbox Sample')),
        body: const Center(
          child: CheckboxExample(),
        ),
      ),
    );
  }
}

class CheckboxExample extends StatefulWidget {
  const CheckboxExample({super.key});

  @override
  State<CheckboxExample> createState() => _CheckboxExampleState();
}

class _CheckboxExampleState extends State<CheckboxExample> {
  bool? isChecked = true;

  @override
  Widget build(BuildContext context) {
    Color getColor(Set<WidgetState> states) {
      const Set<WidgetState> interactiveStates = <WidgetState>{
        WidgetState.pressed,
        WidgetState.hovered,
        WidgetState.focused,
      };
      if (states.any(interactiveStates.contains)) {
        return Colors.blue;
      }
      return Colors.red;
    }

    return Column(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: [
        const Text('Cupertino Checkbox:'),
        CupertinoCheckbox(
          checkColor: Colors.white,
          tristate: true,
          value: isChecked,
          onChanged: (bool? value) {
            setState(() {
              isChecked = value;
            });
          },
        ),
        const Text('Material Checkbox:'),
        Checkbox(
          checkColor: Colors.white,
          tristate: true,
          fillColor: WidgetStateProperty.resolveWith(getColor),
          value: isChecked,
          onChanged: (bool? value) {
            setState(() {
              isChecked = value;
            });
          },
        ),
        const Text('Adaptive Checkbox'),
        Checkbox.adaptive(
          checkColor: Colors.white,
          tristate: true,
          fillColor: WidgetStateProperty.resolveWith(getColor),
          value: isChecked,
          onChanged: (bool? value) {
            setState(() {
              isChecked = value;
            });
          },
        ),
      ],
    );
  }
}


Related PR: #130425

Pre-launch Checklist

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels May 6, 2024
@victorsanni victorsanni requested review from Piinks and QuncCccccc May 6, 2024 21:54
@victorsanni victorsanni requested a review from HansMuller May 6, 2024 22:18
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

I think it was mentioned offline that one of the benefits here was that the CupertinoCheckbox did not implement an animation that could now be reflected here by re-implementing it in material.

Can you share some images or screen recordings to the PR description that show the difference between the original material Checkbox, the original CupertinoCheckbox, and the new adaptive cupertino checkbox this PR creates to illustrate the differences?

..color = checkColor
..style = PaintingStyle.stroke
..strokeWidth = _kStrokeWidth;
..strokeWidth = _isCupertino
Copy link
Contributor

Choose a reason for hiding this comment

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

Feel like _isCupertino is not necessary if we already have the enum. Can we do something like this?

..StrokeWidth = switch (designSpec) {
  _DesignSpec.cupertino => _kCupertinoStrokeWidth,
  _DesignSpec.material => _kStrokeWidth,
}

Here and all the if (_isCupertino) statements below:)

@QuncCccccc
Copy link
Contributor

Somehow this PR doesn't trigger "Google testing", maybe mark this to be Ready to review? I think this PR change probably will break G3 and we might also need to add the Adaptation change, just like what Switch did(link).

@victorsanni victorsanni marked this pull request as ready for review May 7, 2024 18:33
? _CheckboxDefaultsM3(context)
: _CheckboxDefaultsM2(context);
final CheckboxThemeData defaults;
switch (widget._checkboxType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we look and see if there is a way to reduce the number of switch statements? I am trying to consolidate Switch down to only have one platform switch statement, so the code is less complex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@github-actions github-actions bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels May 14, 2024
@victorsanni victorsanni removed the request for review from HansMuller May 15, 2024 02:43
@victorsanni victorsanni marked this pull request as draft May 21, 2024 22:59
victorsanni added a commit that referenced this pull request Jul 31, 2024
**NOTE: Previous [PR](#148804)
was closed because of a bad merge leading to pollution with unrelated
commits.**

This PR improves on the look and feel of `CupertinoCheckbox` to more
closely match native iOS/macOS checkboxes.

Adds the following updates from a native macOS checkbox:
* Fill color of an unchecked checkbox is a linear gradient that goes
from darker at the top to lighter at the bottom in dark mode
* Size of box reduced from 18.0 to 14.0
* Stroke width of check reduced from 2.5 to 2.0
* Border color changed from solid black to gray black in light mode and
a transparent gray in dark mode
* In light mode, checkbox darkens when pressed
* In dark mode, checkbox lightens when pressed
* Default blue color of a checked checkbox is darker in dark mode

### Light Mode

| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="63" alt="native checkbox"
src="https://github.com/flutter/flutter/assets/77553258/d57d4c78-2e67-49fb-9491-a5acee3782a7">
| <img width="66" alt="Screenshot 2024-06-27 at 10 23 18 AM"
src="https://github.com/flutter/flutter/assets/77553258/31c913ff-d36f-4eb5-b737-3a9117bd7eff">
| <img width="66" alt="Screenshot 2024-06-27 at 10 39 22 AM"
src="https://github.com/flutter/flutter/assets/77553258/ace8ef29-efae-4049-8f78-13fd39851947">
|

### Dark Mode - Checked

| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="22" alt="native light"
src="https://github.com/user-attachments/assets/fc52d5e1-7ab0-4a5d-b0fa-5b5bee3ed39d">
| <img width="22" alt="flutter before light"
src="https://github.com/user-attachments/assets/16e033a1-d2dd-4fb2-a5a5-f730c5f7cdc7">
| <img width="22" alt="flutter after light"
src="https://github.com/user-attachments/assets/8c0cff99-930e-4f5e-8540-e64294c1b4fa">
|

### Dark Mode - Unchecked
| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="22" alt="native dark mode"
src="https://github.com/user-attachments/assets/333280a0-85db-4464-9663-03ef7eafc270">
| <img width="22" alt="flutter before dark mode"
src="https://github.com/user-attachments/assets/a46e01ec-0d0b-4bb7-8d08-4b2723424a12">
| <img width="22" alt="flutter dark mode"
src="https://github.com/user-attachments/assets/a70ae4ad-f1ad-4441-a416-350cbdc32679">
|

### Light Mode - Disabled

| Native macOS | Flutter Before | Flutter After |
| --- | --- | --- |
| <img width="121" alt="native disabled checkbox"
src="https://github.com/user-attachments/assets/ed050d14-efec-49dd-82b6-1e7ed7fa99f9">
| <img width="136" alt="flutter b4 disabled checkbox"
src="https://github.com/user-attachments/assets/564918cf-f936-448d-b975-7bf9248bbf35">
| <img width="156" alt="flutter disabled checkbox"
src="https://github.com/user-attachments/assets/82f672a7-12e8-469c-99af-9f94c959df8f">
|

### Dark Mode - Disabled

| Native macOS | Flutter Before | Flutter After |
| --- | --- | --- |
| <img width="110" alt="disabled dark checkbox native"
src="https://github.com/user-attachments/assets/02a43b3f-5619-4b05-9066-2fd43a58c956">
| <img width="136" alt="disabled dark checkbox flutter b4"
src="https://github.com/user-attachments/assets/3a3db322-2002-4808-adc0-b10a7ab42381">
| <img width="140" alt="disabled dark checkbox flutter"
src="https://github.com/user-attachments/assets/cb91955a-8302-4dc7-8050-221fa2a7045f">

Fixes #148719.

Related PR exploring these changes: #147892

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes

---------

Co-authored-by: Kate Lovett <[email protected]>
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
**NOTE: Previous [PR](flutter#148804)
was closed because of a bad merge leading to pollution with unrelated
commits.**

This PR improves on the look and feel of `CupertinoCheckbox` to more
closely match native iOS/macOS checkboxes.

Adds the following updates from a native macOS checkbox:
* Fill color of an unchecked checkbox is a linear gradient that goes
from darker at the top to lighter at the bottom in dark mode
* Size of box reduced from 18.0 to 14.0
* Stroke width of check reduced from 2.5 to 2.0
* Border color changed from solid black to gray black in light mode and
a transparent gray in dark mode
* In light mode, checkbox darkens when pressed
* In dark mode, checkbox lightens when pressed
* Default blue color of a checked checkbox is darker in dark mode

### Light Mode

| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="63" alt="native checkbox"
src="https://github.com/flutter/flutter/assets/77553258/d57d4c78-2e67-49fb-9491-a5acee3782a7">
| <img width="66" alt="Screenshot 2024-06-27 at 10 23 18 AM"
src="https://github.com/flutter/flutter/assets/77553258/31c913ff-d36f-4eb5-b737-3a9117bd7eff">
| <img width="66" alt="Screenshot 2024-06-27 at 10 39 22 AM"
src="https://github.com/flutter/flutter/assets/77553258/ace8ef29-efae-4049-8f78-13fd39851947">
|

### Dark Mode - Checked

| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="22" alt="native light"
src="https://github.com/user-attachments/assets/fc52d5e1-7ab0-4a5d-b0fa-5b5bee3ed39d">
| <img width="22" alt="flutter before light"
src="https://github.com/user-attachments/assets/16e033a1-d2dd-4fb2-a5a5-f730c5f7cdc7">
| <img width="22" alt="flutter after light"
src="https://github.com/user-attachments/assets/8c0cff99-930e-4f5e-8540-e64294c1b4fa">
|

### Dark Mode - Unchecked
| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="22" alt="native dark mode"
src="https://github.com/user-attachments/assets/333280a0-85db-4464-9663-03ef7eafc270">
| <img width="22" alt="flutter before dark mode"
src="https://github.com/user-attachments/assets/a46e01ec-0d0b-4bb7-8d08-4b2723424a12">
| <img width="22" alt="flutter dark mode"
src="https://github.com/user-attachments/assets/a70ae4ad-f1ad-4441-a416-350cbdc32679">
|

### Light Mode - Disabled

| Native macOS | Flutter Before | Flutter After |
| --- | --- | --- |
| <img width="121" alt="native disabled checkbox"
src="https://github.com/user-attachments/assets/ed050d14-efec-49dd-82b6-1e7ed7fa99f9">
| <img width="136" alt="flutter b4 disabled checkbox"
src="https://github.com/user-attachments/assets/564918cf-f936-448d-b975-7bf9248bbf35">
| <img width="156" alt="flutter disabled checkbox"
src="https://github.com/user-attachments/assets/82f672a7-12e8-469c-99af-9f94c959df8f">
|

### Dark Mode - Disabled

| Native macOS | Flutter Before | Flutter After |
| --- | --- | --- |
| <img width="110" alt="disabled dark checkbox native"
src="https://github.com/user-attachments/assets/02a43b3f-5619-4b05-9066-2fd43a58c956">
| <img width="136" alt="disabled dark checkbox flutter b4"
src="https://github.com/user-attachments/assets/3a3db322-2002-4808-adc0-b10a7ab42381">
| <img width="140" alt="disabled dark checkbox flutter"
src="https://github.com/user-attachments/assets/cb91955a-8302-4dc7-8050-221fa2a7045f">

Fixes flutter#148719.

Related PR exploring these changes: flutter#147892

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes

---------

Co-authored-by: Kate Lovett <[email protected]>
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
**NOTE: Previous [PR](flutter#148804)
was closed because of a bad merge leading to pollution with unrelated
commits.**

This PR improves on the look and feel of `CupertinoCheckbox` to more
closely match native iOS/macOS checkboxes.

Adds the following updates from a native macOS checkbox:
* Fill color of an unchecked checkbox is a linear gradient that goes
from darker at the top to lighter at the bottom in dark mode
* Size of box reduced from 18.0 to 14.0
* Stroke width of check reduced from 2.5 to 2.0
* Border color changed from solid black to gray black in light mode and
a transparent gray in dark mode
* In light mode, checkbox darkens when pressed
* In dark mode, checkbox lightens when pressed
* Default blue color of a checked checkbox is darker in dark mode

### Light Mode

| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="63" alt="native checkbox"
src="https://github.com/flutter/flutter/assets/77553258/d57d4c78-2e67-49fb-9491-a5acee3782a7">
| <img width="66" alt="Screenshot 2024-06-27 at 10 23 18 AM"
src="https://github.com/flutter/flutter/assets/77553258/31c913ff-d36f-4eb5-b737-3a9117bd7eff">
| <img width="66" alt="Screenshot 2024-06-27 at 10 39 22 AM"
src="https://github.com/flutter/flutter/assets/77553258/ace8ef29-efae-4049-8f78-13fd39851947">
|

### Dark Mode - Checked

| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="22" alt="native light"
src="https://github.com/user-attachments/assets/fc52d5e1-7ab0-4a5d-b0fa-5b5bee3ed39d">
| <img width="22" alt="flutter before light"
src="https://github.com/user-attachments/assets/16e033a1-d2dd-4fb2-a5a5-f730c5f7cdc7">
| <img width="22" alt="flutter after light"
src="https://github.com/user-attachments/assets/8c0cff99-930e-4f5e-8540-e64294c1b4fa">
|

### Dark Mode - Unchecked
| Native macOS | Flutter Before | Flutter After |
| ----------- | ----------- | ----------- |
| <img width="22" alt="native dark mode"
src="https://github.com/user-attachments/assets/333280a0-85db-4464-9663-03ef7eafc270">
| <img width="22" alt="flutter before dark mode"
src="https://github.com/user-attachments/assets/a46e01ec-0d0b-4bb7-8d08-4b2723424a12">
| <img width="22" alt="flutter dark mode"
src="https://github.com/user-attachments/assets/a70ae4ad-f1ad-4441-a416-350cbdc32679">
|

### Light Mode - Disabled

| Native macOS | Flutter Before | Flutter After |
| --- | --- | --- |
| <img width="121" alt="native disabled checkbox"
src="https://github.com/user-attachments/assets/ed050d14-efec-49dd-82b6-1e7ed7fa99f9">
| <img width="136" alt="flutter b4 disabled checkbox"
src="https://github.com/user-attachments/assets/564918cf-f936-448d-b975-7bf9248bbf35">
| <img width="156" alt="flutter disabled checkbox"
src="https://github.com/user-attachments/assets/82f672a7-12e8-469c-99af-9f94c959df8f">
|

### Dark Mode - Disabled

| Native macOS | Flutter Before | Flutter After |
| --- | --- | --- |
| <img width="110" alt="disabled dark checkbox native"
src="https://github.com/user-attachments/assets/02a43b3f-5619-4b05-9066-2fd43a58c956">
| <img width="136" alt="disabled dark checkbox flutter b4"
src="https://github.com/user-attachments/assets/3a3db322-2002-4808-adc0-b10a7ab42381">
| <img width="140" alt="disabled dark checkbox flutter"
src="https://github.com/user-attachments/assets/cb91955a-8302-4dc7-8050-221fa2a7045f">

Fixes flutter#148719.

Related PR exploring these changes: flutter#147892

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes

---------

Co-authored-by: Kate Lovett <[email protected]>
@victorsanni victorsanni deleted the checkbox-adaptive branch July 1, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants