Wednesday, 10 July 2024

flutter grid code

 import 'package:flutter/material.dart';


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

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start, //check by comment
      children: [
        Padding(
          padding: const EdgeInsets.all(30.0),
          child: Text(
            "Men",
            style: TextStyle(
                fontSize: 24, fontWeight: FontWeight.bold, letterSpacing: 1.5),
          ),
        ),
        SizedBox(
          height: MediaQuery.of(context).size.height * 0.68,
          child: GridView.count(
            mainAxisSpacing:70,//c and check
            crossAxisSpacing: 15,//c and check
            crossAxisCount: 3,
            children: List.generate(4, (index) {
              return Container(
                color: Colors.blue,
                height: 70,
                width: 70,
              );
            }),
          ),
        )
      ],
    );
  }
}

No comments:

Post a Comment

7 Common mistakes in Dot Net — You can avoid

  There are many common mistakes made during .NET (ASP.NET, .NET Core) development, which affect performance, security, and code… Code Crack...