Flutterの debugShowCheckedModeBanner

Flutter/Dart

この記事では、Flutterの debugShowCheckedModeBannerいついて書いていきます。

debugShowCheckedModeBannerとは

右上の赤色のバナー ”show mode” です。debugShowCheckedModeBannerのプロパティはbool型でtrue(表示) folse(非表示)のみ受け付けています。デフォルトは表示です。

サンプル

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false, // 右上の「DEBUG」バナーを非表示にする
      home: Scaffold(
        body: Center(
          child: Text('Hello World'),
        ),
      ),
    );
  }
}

タイトルとURLをコピーしました