-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListTile sugests alternartive #74499
Comments
Hi @staminna
This is because you're trying to fit a body: Center(
child: FractionallySizedBox(
widthFactor: 0.85,
child: ListTile(
tileColor: Colors.grey[700],
leading: FlutterLogo(),
title: Text('One-line with leading widget'),
trailing: Row(
children: [
FlutterLogo(
size: 100,
),
],
),
),
),
), but no issue if you constraint body: Center(
child: FractionallySizedBox(
widthFactor: 0.85,
child: ListTile(
tileColor: Colors.grey[700],
leading: FlutterLogo(),
title: Text('One-line with leading widget'),
trailing: SizedBox(
child: Row(
children: [
FlutterLogo(
size: 100,
),
],
),
),
),
),
), complete runnable code sampleimport 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: Center(
child: FractionallySizedBox(
widthFactor: 0.85,
child: ListTile(
tileColor: Colors.grey[700],
leading: FlutterLogo(),
title: Text('One-line with leading widget'),
trailing: Row(
children: [
FlutterLogo(
size: 100,
),
],
),
),
),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
);
}
} flutter doctor -v[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-GB)
• Flutter version 1.22.5 at /Users/tahatesser/Code/flutter_stable
• Framework revision 7891006299 (7 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.1
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[✓] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
! Doctor found issues in 1 category. Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it. |
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 |
Hi everyone,
I am completely new to flutter, so this may be obvious to you.
I am trying to create a ListTile inside a Container using 85% of the width.
ps. Line 183 is child: new ListTile(
Here follows the code:
logs
The text was updated successfully, but these errors were encountered: