Skip to content

CheckboxTile painted below parent container #85256

@steeling

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

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: 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