🧩Container()

// Some code
import 'package:flutter/material.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
    
        body: SafeArea(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
        
          Container(
            height: 150,
            width: 200,
            color: Colors.green,
          ),
          Container(
            height: 150,
            width: 200,
            decoration: BoxDecoration(
              color: Colors.green,
              borderRadius: BorderRadius.circular(30),
            ),
          ),
          Container(
            height: 150,
            width: 200,
            decoration: const BoxDecoration(
                color: Colors.green,
                borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(30),
                    bottomRight: Radius.circular(30),),),
          ),
          Container(
            height: 150,
            width: 200,
            decoration: const BoxDecoration(
                color: Colors.green,
                borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(30),
                    bottomRight: Radius.circular(30))),
  // Чтобы написать внутрь Container Widget(), вам нужен child
  // child принимает любой виджет
            child: const Center(
              child: Text('Hello'),
            ),
          ),
        ],
      ),
    ));
  }
}

Last updated