flutter_size 0.0.3 flutter_size: ^0.0.3 copied to clipboard
You can add and get custom size,orientation of any type of widgets. In size, you can add and get width,height of the device and widgets and You also get the full height and width of particular devices [...]
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: Center(
child: SizedBox(
width: context.width(0.4),
height: context.height(0.3),
child: const Text("Example"),
),
),
);
}
}