diameter/lib/components/detail.dart

46 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
class DetailBottomRow extends StatefulWidget {
final void Function()? onCancel;
final void Function()? onSave;
const DetailBottomRow(
{Key? key, required this.onCancel, required this.onSave})
: super(key: key);
@override
_DetailBottomRowState createState() => _DetailBottomRowState();
}
class _DetailBottomRowState<T> extends State<DetailBottomRow> {
@override
Widget build(BuildContext context) {
return BottomAppBar(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
children: [
ElevatedButton.icon(
onPressed: widget.onCancel,
icon: const Icon(
Icons.close,
size: 18.0,
),
label: const Text('CANCEL'),
),
const Spacer(),
ElevatedButton.icon(
onPressed: widget.onSave,
icon: const Icon(
Icons.save,
size: 18.0,
),
label: const Text('SAVE'),
),
],
),
),
);
}
}