
import 'package:e_commerce_training/res/R.dart';
import 'package:e_commerce_training/src/model/repository/app_repository.dart';
import 'package:e_commerce_training/src/page/row_detail_category/row_detail_category_cubit.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:easy_localization/easy_localization.dart';


class RowDetailCategory extends StatefulWidget {
  const RowDetailCategory({Key? key}) : super(key: key);

  @override
  _RowDetailCategoryState createState() => _RowDetailCategoryState();
}

class _RowDetailCategoryState extends State<RowDetailCategory> {
  late RowDetailCategoryCubit _cubit;

  @override
  void initState() {
    // TODO: implement initState
    AppRepository repository = AppRepository();
    _cubit = RowDetailCategoryCubit(repository);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (BuildContext context) => _cubit,
      child: BlocBuilder<RowDetailCategoryCubit, RowDetailCategoryState>(
        builder: (BuildContext context, state) {
          return Container(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Row(
              children: [
                Text(
                  R.string.latest.tr(),
                  style: TextStyle(fontSize: 16.sp, color: R.color.black),
                ),
                SizedBox(
                  width: 10,
                ),
                Container(
                  color: R.color.grey,
                  width: 2.w,
                  height: 80.h,
                ),
                SizedBox(
                  width: 10,
                ),
                Expanded(
                  child: Text(
                    R.string.fast_selling.tr(),
                    style: TextStyle(fontSize: 16.sp, color: R.color.black),
                  ),
                ),
                Text(
                  R.string.price.tr(),
                  style: TextStyle(fontSize: 16.sp, color: R.color.black),
                ),
                Icon(
                  Icons.arrow_upward_outlined,
                  size: 60.h,
                ),
                SizedBox(
                  width: 10,
                ),
                Container(
                  color: R.color.grey,
                  width: 2.w,
                  height: 130.h,
                ),
                SizedBox(
                  width: 10,
                ),
                Icon(
                  MdiIcons.filterOutline,
                  size: 55.h,
                ),
                Text(
                  R.string.filter.tr(),
                  style: TextStyle(fontSize: 16.sp, color: R.color.black),
                ),
              ],
            ),
          );
        },
      ),
    );
  }
}
