I am using the awesome_dialog package for alert dialog but it showing the dialog without the image, means it is supposed to show the image as the header of the dialog box (either error image or info image), something like the below image, but my one is showing dialog without header image
awesome_dialog in flutterflow
Widgets & Design
I have created the Custom Action for the alert dialog, and called on the button action
// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:awesome_dialog/awesome_dialog.dart';
Future showToast(
BuildContext context,
String message,
String titleMsg,
String descMsg,
) async {
// Add your function code here!
await AwesomeDialog(
context: context,
animType: AnimType.rightSlide,
headerAnimationLoop: false,
dialogType: (titleMsg == "ERROR") ? DialogType.error : DialogType.info,
body: Center(
child: Text(
message,
style: TextStyle(fontStyle: FontStyle.normal),
),
),
title: titleMsg,
desc: descMsg,
btnOkColor: (titleMsg == "ERROR") ? Colors.red : Colors.blueAccent,
dismissOnTouchOutside: true,
showCloseIcon: true,
btnOkIcon: Icons.cancel,
btnOkOnPress: () {},
).show();
}
No
1
2 replies