pretty_widgets 1.0.0
pretty_widgets: ^1.0.0 copied to clipboard
Simplify your Flutter code, reduce boilerplate with ease.
import 'package:flutter/material.dart';
import 'package:pretty_widgets/pretty_widgets.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Pretty Widgets'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Long hierarchy and lots of boilerplate
const Padding(
padding: EdgeInsets.all(16.0),
child: Center(
child: Text(
'Hello World',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
),
// Much cleaner way to write the same thing
const Text('Hello World').bold().size(24).center().paddingAll(16),
],
),
),
);
}
}