buildBackButton method
The back button for the preview section. 预览区的返回按钮
Implementation
Widget buildBackButton(BuildContext context) {
return Semantics(
sortKey: const OrdinalSortKey(0),
child: Padding(
padding: const EdgeInsets.all(10),
child: IconButton(
onPressed: () {
if (isSavingEntity) {
return;
}
if (previewFile.existsSync()) {
previewFile.delete();
}
Navigator.of(context).pop();
},
padding: EdgeInsets.zero,
constraints: BoxConstraints.tight(const Size.square(28)),
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
iconSize: 18,
icon: Container(
padding: const EdgeInsets.all(5),
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
child: const Icon(
Icons.keyboard_return_rounded,
color: Colors.black,
),
),
),
),
);
}