You can programmatically enable the PerformanceOverlay widget by
setting the showPerformanceOverlay property to true on the
MaterialApp, CupertinoApp, or WidgetsApp
constructor:
            import 'package:flutter/material.dart';

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      showPerformanceOverlay: true,
      title: 'My Awesome App',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'My Awesome App'),
    );
  }
}

            (If you’re not using MaterialApp, CupertinoApp,
or WidgetsApp, you can get the same effect by wrapping your
application in a stack and putting a widget on your stack that was
created by calling PerformanceOverlay.allEnabled().)