fix(ui_kit): remove null check operator in Loader component
This commit is contained in:
		
							parent
							
								
									f2b8c03dd7
								
							
						
					
					
						commit
						702164082a
					
				@ -23,7 +23,7 @@ import 'package:wyatt_ui_kit_example/theme/constants.dart';
 | 
			
		||||
 | 
			
		||||
class Loaders extends DemoPage {
 | 
			
		||||
  const Loaders({super.key});
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String get title => 'Loaders';
 | 
			
		||||
 | 
			
		||||
@ -64,5 +64,4 @@ class Loaders extends DemoPage {
 | 
			
		||||
          const Gap(20),
 | 
			
		||||
        ],
 | 
			
		||||
      );
 | 
			
		||||
      
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -59,15 +59,14 @@ class Loader extends LoaderComponent with $LoaderCWMixin {
 | 
			
		||||
    final style = _resolve(context);
 | 
			
		||||
    final dimension =
 | 
			
		||||
        (radius != null) ? radius! * 2 : context.buttonTheme.height;
 | 
			
		||||
 | 
			
		||||
    return SizedBox.square(
 | 
			
		||||
      dimension: dimension,
 | 
			
		||||
      child: RepaintBoundary(
 | 
			
		||||
        child: CustomPaint(
 | 
			
		||||
          painter: _LoaderPainter(
 | 
			
		||||
            style.colors!,
 | 
			
		||||
            style.colors ?? const MultiColor([]),
 | 
			
		||||
            dimension / 2,
 | 
			
		||||
            style.stroke!,
 | 
			
		||||
            style.stroke ?? 4,
 | 
			
		||||
            flip: flip ?? false,
 | 
			
		||||
          ),
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
@ -24,6 +24,12 @@ class LoaderThemeResolver
 | 
			
		||||
    required this.customStyleFn,
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  final LoaderStyle? Function(
 | 
			
		||||
    BuildContext context, {
 | 
			
		||||
    void extra,
 | 
			
		||||
  }) customStyleFn;
 | 
			
		||||
 | 
			
		||||
  /// Values taken from <https://api.flutter.dev/flutter/material/ElevatedButton/defaultStyleOf.html>
 | 
			
		||||
  @override
 | 
			
		||||
  LoaderStyle computeDefaultValue(
 | 
			
		||||
@ -39,12 +45,6 @@ class LoaderThemeResolver
 | 
			
		||||
        stroke: 4,
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  final LoaderStyle? Function(
 | 
			
		||||
    BuildContext context, {
 | 
			
		||||
    void extra,
 | 
			
		||||
  }) customStyleFn;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  LoaderStyle? computeExtensionValueFn(
 | 
			
		||||
    BuildContext context,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user