Line data Source code
1 : import 'package:bootstrap_flutter/bootstrap_flutter.dart'; 2 : import 'package:flutter/material.dart'; 3 : 4 : extension BoxConstraintsExt on BoxConstraints { 5 1 : TypeScreen get getScreenType { 6 2 : if (this.maxWidth < 768) { 7 : return TypeScreen.xs; 8 4 : } else if (this.maxWidth >= 768 && this.maxWidth < 992) { 9 : return TypeScreen.sm; 10 4 : } else if (this.maxWidth >= 992 && this.maxWidth < 1200) { 11 : return TypeScreen.md; 12 2 : } else if (this.maxWidth >= 1200) { 13 : return TypeScreen.lg; 14 : } else { 15 : return TypeScreen.none; 16 : } 17 : } 18 : }