bugs solved for create post and login page
This commit is contained in:
@@ -245,11 +245,17 @@ class NetworkApiServices {
|
|||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
e.response!.data['message'][0]!, ResponseStatus.FAILED,
|
e.response!.data['message'][0]!, ResponseStatus.FAILED,
|
||||||
data: e.response!.data);
|
data: e.response!.data);
|
||||||
} else if (e.response!.data['message']['name'] is List) {
|
}
|
||||||
return ResponseData<dynamic>(
|
// else if (e.response!.data['message']
|
||||||
e.response!.data['message']['name'][0]!, ResponseStatus.FAILED,
|
// // ['name'] is List
|
||||||
data: e.response!.data);
|
// ) {
|
||||||
} else {
|
// return ResponseData<dynamic>(
|
||||||
|
// // e.response!.data['message']['name'][0]!, ResponseStatus.FAILED,
|
||||||
|
// e.response!.data['message'], ResponseStatus.FAILED,
|
||||||
|
|
||||||
|
// data: e.response!.data);
|
||||||
|
// }
|
||||||
|
else {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
e.response!.data['message'], ResponseStatus.FAILED,
|
e.response!.data['message'], ResponseStatus.FAILED,
|
||||||
data: e.response!.data);
|
data: e.response!.data);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class LoginAPI {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(RouteName.mainscreen);
|
Get.toNamed(RouteName.mainscreen,arguments: 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:dio/dio.dart';
|
|||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart' hide MultipartFile, FormData;
|
import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||||
|
|
||||||
@@ -194,6 +195,7 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
Map<String, dynamic> updata = {
|
Map<String, dynamic> updata = {
|
||||||
'manage_community_xid': communityid,
|
'manage_community_xid': communityid,
|
||||||
"name": _tagController.text,
|
"name": _tagController.text,
|
||||||
|
"is_special": posttagtype,
|
||||||
};
|
};
|
||||||
final data = await Communitypostmethod().postCreatedTag(updata);
|
final data = await Communitypostmethod().postCreatedTag(updata);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
@@ -231,14 +233,14 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: const Color(0xFF222935).withOpacity(0.9),
|
backgroundColor: const Color(0xFF222935).withOpacity(0.9),
|
||||||
title: const Text(
|
title: const Text(
|
||||||
"Add Tag",
|
"Add Interest",
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
content: TextField(
|
content: TextField(
|
||||||
style: const TextStyle(color: Colors.white),
|
style: const TextStyle(color: Colors.white),
|
||||||
controller: _tagController,
|
controller: _tagController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: "Tag",
|
labelText: "Interest",
|
||||||
labelStyle: TextStyle(color: AppColors.white),
|
labelStyle: TextStyle(color: AppColors.white),
|
||||||
disabledBorder: UnderlineInputBorder(
|
disabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: AppColors.black),
|
borderSide: BorderSide(color: AppColors.black),
|
||||||
@@ -254,14 +256,16 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: const Text("Cancel", style: TextStyle(color: AppColors.white)),
|
child: const Text("Cancel",
|
||||||
|
style: TextStyle(color: AppColors.white)),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
tagUploadata();
|
tagUploadata();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: const Text("Submit", style: TextStyle(color: AppColors.white)),
|
child: const Text("Submit",
|
||||||
|
style: TextStyle(color: AppColors.white)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -642,26 +646,28 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
children: [
|
children: [
|
||||||
buildSelectedTags(),
|
buildSelectedTags(),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
GestureDetector(
|
Expanded(
|
||||||
onTap: () {
|
child: GestureDetector(
|
||||||
_showCreateTagDialog();
|
onTap: () {
|
||||||
},
|
_showCreateTagDialog();
|
||||||
child: Container(
|
},
|
||||||
height: 35,
|
child: Container(
|
||||||
width: 178.w,
|
height: 35,
|
||||||
decoration: BoxDecoration(
|
// width: 185.w,
|
||||||
color: const Color(0xFFFFFFFF)
|
decoration: BoxDecoration(
|
||||||
.withOpacity(0.2),
|
color: const Color(0xFFFFFFFF)
|
||||||
borderRadius: BorderRadius.circular(30),
|
.withOpacity(0.2),
|
||||||
border: Border.all(
|
borderRadius: BorderRadius.circular(30),
|
||||||
color: const Color(0xFFD90B2E),
|
border: Border.all(
|
||||||
width: 1)),
|
color: const Color(0xFFD90B2E),
|
||||||
child: Padding(
|
width: 1)),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: Padding(
|
||||||
horizontal: 20),
|
padding: const EdgeInsets.symmetric(
|
||||||
child: Center(
|
horizontal: 10),
|
||||||
child: text14w400_FCFCFC(
|
child: Center(
|
||||||
'+create new interest')),
|
child: text14w400_FCFCFC(
|
||||||
|
'+create new interest')),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -794,7 +800,8 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
insetPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
insetPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
||||||
contentPadding: const EdgeInsets.fromLTRB(24, 8, 24, 24),
|
contentPadding: const EdgeInsets.fromLTRB(24, 8, 24, 24),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(14.r))),
|
borderRadius: BorderRadius.all(Radius.circular(14.r))),
|
||||||
|
|||||||
Reference in New Issue
Block a user