nested 1.0.0 copy "nested: ^1.0.0" to clipboard
nested: ^1.0.0 copied to clipboard

A Flutter Widget which helps nest multiple widgets without needing to manually nest them.

example/example.dart

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

void main() {
  runApp(
    Nested(
      children: [
        const SingleChildContainer(color: Colors.red),
        SingleChildBuilder(
          builder: (context, child) => Center(child: child),
        ),
      ],
      child: const Text('Hello world', textDirection: TextDirection.ltr),
    ),
  );
}

class SingleChildContainer extends SingleChildStatelessWidget {
  const SingleChildContainer({Key? key, required this.color, Widget? child})
      : super(key: key, child: child);

  final Color color;

  @override
  Widget buildWithChild(BuildContext context, Widget? child) {
    return Container(
      color: color,
      child: child,
    );
  }
}
327
likes
150
points
3.44M
downloads

Publisher

verified publisherdash-overflow.net

Weekly Downloads

A Flutter Widget which helps nest multiple widgets without needing to manually nest them.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on nested