chat list ui added.
parent
22a667a7b3
commit
18a53d7518
@ -0,0 +1,3 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.9948 1.66669C17.3938 1.66669 18.4958 2.7234 19.1994 4.14924L21.5488 8.8869C21.62 9.03352 21.7889 9.24 22.0428 9.42887C22.2964 9.61755 22.5447 9.72164 22.7081 9.74909L26.961 10.4615C28.4972 10.7197 29.7847 11.4727 30.2028 12.7839C30.6204 14.094 30.0085 15.4555 28.9038 16.5622L28.9027 16.5633L25.5988 19.8945C25.4679 20.0265 25.3212 20.2753 25.2292 20.5993C25.1378 20.9211 25.1297 21.2143 25.1711 21.4037L25.1717 21.4063L26.117 25.5272C26.509 27.2424 26.3791 28.9431 25.1694 29.8323C23.9556 30.7245 22.2969 30.329 20.79 29.4315L16.8034 27.052C16.636 26.952 16.3485 26.871 16.0015 26.871C15.657 26.871 15.3634 26.9509 15.1851 27.0547L15.1826 27.0561L11.2038 29.431C9.69873 30.3316 8.04205 30.72 6.82814 29.827C5.61932 28.9376 5.48286 27.2401 5.87615 25.5263L6.8212 21.4063L6.82178 21.4037C6.86321 21.2143 6.8551 20.9211 6.76373 20.5993C6.67174 20.2753 6.52505 20.0265 6.3941 19.8945L3.0878 16.5609C1.9902 15.4542 1.38028 14.0939 1.7946 12.7857C2.21013 11.4737 3.49524 10.7198 5.03244 10.4614L9.28176 9.74961L9.28311 9.74938C9.43889 9.72235 9.68361 9.61943 9.93664 9.43027C10.1901 9.24074 10.3595 9.03383 10.4308 8.8869L10.4344 8.87958L12.7808 4.14798L12.7818 4.14612C13.4919 2.72146 14.5974 1.66669 15.9948 1.66669Z" fill="#7D859A"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.9948 1.66669C17.3938 1.66669 18.4958 2.7234 19.1994 4.14924L21.5488 8.8869C21.62 9.03352 21.7889 9.24 22.0428 9.42887C22.2964 9.61755 22.5447 9.72164 22.7081 9.74909L26.961 10.4615C28.4972 10.7197 29.7847 11.4727 30.2028 12.7839C30.6204 14.094 30.0085 15.4555 28.9038 16.5622L28.9027 16.5633L25.5988 19.8945C25.4679 20.0265 25.3212 20.2753 25.2292 20.5993C25.1378 20.9211 25.1297 21.2143 25.1711 21.4037L25.1717 21.4063L26.117 25.5272C26.509 27.2424 26.3791 28.9431 25.1694 29.8323C23.9556 30.7245 22.2969 30.329 20.79 29.4315L16.8034 27.052C16.636 26.952 16.3485 26.871 16.0015 26.871C15.657 26.871 15.3634 26.9509 15.1851 27.0547L15.1826 27.0561L11.2038 29.431C9.69873 30.3316 8.04205 30.72 6.82814 29.827C5.61932 28.9376 5.48286 27.2401 5.87615 25.5263L6.8212 21.4063L6.82178 21.4037C6.86321 21.2143 6.8551 20.9211 6.76373 20.5993C6.67174 20.2753 6.52505 20.0265 6.3941 19.8945L3.0878 16.5609C1.9902 15.4542 1.38028 14.0939 1.7946 12.7857C2.21013 11.4737 3.49524 10.7198 5.03244 10.4614L9.28176 9.74961L9.28311 9.74938C9.43889 9.72235 9.68361 9.61943 9.93664 9.43027C10.1901 9.24074 10.3595 9.03383 10.4308 8.8869L10.4344 8.87958L12.7808 4.14798L12.7818 4.14612C13.4919 2.72146 14.5974 1.66669 15.9948 1.66669Z" fill="#FFB522"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
||||
|
||||
class ChatPage extends StatefulWidget {
|
||||
ChatPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ChatPageState createState() {
|
||||
return _ChatPageState();
|
||||
}
|
||||
}
|
||||
|
||||
class _ChatPageState extends State<ChatPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const DefaultAppBar(title: "Req No. 343443"),
|
||||
body: Column(
|
||||
children: [
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/extensions/context_extension.dart';
|
||||
import 'package:test_sa/extensions/int_extensions.dart';
|
||||
import 'package:test_sa/extensions/text_extensions.dart';
|
||||
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||
import 'package:test_sa/modules/cx_module/chat/chat_page.dart';
|
||||
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
||||
|
||||
class ChatRoomsPage extends StatefulWidget {
|
||||
ChatRoomsPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ChatPageState createState() {
|
||||
return _ChatPageState();
|
||||
}
|
||||
}
|
||||
|
||||
class _ChatPageState extends State<ChatRoomsPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const DefaultAppBar(title: "Chats"),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (cxt, index) => Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Request No. : 432212",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50, fontWeight: FontWeight.w600),
|
||||
),
|
||||
Text(
|
||||
"Request No. : 432212",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
||||
),
|
||||
],
|
||||
).expanded,
|
||||
getStatus(),
|
||||
8.width,
|
||||
const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 12,
|
||||
color: AppColor.black20,
|
||||
),
|
||||
],
|
||||
).paddingOnly(top: 4, bottom: 4).onPress(() {
|
||||
Navigator.push(context, CupertinoPageRoute(builder: (context) => ChatPage()));
|
||||
return;
|
||||
}),
|
||||
separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
|
||||
itemCount: 10)
|
||||
.toShadowContainer(context, borderRadius: 20, showShadow: false, padding: 12)));
|
||||
}
|
||||
|
||||
Widget getStatus() {
|
||||
Color color = const Color(0xff3B755C);
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xff62BE96).withOpacity(.6),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
"In Progress",
|
||||
maxLines: 1,
|
||||
style: AppTextStyles.tinyFont2.copyWith(color: color),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:test_sa/extensions/context_extension.dart';
|
||||
import 'package:test_sa/extensions/int_extensions.dart';
|
||||
import 'package:test_sa/extensions/string_extensions.dart';
|
||||
import 'package:test_sa/extensions/text_extensions.dart';
|
||||
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
|
||||
import 'package:test_sa/modules/cx_module/chat/chat_rooms_page.dart';
|
||||
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
||||
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
||||
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
||||
|
||||
class SurveyPage extends StatefulWidget {
|
||||
SurveyPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SurveyPageState createState() {
|
||||
return _SurveyPageState();
|
||||
}
|
||||
}
|
||||
|
||||
class _SurveyPageState extends State<SurveyPage> {
|
||||
int serviceSatisfiedRating = -1;
|
||||
int serviceProvidedRating = -1;
|
||||
String comments = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const DefaultAppBar(title: "Survey"),
|
||||
body: Column(
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"How satisfied are you with our services?",
|
||||
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
||||
),
|
||||
12.height,
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: ListView.separated(
|
||||
itemBuilder: (cxt, index) => (serviceSatisfiedRating >= index ? 'star_filled'.toSvgAsset() : 'star_empty'.toSvgAsset()).onPress(() {
|
||||
setState(() {
|
||||
serviceSatisfiedRating = index;
|
||||
});
|
||||
}),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (cxt, index) => 8.width,
|
||||
itemCount: 5,
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
),
|
||||
16.height,
|
||||
Text(
|
||||
"Was the service provided promptly by our engineer?",
|
||||
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
||||
),
|
||||
12.height,
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: ListView.separated(
|
||||
itemBuilder: (cxt, index) => (serviceProvidedRating >= index ? 'star_filled'.toSvgAsset() : 'star_empty'.toSvgAsset()).onPress(() {
|
||||
setState(() {
|
||||
serviceProvidedRating = index;
|
||||
});
|
||||
}),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (cxt, index) => 8.width,
|
||||
itemCount: 5,
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
),
|
||||
16.height,
|
||||
Text(
|
||||
"Request Type",
|
||||
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
||||
),
|
||||
16.height,
|
||||
AppTextFormField(
|
||||
initialValue: "",
|
||||
textInputType: TextInputType.multiline,
|
||||
alignLabelWithHint: true,
|
||||
labelText: "Additional Comments",
|
||||
backgroundColor: AppColor.fieldBgColor(context),
|
||||
style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
|
||||
labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)),
|
||||
floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
|
||||
showShadow: false,
|
||||
onChange: (value) {
|
||||
comments = value;
|
||||
},
|
||||
),
|
||||
],
|
||||
).toShadowContainer(context, borderRadius: 20, showShadow: false))
|
||||
.expanded,
|
||||
FooterActionButton.footerContainer(
|
||||
context: context,
|
||||
child: AppFilledButton(
|
||||
label: context.translation.submit,
|
||||
buttonColor: AppColor.primary10,
|
||||
onPressed: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => ChatRoomsPage()));
|
||||
return;
|
||||
if (serviceSatisfiedRating < 0) {
|
||||
"Provide rate services satisfaction".showToast;
|
||||
return;
|
||||
}
|
||||
if (serviceProvidedRating < 0) {
|
||||
"Provide rate services provided by engineer".showToast;
|
||||
return;
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue