flutter_size 1.0.0 flutter_size: ^1.0.0 copied to clipboard
This package helps the user to get width, height details of device, widgets. This purpose of creating this package is to save time and increase productivity.
import 'package:flutter/material.dart';
import 'package:flutter_size/flutter_size.dart';
class ExampleScreen extends StatefulWidget {
const ExampleScreen({Key? key}) : super(key: key);
@override
State<ExampleScreen> createState() => _ExampleScreenState();
}
class _ExampleScreenState extends State<ExampleScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.green,
width: context.width(0.4),
height: context.height(0.3),
child: const Text("Example"),
),
);
}
}