import 'package:flutter/material.dart';

class NotificationToast extends StatelessWidget {
  final String title;
  final VoidCallback onClose;

  const NotificationToast({required this.title, required this.onClose});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 50),
      child: Material(
        elevation: 8,
        shadowColor: Colors.black26,
        color: Colors.red,
        borderRadius: BorderRadius.circular(12),
        clipBehavior: Clip.antiAlias,
        child: IntrinsicHeight(
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Container(
                width: 60,
                child: Image.asset(
                  'assets/icons/clichnik.png',
                  fit: BoxFit.contain,
                ),
              ),

              Expanded(
                child: Padding(
                  padding: const EdgeInsets.all(12.0),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        "Данная территория не предназначена для катания!",
                        style: const TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 16,
                        ),
                        // maxLines: 1,
                        // overflow: TextOverflow.ellipsis,
                      ),
                      const SizedBox(height: 4),
                      Text(
                        "Самокат 123-456! Вернитесь на разрешенный участок дороги",
                        style: TextStyle(
                          fontSize: 14,
                        ),
                        // maxLines: 2,
                        // overflow: TextOverflow.ellipsis,
                      ),
                    ],
                  ),
                ),
              ),

              Align(
                alignment: Alignment.topRight,
                child: IconButton(
                  icon: const Icon(Icons.close, size: 20),
                  onPressed: onClose,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
