smart_space 0.1.0 copy "smart_space: ^0.1.0" to clipboard
smart_space: ^0.1.0 copied to clipboard

outdated

Ensures a consistent visual rhythm across each screen.

example/lib/main.dart

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

void main() {
  // define the spacing base
  kSpace = 24; // default: 8.0
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'SmartSpace Example',
      home: Example(),
    );
  }
}

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

  Widget get square => Container(
        height: kSpace,
        width: kSpace,
        color: Colors.black,
      );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.red,
      body: SafeArea(
        child: Container(
          margin: EdgeInsets.all(kSpace * 2),
          padding: EdgeInsets.all(kSpace),
          color: Colors.white,
          child: Column(
            children: [
              Row(children: [square, Space(), square]),
              Space(2),
              Expanded(
                child: ListView.separated(
                  itemCount: 2,
                  separatorBuilder: (_, __) => Space(),
                  itemBuilder: (_, __) => square,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Ensures a consistent visual rhythm across each screen.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on smart_space