mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Refactor CreateSubSpaceDialog
to improve widget structure and readability
This commit is contained in:
@ -37,20 +37,20 @@ class CreateSubSpaceDialog extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final textController = TextEditingController();
|
final textController = TextEditingController();
|
||||||
|
|
||||||
return Dialog(
|
return BlocProvider(
|
||||||
shape: RoundedRectangleBorder(
|
create: (_) {
|
||||||
borderRadius: BorderRadius.circular(20),
|
final bloc = SubSpaceBloc();
|
||||||
),
|
if (existingSubSpaces != null) {
|
||||||
child: BlocProvider(
|
for (final subSpace in existingSubSpaces ?? []) {
|
||||||
create: (_) {
|
bloc.add(AddSubSpace(subSpace));
|
||||||
final bloc = SubSpaceBloc();
|
|
||||||
if (existingSubSpaces != null) {
|
|
||||||
for (final subSpace in existingSubSpaces ?? []) {
|
|
||||||
bloc.add(AddSubSpace(subSpace));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return bloc;
|
}
|
||||||
},
|
return bloc;
|
||||||
|
},
|
||||||
|
child: Dialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
child: BlocBuilder<SubSpaceBloc, SubSpaceState>(
|
child: BlocBuilder<SubSpaceBloc, SubSpaceState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Container(
|
return Container(
|
||||||
|
Reference in New Issue
Block a user