import ‘../compenents/drawer.dart’;
import ‘../constants.dart’;
import ‘package:get/get.dart’;
class homeScreen extends StatelessWidget {
homeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final categoryController = Get.put(CategoryController());
return Scaffold(
backgroundColor: Constants().scaffoldBackgroundColor,
appBar: appBar(
"App", Colors.black, true, Colors.transparent, context),
drawer: customDrawer(),
drawerEnableOpenDragGesture: false,
body: SingleChildScrollView(
padding: Constants().scaffoldPadding,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: const EdgeInsets.only(top: 15, bottom: 15),
child: Text(
'categories'.tr,
style: GoogleFonts.josefinSans(
fontSize: Constants().widgetTitleFontSize),
),
),
Obx(() => ListView.builder(
shrinkWrap: true,
itemCount: categoryController.categoryList.length,
itemBuilder: ((context, index) {
return categoryCard(
title: categoryController.categoryList[index].title
.toString(),
subTitle: categoryController
.categoryList[index].subtitle
.toString(),
cover: categoryController.categoryList[index].cover
.toString());
}),
)),
],
),
),
);
}
}