Implemented home management and user invitation flows

This commit is contained in:
Abdullah Alassaf
2024-06-05 03:42:00 +03:00
parent 6a9c2967d2
commit 631ba53d7a
29 changed files with 968 additions and 288 deletions

View File

@ -1,11 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/menu/view/widgets/manage_home/room_screen.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/helpers/custom_page_route.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class HomeSettingsView extends StatelessWidget {
@ -38,8 +42,7 @@ class HomeSettingsView extends StatelessWidget {
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Enter Name',
hintStyle:
context.bodyMedium.copyWith(color: Colors.grey),
hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
@ -52,16 +55,27 @@ class HomeSettingsView extends StatelessWidget {
height: 1,
color: ColorsManager.greyColor,
),
const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(text: 'Rooms'),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
Container(
width: MediaQuery.sizeOf(context).width,
child: GestureDetector(
onTap: () {
Navigator.of(context).push(CustomPageRoute(
builder: (context) => RoomsView(
unitId: space?.id ?? '',
)));
},
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(text: 'Rooms'),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
),
),
//Divider
Container(
@ -78,14 +92,39 @@ class HomeSettingsView extends StatelessWidget {
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Set',
hintStyle:
context.bodyMedium.copyWith(color: Colors.grey),
hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
//Divider
Container(
margin: const EdgeInsets.only(bottom: 10),
height: 1,
color: ColorsManager.greyColor,
),
Container(
width: MediaQuery.sizeOf(context).width,
padding: const EdgeInsets.only(bottom: 10),
child: GestureDetector(
onTap: () async {
await HomeCubit.getInstance().generateInvitation(space?.id ?? '');
},
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(text: 'Invite a member'),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
),
),
],
),
),
@ -104,14 +143,13 @@ class HomeSettingsView extends StatelessWidget {
crossAxisCount: 2,
crossAxisSpacing: 10,
),
itemCount: 4,
itemCount: 2,
itemBuilder: (context, index) => Stack(
alignment: Alignment.topCenter,
children: [
DefaultContainer(
margin: const EdgeInsets.only(top: 20),
padding:
const EdgeInsets.symmetric(vertical: 15, horizontal: 40),
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 40),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [