poupee 0.0.7 copy "poupee: ^0.0.7" to clipboard
poupee: ^0.0.7 copied to clipboard

Layout package

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Vertical(
          margin: const EdgeInsets.only(top: 5),
          parameters: const AutoFlexParameters(
            //mainAxisSize: MainAxisSize.min,
            space: 20,
            width: Length.between(100, 800),
            boxAlignment: Alignment.center,
            //fractionWidth: 0.8,
            //fractionHeight: 2 / 3,
          ),
          elementsParameters: ElementParameters(
            decoration:
                BoxDecoration(color: Colors.blueAccent, border: Border.all()),
            decorationByKey: (p0) {
              if (p0.toString().contains("Even")) {
                return const BoxDecoration(color: Colors.amber);
              }
              return null;
            },
            margin: const EdgeInsets.only(left: 10),
            marginByKey: (p0) {
              if (p0.toString().contains("Even")) {
                return const EdgeInsets.only(left: 0);
              }
              return null;
            },
            paddingByKey: (p0) {
              if (p0.toString().contains("Even")) {
                return const EdgeInsets.only(top: 20);
              }
              return null;
            },
            alignment: Alignment.topLeft,
            alignmentByKey: (p0) {
              if (p0.toString().contains("Even")) {
                return Alignment.topRight;
              }
              return null;
            },
            flexByKey: (p0) {
              if (p0.toString().contains("Even")) {
                return 2;
              }
              return null;
            },
            //width: const Length.fixedLength(800),
          ),
          children: [
            for (int i in List.generate(10, (i) => i))
              Container(
                key: (i % 2 == 1) ? Key("Even $i") : null,
              )
          ],
        ),
      ),
    );
  }
}
0
likes
125
points
52
downloads

Publisher

unverified uploader

Weekly Downloads

Layout package

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on poupee