diff --git a/lib/components/_category.dart b/lib/components/_category.dart deleted file mode 100644 index a218572..0000000 --- a/lib/components/_category.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/cupertino.dart'; - -class Category { - final String icon, title; - - Category({required this.icon, required this.title}); -} - -List demoCategories = [ - Category( - icon: "assets/icons/dress.svg", - title: "Dress", - ), - Category( - icon: "assets/icons/shirt.svg", - title: "Shirt", - ), - Category( - icon: "assets/icons/pants.svg", - title: "Pants", - ), - Category( - icon: "assets/icons/Tshirt.svg", - title: "Tshirt", - ), -]; diff --git a/lib/components/categories.dart b/lib/components/categories.dart deleted file mode 100644 index e570b9c..0000000 --- a/lib/components/categories.dart +++ /dev/null @@ -1,70 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:nekoya_flutter/components/_category.dart'; - -import '../utils/utils.dart'; - -class Categories extends StatelessWidget { - const Categories({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return SizedBox( - height: 84, - child: ListView.separated( - scrollDirection: Axis.horizontal, - itemCount: demoCategories.length, - itemBuilder: (context, index) => CategoryCard( - icon: demoCategories[index].icon, - title: demoCategories[index].title, - press: () {}, - ), - separatorBuilder: (context, index) => - const SizedBox(width: defaultPadding), - ), - ); - } -} - -class CategoryCard extends StatelessWidget { - const CategoryCard({ - Key? key, - required this.icon, - required this.title, - required this.press, - }) : super(key: key); - - final String icon, title; - final VoidCallback press; - - @override - Widget build(BuildContext context) { - return OutlinedButton( - onPressed: press, - style: OutlinedButton.styleFrom( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(defaultBorderRadius)), - ), - ), - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: defaultPadding / 2, horizontal: defaultPadding / 4), - child: Column( - children: [ - SvgPicture.asset(icon), - const SizedBox(height: defaultPadding / 2), - Text( - title, - style: TextStyle( - color: Colors.white, - backgroundColor: const Color(0xff212226), - ), - ) - ], - ), - ), - ); - } -}