Skip to content

CheckboxTile painted below parent container #85256

Closed

Description

@steeling

Happens on all devices (web, & ios), including dartpad.

import 'package:flutter/material.dart';

final Color darkBlue = Color.fromARGB(255, 18, 32, 47);

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: MyWidget(),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Flexible(
          child: Container(
            color: Colors.yellow,
            padding: EdgeInsets.all(5),
            child: ListView.builder(
              shrinkWrap: true,
              padding: EdgeInsets.zero,
              itemCount: 10,
              itemBuilder: (BuildContext context, int i) {
                print(i);
                return CheckboxListTile(
                    title: Text("hello $i"),
                    tileColor: Colors.blueGrey,
                    value: false,
                    shape: RoundedRectangleBorder(
                        side: BorderSide(width: 0.5, color: Colors.blue),
                        borderRadius: BorderRadius.circular(30)),
                    onChanged: (val) {});
              },
            ),
          ),
        ),
        Container(height: 600),
      ],
    );
  }
}

The checkbox tile is painted outside of the parent container if either a border is provided via shape or if a tileColor is provided

Activity

  1. steeling commented on Jun 24, 2021

    @steeling
    Author

    This is impacting production for us, is there a recommended fix until this issue is fixed?

  2. xu-baolin commented on Jun 25, 2021

    @xu-baolin
    Member

    Here is a workaround:

                  itemBuilder: (BuildContext context, int i) {
                    print(i);
                    return Material(
                      child: CheckboxListTile(
                          title: Text("hello $i"),
                          tileColor: Colors.blueGrey,
                          value: false,
                          shape: RoundedRectangleBorder(
                              side: BorderSide(width: 0.5, color: Colors.blue),
                              borderRadius: BorderRadius.circular(30)),
                          onChanged: (val) {}),
                    );
                  },
  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 25, 2021
  4. xu-baolin commented on Jun 25, 2021

    @xu-baolin
    Member

    We have received a lot of similar issues, and I think it’s time to update our documentation.
    #85256
    #83124
    #73315
    #59963
    #84201

    CC @chunhtai @HansMuller

  5. added
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    on Jun 25, 2021
  6. added and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 14, 2021
  7. deavy commented on Aug 18, 2021

    @deavy

    Hi @xu-baolin,
    Does Flutter team have plans to release a fix, or are there only workarounds for this issue?

  8. changed the title [-]Flutter CheckboxTile painted outside of container[/-] [+]`CheckboxTile` painted below parent container[/+] on Apr 21, 2022
  9. self-assigned this
    on Apr 21, 2022
  10. TahaTesser commented on Jul 13, 2022

    @TahaTesser
    Contributor

    This is fixed by #105760

  11. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jul 13, 2022
  12. moved this to Done (PR merged) in Nevercodeon Jul 18, 2022
  13. github-actions commented on Jul 27, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions