Icon(ABC) has space at the top:
Do icons have spaces by default?
Is there a way to remove spaces?
Code:
import 'package:flutter/material.dart';
void main() {
runApp(const _MyApp());
}
class _MyApp extends StatelessWidget {
const _MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text(
"Demo1",
),
Icon(
Icons.abc,
color: Colors.grey,
size: 50,
),
Text(
"Demo2",
),
],
),
),
);
}
}
2
Answers
You added explicitly more size to
icon
widget and your rowCrossAxisAlignment
is start you can need reduce icon size & setCrossAxisAlignment: CrossAxisAlignment.center