mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
add blank space
This commit is contained in:
@ -0,0 +1,73 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_event.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/widgets/dialogs/create_community_dialog.dart';
|
||||||
|
import 'package:syncrow_web/utils/color_manager.dart';
|
||||||
|
|
||||||
|
class BlankCommunityWidget extends StatelessWidget {
|
||||||
|
const BlankCommunityWidget({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: ColorsManager.whiteColors, // Parent container with white background
|
||||||
|
child: GridView.builder(
|
||||||
|
padding: const EdgeInsets.only(left: 40.0, top: 20.0),
|
||||||
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
|
maxCrossAxisExtent: 400, // Each item's width will be 400 or less
|
||||||
|
mainAxisSpacing: 10, // Spacing between items
|
||||||
|
crossAxisSpacing: 10, // Spacing between items
|
||||||
|
childAspectRatio: 2.0, // Aspect ratio for width:height (e.g., 300:150 = 2.0)
|
||||||
|
),
|
||||||
|
itemCount: 1, // Only one item
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () => _showCreateCommunityDialog(context),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, // Center align the content
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 400, // Explicitly set item width
|
||||||
|
height: 150, // Item height
|
||||||
|
decoration: ShapeDecoration(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
side: BorderSide(
|
||||||
|
width: 4,
|
||||||
|
strokeAlign: BorderSide.strokeAlignOutside,
|
||||||
|
color: ColorsManager.borderColor,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 9), // Space between item and text
|
||||||
|
Text('Blank', // Text below the item
|
||||||
|
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||||
|
color: ColorsManager.blackColor,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _showCreateCommunityDialog(BuildContext parentContext) {
|
||||||
|
showDialog(
|
||||||
|
context: parentContext,
|
||||||
|
builder: (context) => CreateCommunityDialog(
|
||||||
|
onCreateCommunity: (String communityName, String description) {
|
||||||
|
parentContext.read<SpaceManagementBloc>().add(
|
||||||
|
CreateCommunityEvent(
|
||||||
|
name: communityName,
|
||||||
|
description: description,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,7 @@ import 'package:syncrow_web/pages/spaces_management/model/selected_product_model
|
|||||||
import 'package:syncrow_web/pages/spaces_management/model/space_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/model/space_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/model/connection_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/model/connection_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/widgets/blank_community_widget.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/widgets/community_stricture_header_widget.dart';
|
import 'package:syncrow_web/pages/spaces_management/widgets/community_stricture_header_widget.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/widgets/dialogs/create_space_dialog.dart';
|
import 'package:syncrow_web/pages/spaces_management/widgets/dialogs/create_space_dialog.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/widgets/curved_line_painter.dart';
|
import 'package:syncrow_web/pages/spaces_management/widgets/curved_line_painter.dart';
|
||||||
@ -92,6 +93,10 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (widget.selectedCommunity == null) {
|
||||||
|
return BlankCommunityWidget();
|
||||||
|
}
|
||||||
|
|
||||||
Size screenSize = MediaQuery.of(context).size;
|
Size screenSize = MediaQuery.of(context).size;
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
@ -15,14 +15,14 @@ class LoadedSpaceView extends StatefulWidget {
|
|||||||
final List<ProductModel>? products;
|
final List<ProductModel>? products;
|
||||||
|
|
||||||
const LoadedSpaceView({
|
const LoadedSpaceView({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.communities,
|
required this.communities,
|
||||||
this.selectedCommunity,
|
this.selectedCommunity,
|
||||||
this.selectedSpace,
|
this.selectedSpace,
|
||||||
required this.onCommunitySelected,
|
required this.onCommunitySelected,
|
||||||
required this.onSpaceSelected,
|
required this.onSpaceSelected,
|
||||||
this.products,
|
this.products,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_LoadedStateViewState createState() => _LoadedStateViewState();
|
_LoadedStateViewState createState() => _LoadedStateViewState();
|
||||||
|
18
lib/utils/constants/space_icon_const.dart
Normal file
18
lib/utils/constants/space_icon_const.dart
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||||
|
|
||||||
|
const List<String> spaceIconList = [
|
||||||
|
Assets.location,
|
||||||
|
Assets.villa,
|
||||||
|
Assets.gym,
|
||||||
|
Assets.sauna,
|
||||||
|
Assets.bbq,
|
||||||
|
Assets.building,
|
||||||
|
Assets.desk,
|
||||||
|
Assets.door,
|
||||||
|
Assets.parking,
|
||||||
|
Assets.pool,
|
||||||
|
Assets.stair,
|
||||||
|
Assets.steamRoom,
|
||||||
|
Assets.street,
|
||||||
|
Assets.unit,
|
||||||
|
];
|
Reference in New Issue
Block a user