mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Refactor CreateSubSpaceDialog to use context extension for screen width calculations
This commit is contained in:
@ -11,6 +11,7 @@ import 'package:syncrow_web/pages/spaces_management/create_subspace/bloc/subspac
|
||||
import 'package:syncrow_web/pages/spaces_management/create_subspace_model/widgets/subspace_chip.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/space_model/models/subspace_template_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
class CreateSubSpaceDialog extends StatelessWidget {
|
||||
final bool isEdit;
|
||||
@ -19,7 +20,7 @@ class CreateSubSpaceDialog extends StatelessWidget {
|
||||
final String? spaceName;
|
||||
final List<Tag>? spaceTags;
|
||||
final List<ProductModel>? products;
|
||||
final Function(List<SubspaceModel>?)? onSave;
|
||||
final void Function(List<SubspaceModel>?)? onSave;
|
||||
|
||||
const CreateSubSpaceDialog(
|
||||
{super.key,
|
||||
@ -33,7 +34,6 @@ class CreateSubSpaceDialog extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
final textController = TextEditingController();
|
||||
|
||||
return Dialog(
|
||||
@ -55,7 +55,7 @@ class CreateSubSpaceDialog extends StatelessWidget {
|
||||
return Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
child: SizedBox(
|
||||
width: screenWidth * 0.35,
|
||||
width: context.screenWidth * 0.35,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
@ -71,7 +71,7 @@ class CreateSubSpaceDialog extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Container(
|
||||
width: screenWidth * 0.35,
|
||||
width: context.screenWidth * 0.35,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10.0, horizontal: 16.0),
|
||||
decoration: BoxDecoration(
|
||||
|
Reference in New Issue
Block a user