padding_extra 1.1.3 copy "padding_extra: ^1.1.3" to clipboard
padding_extra: ^1.1.3 copied to clipboard

This package provides extra padding widgets

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:padding_extra/padding_extra.dart';

void main() async {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            PaddingAll(
              24,
              child: _buildRect(context),
            ),
            SafeAreaHorizontal(
              child: Container(
                color: Colors.yellow,
                width: double.infinity,
                height: 100,
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget _buildRect(BuildContext context) {
    return Container(
      width: 100,
      height: 100,
      color: Colors.red,
    );
  }
}
2
likes
140
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

This package provides extra padding widgets

Repository (GitHub)

Topics

#layout #padding #safe-area

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on padding_extra