Enlarge/Zoom: Ability to increase the size of the grid
Pinch/Pull: Gesture to zoom in or out using two fingers
Pinch size scroll bar: A UI element to control the zoom level
Pan: Ability to move the grid around the screen
Reset view: Option to return to the default grid size and position
Grid size adjustment: Ability to change the number of grid lines
Line thickness adjustment: Option to make grid lines thicker or thinner
Contrast adjustment: Ability to change the contrast between the grid and background
Color options: Changing grid and background colors (e.g., black on white, white on black)
Central dot visibility toggle: Option to show or hide the central fixation point
These parameters allow users to customize the Amsler grid for their specific needs and make it easier to detect any distortions or irregularities in their vision. Remember that the exact features may vary depending on the specific app implementation.

add it in this code 
import 'package:flutter/material.dart';

class AmslerGridScreen extends StatelessWidget {
  const AmslerGridScreen({super.key});

  @override
  Widget build(BuildContext context) {
    // Get the screen size
    final screenSize = MediaQuery.of(context).size;
    // Calculate the desired margin based on the screen size
    final double marginWidth = screenSize.width * 0.04; // 4% of screen width as margin
    final double marginHeight = screenSize.height * 0.07; // 7% of screen height as margin

    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'B+L Amsler Grid',
          style: TextStyle(
            color: Colors.teal, 
            fontSize: 26, 
          ),
        ),
        centerTitle: true,
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios_new, color: Color.fromARGB(168, 21, 1, 1)),
          onPressed: () => Navigator.of(context).pop(),
        ),
      ),
      body: CustomPaint(
        painter: BackgroundPaint(marginWidth: marginWidth, marginHeight: marginHeight),
        size: Size.infinite, // Fill the available space
      ),
    );
  }
}

class BackgroundPaint extends CustomPainter {
  final double marginWidth;
  final double marginHeight;

  BackgroundPaint({required this.marginWidth, required this.marginHeight});

  @override
  void paint(Canvas canvas, Size size) {
    final paint = Paint()
      ..color = Colors.black
      ..strokeWidth = 1.0;

    // Calculates the size of each grid box based on the smaller dimension (width or height)
    final gridSize = (size.width - marginWidth * 2 < size.height - marginHeight * 2)
        ? (size.width - marginWidth * 2) / 20
        : (size.height - marginHeight * 2) / 20;

    // Adjust the size to account for margin and ensure square grid boxes
    final adjustedSize = Size(gridSize * 20, gridSize * 20);

    // Translate the canvas to the margin offset and move the grid upwards
    canvas.translate(marginWidth, marginHeight - gridSize * 1.5);

    // Draw the vertical and horizontal lines to create the grid
    for (int i = 0; i <= 20; i++) {
      canvas.drawLine(
        Offset(i * gridSize, 0),
        Offset(i * gridSize, adjustedSize.height),
        paint,
      );
      canvas.drawLine(
        Offset(0, i * gridSize),
        Offset(adjustedSize.width, i * gridSize),
        paint,
      );
    }

    // Draw the center dot
    final centerDot = Paint()..color = Colors.black;
    final dotRadius = 4.0; // Radius of the center dot
    final center = Offset(adjustedSize.width / 2, adjustedSize.height / 2);
    canvas.drawCircle(center, dotRadius, centerDot);
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) => false;
}