213 lines
10 KiB
Dart
213 lines
10 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:regroup/Common/CommonButton.dart';
|
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
|
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
|
import 'package:regroup/Utils/texts.dart';
|
|
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
|
|
|
class EditSubgroupInfo extends StatefulWidget {
|
|
const EditSubgroupInfo({super.key});
|
|
|
|
@override
|
|
State<EditSubgroupInfo> createState() => _EditSubgroupInfoState();
|
|
}
|
|
|
|
class _EditSubgroupInfoState extends State<EditSubgroupInfo> {
|
|
List<File?> filePath = [];
|
|
bool? isImageAdded = false;
|
|
List<File?> bannerPath = [];
|
|
bool isbannerAdded = false;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
// key: _scaffoldKey1,
|
|
backgroundColor: Color(0xFF222935),
|
|
extendBody: true,
|
|
|
|
appBar: CommonAppbar(
|
|
titleTxt: "Edit subgroup info",
|
|
),
|
|
body: Stack(children: [
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
|
), Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Center(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
sizedBoxHeight(30.h),
|
|
Stack(
|
|
children: [
|
|
filePath.isNotEmpty
|
|
? ClipOval(
|
|
child: SizedBox.fromSize(
|
|
size: Size.fromRadius(50.r),
|
|
child: Image.file(
|
|
filePath[0]!,
|
|
fit: BoxFit.cover,
|
|
width: double.infinity,
|
|
),
|
|
),
|
|
)
|
|
: CircleAvatar(
|
|
backgroundImage: AssetImage(
|
|
"assets/images/png/cimg3.png",
|
|
),
|
|
radius: 50.r,
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
right: 0,
|
|
child: InkWell(
|
|
onTap: () {
|
|
ImageUploadBottomSheet().showModal(
|
|
context,
|
|
true,
|
|
(result) {
|
|
var file = File(result);
|
|
|
|
filePath.add(file);
|
|
isImageAdded = true;
|
|
setState(() {});
|
|
},
|
|
);
|
|
},
|
|
child: Container(
|
|
height: 35.h,
|
|
width: 35.w,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Color(0xFFD90B2E)),
|
|
child: Center(
|
|
child: Image.asset(
|
|
"assets/images/png/cameraicon2.png",
|
|
height: 19.h,
|
|
width: 19.w,
|
|
),
|
|
),
|
|
),
|
|
))
|
|
],
|
|
),
|
|
sizedBoxHeight(20.h),
|
|
text16400white("Edit profile picture"),
|
|
sizedBoxHeight(20.h),
|
|
]),
|
|
),
|
|
text16w400_FCFCFC("Event banner image"),
|
|
sizedBoxHeight(20.h),
|
|
GestureDetector(
|
|
onTap: () {
|
|
ImageUploadBottomSheet().showModal(
|
|
context,
|
|
false,
|
|
(result) {
|
|
var file = File(result);
|
|
|
|
bannerPath.add(file);
|
|
isbannerAdded = true;
|
|
setState(() {});
|
|
},
|
|
);
|
|
},
|
|
child: commonGlassContainer(
|
|
border: 0.9,
|
|
width: double.infinity,
|
|
height: 150.h,
|
|
borderradius: 10.r,
|
|
customWidget: bannerPath.isNotEmpty && isbannerAdded
|
|
? Stack(children: [
|
|
Image.file(
|
|
bannerPath[0]!,
|
|
fit: BoxFit.cover,
|
|
width: double.infinity,
|
|
),
|
|
Positioned(
|
|
right: 5,
|
|
bottom: 5,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
bannerPath.clear();
|
|
isbannerAdded = false;
|
|
setState(() {});
|
|
},
|
|
child: Container(
|
|
width: 27,
|
|
height: 27,
|
|
decoration: ShapeDecoration(
|
|
color: Color(0xFF7E7E7E),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius:
|
|
BorderRadius.circular(
|
|
5)),
|
|
),
|
|
child: Icon(
|
|
Icons.delete_outline_outlined,
|
|
color: Colors.white,
|
|
))),
|
|
),
|
|
])
|
|
: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(vertical: 16.h),
|
|
child: Column(
|
|
children: [
|
|
Image.asset(
|
|
"assets/images/png/onlycamera.png",
|
|
height: 36.h,
|
|
width: 36.w,
|
|
),
|
|
sizedBoxHeight(10.h),
|
|
text14w400white("Upload event image"),
|
|
sizedBoxHeight(12.h),
|
|
SizedBox(
|
|
width: 192.w,
|
|
child: text8w400_8A8A8A(
|
|
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
sizedBoxHeight(20.h),
|
|
text16w400_FCFCFC("Group title"),
|
|
sizedBoxHeight(20.h),
|
|
CustomTextFormField(
|
|
hintText: "Iron titans fitness crew"),
|
|
sizedBoxHeight(20.h),
|
|
text16w400_FCFCFC("Group description"),
|
|
sizedBoxHeight(15.h),
|
|
CustomTextFormField2(
|
|
maxlines: 3,
|
|
hintText:
|
|
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer .",
|
|
),
|
|
sizedBoxHeight(20.h),
|
|
text16w400_FCFCFC("Location"),
|
|
CustomTextFormField(
|
|
hintText: "Elm street london, United Kingdom"),
|
|
sizedBoxHeight(40.h),
|
|
CommonBtn(text: "Save changes"),
|
|
sizedBoxHeight(40.h),
|
|
],
|
|
),
|
|
))
|
|
]));
|
|
}
|
|
}
|