You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
import 'package:flutter/material.dart';
 | 
						|
 | 
						|
class AppStyle {
 | 
						|
  AppStyle._();
 | 
						|
 | 
						|
  static const double borderRadius = 10;
 | 
						|
 | 
						|
  static const BoxShadow boxShadow = BoxShadow(color: Colors.black26, blurRadius: 3, offset: Offset(0, 2));
 | 
						|
 | 
						|
  static double getBorderRadius(BuildContext context) {
 | 
						|
    return borderRadius * getScaleFactor(context);
 | 
						|
  }
 | 
						|
 | 
						|
  static double getScaleFactor(BuildContext context) {
 | 
						|
    return MediaQuery.of(context).orientation == Orientation.portrait
 | 
						|
        ? MediaQuery.of(context).size.width / (360) > 1.5
 | 
						|
            ? 1.5
 | 
						|
            : MediaQuery.of(context).size.width / (360)
 | 
						|
        : MediaQuery.of(context).size.height / (360) > 1.5
 | 
						|
            ? 1.5
 | 
						|
            : MediaQuery.of(context).size.height / (360);
 | 
						|
  }
 | 
						|
 | 
						|
  static BorderRadius getCardBorder(BuildContext context) {
 | 
						|
    return BorderRadius.only(
 | 
						|
      topRight: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
 | 
						|
      topLeft: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
 | 
						|
      bottomRight: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |