adaptable_screen 0.0.1 adaptable_screen: ^0.0.1 copied to clipboard
This package was created to reduce the need to create a way to leave the exact sizes up to the designer. For that, the Plugin scales the sizes based on an interface size and the windows that the compo [...]
import 'package:adaptable_screen/adaptable_screen.dart';
import 'package:flutter/material.dart';
void main() {
AdaptableScreenUtils.init(
heightUIDisign: 1000,
widthUIDisign: 956,
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(10.r),
),
height: 100.h,
width: 100.w,
child: Center(
child: Text(
"Text Exemplo",
style: TextStyle(fontSize: 15.ssp),
),
),
),
Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10.r),
),
height: 50.h,
width: 100.w,
child: Center(
child: Text(
"Text Exemplo",
style: TextStyle(fontSize: 15.sp),
),
),
),
],
),
),
);
}
}