second commit

This commit is contained in:
Anbarasu
2026-05-27 10:35:09 +05:30
parent c53794c04c
commit 1435ac47b0
501 changed files with 52818 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
class AppBottomSheets {
static void showConfirmation(
BuildContext context, {
required VoidCallback onAccept,
VoidCallback? onCancel,
String title = "Confirmation",
String message = "Are you sure you want to continue?",
}) {
showModalBottomSheet(
context: context,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
backgroundColor: Colors.white,
builder: (context) {
return Padding(
padding: const EdgeInsets.fromLTRB(20, 20, 20, 30),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
/// 🔹 Title
Text(
title,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 12),
/// 🔹 Message
Text(
message,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 15, color: Colors.grey[700]),
),
const SizedBox(height: 24),
/// 🔹 Buttons
Row(
children: [
Expanded(
child: OutlinedButton(
onPressed: () {
Navigator.pop(context);
Future.microtask(() => onCancel?.call());
},
child: const Text('Cancel'),
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton(
onPressed: () {
Navigator.pop(context);
Future.microtask(() => onAccept());
},
child: const Text('Accept'),
),
),
],
),
],
),
);
},
);
}
}