part of 'itemspage.dart'; class ItemsDetails extends StatelessWidget { const ItemsDetails({super.key}); @override Widget build(final BuildContext context) => BrandBottomSheet( child: BlocProvider( create: (final BuildContext context) => ItemFormCubit( cubit: context.read(), ), child: Builder( builder: (final BuildContext context) => BlocListener( listener: (final BuildContext context, final FormCubitState state) { if (state.isSubmitted) { Navigator.pop(context); } }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ AppBar( title: const Padding( padding: EdgeInsets.only(top: 4.0), child: Text('Новый товар!'), ), ), const SizedBox(width: 14), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Column( mainAxisSize: MainAxisSize.min, children: [ const SizedBox(width: 14), IntrinsicHeight( child: CubitFormTextField( formFieldCubit: context.read().title, decoration: const InputDecoration( labelText: 'Название', ), ), ), const SizedBox(height: 20), CubitFormTextField( formFieldCubit: context.read().description, decoration: const InputDecoration( alignLabelWithHint: false, labelText: 'Описание', ), ), const SizedBox(height: 20), CubitFormIntField( formFieldCubit: context.read().price, decoration: const InputDecoration( alignLabelWithHint: false, labelText: 'Цена', ), ), const SizedBox(height: 20), CubitFormIntField( formFieldCubit: context.read().quantity, decoration: const InputDecoration( alignLabelWithHint: false, labelText: 'Количество', ), ), const SizedBox(height: 30), FilledButton( onPressed: () => context.read().trySubmit(), title: 'Создать', ), const SizedBox(height: 40), ], ), ), ], ), ), ), ), ); }