RenderBox 没有布局:
_RenderListTile#934f1 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': 断言失败:第 2001 行 pos 12: 'hasSize' 我遇到了这个问题!!
import 'package:flutter/material.dart';
class SettingsScreen extends StatelessWidget {
const SettingsScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
child: Padding(
padding: EdgeInsets.only(
top: 50,
right: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Settings',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.w500,
),
),
Row(
children: [
ListTile(
onTap: (){},
leading: CircleAvatar(
radius: 30,
backgroundImage: AssetImage('assetimage/doctor1.jpg'),
),
title: Text(
'Dr Doctor Name',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 25,
),
),
subtitle: Text(
'Profile',
),
),
],
),
Divider(
height: 50,
),
ListTile(
onTap: () {},
leading: Container(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.blue.shade100,
shape: BoxShape.circle,
),
),
),
],
),
),
);
}
}
写,看空白页