38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:gap/gap.dart';
|
|
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
|
|
|
|
void showModal(BuildContext context, String title, String message, bool error) {
|
|
showDialog(
|
|
context: context,
|
|
builder: (context) => Theme(
|
|
data: ThemeData(
|
|
dialogTheme: DialogThemeData(
|
|
backgroundColor: error
|
|
? const Color.fromRGBO(72, 30, 31, 0.919)
|
|
: Color.fromRGBO(18, 44, 31, 0.919), // Check the value of `error`
|
|
),
|
|
),
|
|
child: AlertDialog(
|
|
title: TextWidget(text: title, color: Color.fromRGBO(244, 244, 244, 1), bold: true, size: 24),
|
|
content: SizedBox(
|
|
height: 48,
|
|
child: Column(
|
|
children: [
|
|
const Gap(24),
|
|
TextWidget(text: message, color: Color.fromRGBO(244, 244, 244, 1), size: 16),
|
|
],
|
|
),
|
|
),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: const TextWidget(text: 'OK', color: Colors.white, bold: true, size: 16),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|