I have created a widget. This is a card. The entire card is arranged in a column. In this card, two icons (Delete and Check) are to be placed in a row. Subsequently, a SizedBox should act as a separating line (I have also tried Divider, but the result was the same). After this separating line, another sized box should appear, which should contain future content. Now there is the problem that the separating line or sized box is not displayed and it is not clear to me where the error lies. Here is the widget:
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class TischCredentials extends ConsumerStatefulWidget {
const TischCredentials({super.key});
@override
ConsumerState<ConsumerStatefulWidget> createState() {
return _TischCredentialsState();
}
}
class _TischCredentialsState extends ConsumerState<TischCredentials> {
@override
Widget build(BuildContext context) {
//final tischIndex = ref.watch(tischProvider.notifier).state;
//tischIndexErhoehen(tischIndex);
return Card(
child: Column(
children: [
Row(
children: [
//Text("Tisch " + tischIndex.toString()),
IconButton(
icon: Icon(Icons.delete),
onPressed: () {},
),
IconButton(onPressed: () {}, icon: Icon(Icons.check)),
],
),
SizedBox(
height: 10,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(start: 1.0, end: 1.0),
height: 5.0,
color: Colors.red,
),
),
),
SizedBox(
height: 100,
width: 200,
),
],
),
);
}
}
Thanks for help.
it seems your divider has no width, you can add it to the Container:
SizedBox(
height: 10,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(start: 1.0, end: 1.0),
height: 5.0,
width: double.infinity,
color: Colors.red,
),
),
),