From a9627cd71f72cb41c5e2ce2d578e25e7f222b7e8 Mon Sep 17 00:00:00 2001 From: Mahdi Pishguy Date: Sun, 19 May 2024 10:14:26 +0330 Subject: [PATCH] Update common.dart change to support NullSafety --- lib/common.dart | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/common.dart b/lib/common.dart index 1a7eeea..9076154 100644 --- a/lib/common.dart +++ b/lib/common.dart @@ -5,8 +5,8 @@ import 'package:flutter/services.dart'; class CounterText extends StatelessWidget { const CounterText({ - Key key, - @required this.counter, + Key? key, + required this.counter, }) : super(key: key); final int counter; @@ -19,20 +19,20 @@ class CounterText extends StatelessWidget { children: [ Text( 'You have pushed the button this many times:', - style: Theme.of(context).textTheme.bodyText1.copyWith( - foreground: Paint() - ..blendMode = BlendMode.difference - ..color = Colors.white, - ), + style: Theme.of(context).textTheme.bodySmall!.copyWith( + foreground: Paint() + ..blendMode = BlendMode.difference + ..color = Colors.white, + ), ), Text( '$counter', - style: Theme.of(context).textTheme.headline2.copyWith( - // Comment on web. - foreground: Paint() - ..blendMode = BlendMode.difference - ..color = Colors.white, - ), + style: Theme.of(context).textTheme.headlineSmall!.copyWith( + // Comment on web. + foreground: Paint() + ..blendMode = BlendMode.difference + ..color = Colors.white, + ), ), ], ), @@ -63,9 +63,9 @@ extension RandomExtension on Random { class Pixels { const Pixels({ - @required this.byteData, - @required this.width, - @required this.height, + required this.byteData, + required this.width, + required this.height, }); final ByteData byteData;