added survey screen

merge-requests/1/merge
Fatimah Alshammari 3 years ago
parent 442f6d8180
commit 07d4aadc4e

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32.742" height="32.742" viewBox="0 0 32.742 32.742">
<path id="Path_4587" data-name="Path 4587" d="M16.371,0A16.371,16.371,0,1,0,32.742,16.371,16.39,16.39,0,0,0,16.371,0ZM8.186,12.278a2.046,2.046,0,1,1,2.046,2.046A2.05,2.05,0,0,1,8.186,12.278Zm15.42,12.63a1.028,1.028,0,0,1-1.449,0,8.379,8.379,0,0,0-11.576,0,1.023,1.023,0,0,1-1.447-1.447,10.232,10.232,0,0,1,14.472,0A1.024,1.024,0,0,1,23.605,24.909ZM22.51,14.325a2.046,2.046,0,1,1,2.046-2.046A2.05,2.05,0,0,1,22.51,14.325Z" fill="#d56e6d"/>
</svg>

After

Width:  |  Height:  |  Size: 548 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32.742" height="32.742" viewBox="0 0 32.742 32.742">
<path id="Path_4589" data-name="Path 4589" d="M16.371,0A16.371,16.371,0,1,0,32.742,16.371,16.39,16.39,0,0,0,16.371,0ZM7.162,12.278a3.07,3.07,0,1,1,3.07,3.07A3.073,3.073,0,0,1,7.162,12.278ZM23.6,23.6a10.229,10.229,0,0,1-14.47,0,1.023,1.023,0,1,1,1.447-1.447,8.379,8.379,0,0,0,11.576,0A1.023,1.023,0,1,1,23.6,23.6ZM22.51,15.348a3.07,3.07,0,1,1,3.07-3.07A3.073,3.073,0,0,1,22.51,15.348Z" fill="#8ca742"/>
</svg>

After

Width:  |  Height:  |  Size: 511 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32.742" height="32.742" viewBox="0 0 32.742 32.742">
<path id="Path_4588" data-name="Path 4588" d="M16.371,0A16.371,16.371,0,1,0,32.742,16.371,16.39,16.39,0,0,0,16.371,0ZM8.186,12.278a2.046,2.046,0,1,1,2.046,2.046A2.05,2.05,0,0,1,8.186,12.278Zm13.3,12.278H11.255a1.023,1.023,0,0,1,0-2.046H21.487a1.023,1.023,0,0,1,0,2.046ZM22.51,14.325a2.046,2.046,0,1,1,2.046-2.046A2.05,2.05,0,0,1,22.51,14.325Z" fill="#ca8432"/>
</svg>

After

Width:  |  Height:  |  Size: 470 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32.742" height="32.742" viewBox="0 0 32.742 32.742">
<path id="Path_4586" data-name="Path 4586" d="M16.371,0A16.371,16.371,0,1,0,32.742,16.371,16.39,16.39,0,0,0,16.371,0ZM8.186,15.348a3.065,3.065,0,0,1,1.471-2.609L7.543,11.028A1.023,1.023,0,1,1,8.828,9.436l4.355,3.524a3.069,3.069,0,1,1-5,2.388ZM22.228,26.286a1.024,1.024,0,0,1-1.447.035,6.4,6.4,0,0,0-8.822,0,1.023,1.023,0,1,1-1.41-1.484,8.437,8.437,0,0,1,11.642,0A1.023,1.023,0,0,1,22.228,26.286ZM25.2,11.028l-2.116,1.711a3.059,3.059,0,1,1-3.526.221l4.357-3.524A1.023,1.023,0,1,1,25.2,11.028Z" fill="#ca3332"/>
</svg>

After

Width:  |  Height:  |  Size: 619 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32.742" height="32.742" viewBox="0 0 32.742 32.742">
<path id="Path_4590" data-name="Path 4590" d="M16.371,0A16.371,16.371,0,1,0,32.742,16.371,16.39,16.39,0,0,0,16.371,0ZM22.51,10.232a2.046,2.046,0,1,1-2.046,2.046A2.05,2.05,0,0,1,22.51,10.232Zm-12.278,0a2.046,2.046,0,1,1-2.046,2.046A2.05,2.05,0,0,1,10.232,10.232Zm6.139,18.417a12.305,12.305,0,0,1-11.81-8.93,1.024,1.024,0,0,1,.984-1.3H27.2a1.02,1.02,0,0,1,.814.405,1.031,1.031,0,0,1,.17.9A12.305,12.305,0,0,1,16.371,28.649Z" fill="#20a16a"/>
</svg>

After

Width:  |  Height:  |  Size: 549 B

@ -402,6 +402,10 @@
"itemCreation": "أنشاء عنصر",
"stamp": "ختم",
"addFavoriteList": "هل تريد اضافة {name} لقائمة المفضله",
"feedbackUserExperience": "هذا للحصول على تعليقات حول تجربة المستخدم",
"rateUI": ".1 كيف تريد تقييم التطبيق",
"submitSurvey":"ارسال الاستبيان",
"typeHere": "اكتب هنا",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -402,6 +402,10 @@
"itemCreation": "Item Creation",
"stamp": "Stamp",
"addFavoriteList": "Do you want to add {name} in your favorite list",
"feedbackUserExperience": "This is to get the feedback about the user experience",
"rateUI": "1. How would you rate this UI?",
"submitSurvey":"Submit Survey",
"typeHere": "Type here",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -4,6 +4,7 @@ import 'package:mohem_flutter_app/ui/attendance/monthly_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/attendance/vacation_rule_screen.dart';
import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
import 'package:mohem_flutter_app/ui/landing/survey_screen.dart';
import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/leave_balance/add_leave_balance_screen.dart';
import 'package:mohem_flutter_app/ui/leave_balance/leave_balance_screen.dart';
@ -76,6 +77,7 @@ class AppRoutes {
static const String subMenuScreen = "/submenuScreen";
static const String addEitScreen = "/addeitScreen";
static const String initialRoute = login;
static const String survey = "/survey";
//Work List
static const String workList = "/workList";
@ -162,6 +164,7 @@ class AppRoutes {
verifyLogin: (context) => VerifyLoginScreen(),
verifyLastLogin: (context) => VerifyLastLoginScreen(),
dashboard: (context) => DashboardScreen(),
survey: (context) => SurveyScreen(),
subMenuScreen: (context) => SubMenuScreen(),
newPassword: (context) => NewPasswordScreen(),

@ -78,6 +78,11 @@ extension EmailValidator on String {
style: TextStyle(fontSize: 18, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.08),
);
Widget toText19({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(fontSize: 19, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.14),
);
Widget toText20({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),

@ -55,7 +55,7 @@ extension WidgetExtensions on Widget {
offset: const Offset(0, -3),
),
],
),
),alignment: Alignment.center,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@ -69,7 +69,7 @@ extension WidgetExtensions on Widget {
);
}
Widget objectContainerBorderView({String title = "", String note = "", bool disablePadding = false, double radius = 15, Color? color, Color borderColor = MyColors.lightGreyEFColor}) {
Widget objectContainerBorderView({String title = "", String note = "", bool disablePadding = false, double radius = 15, Color? color, Color borderColor = MyColors.lightGreyEFColor,bool disableWidth = false,bool isAlignment = false }) {
return Container(
padding: disablePadding ? EdgeInsets.zero : const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
@ -77,9 +77,10 @@ extension WidgetExtensions on Widget {
color: color,
border: Border.all(
color: borderColor,
width: 1,
width: disableWidth ? 2 : 1,
),
),
alignment: isAlignment? Alignment.center : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,

@ -418,6 +418,10 @@ class CodegenLoader extends AssetLoader{
"itemCreation": "أنشاء عنصر",
"stamp": "ختم",
"addFavoriteList": "هل تريد اضافة {name} لقائمة المفضله",
"feedbackUserExperience": "هذا للحصول على تعليقات حول تجربة المستخدم",
"rateUI": ".1 كيف تريد تقييم التطبيق",
"Submit Survey": "ارسال الاستبيان",
"typeHere": "اكتب هنا",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -856,6 +860,10 @@ static const Map<String,dynamic> en_US = {
"itemCreation": "Item Creation",
"stamp": "Stamp",
"addFavoriteList": "Do you want to add {name} in your favorite list",
"feedbackUserExperience": "This is to get the feedback about the user experience",
"rateUI": "1. How would you rate this UI?",
"Submit Survey": "Submit Survey",
"typeHere": "Type here",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -403,6 +403,10 @@ abstract class LocaleKeys {
static const itemCreation = 'itemCreation';
static const stamp = 'stamp';
static const addFavoriteList = 'addFavoriteList';
static const feedbackUserExperience = 'feedbackUserExperience';
static const rateUI = 'rateUI';
static const submitSurvey = 'submitSurvey';
static const typeHere = 'typeHere';
static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password';

@ -0,0 +1,111 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class SurveyScreen extends StatefulWidget {
const SurveyScreen({Key? key}) : super(key: key);
@override
_SurveyScreenState createState() => _SurveyScreenState();
}
class _SurveyScreenState extends State<SurveyScreen> {
String reviewText = "";
int _selectedIndex = -1;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColors.backgroundColor,
body: Column(
children: [
Expanded(
child: ListView(
scrollDirection: Axis.vertical,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
124.height,
LocaleKeys.feedbackUserExperience.tr().toText19(),
27.height,
LocaleKeys.rateUI.tr().toText16(),
22.height,
Row(
children: [
RatingBar.builder(
initialRating: 3,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemPadding: EdgeInsets.symmetric(horizontal: 12),
itemBuilder: (context, _) => Icon(
Icons.star,
color: Colors.amber,
),
onRatingUpdate: (rating) {},
)
],
).paddingOnly(left: 22, right: 22, top: 12, bottom: 12).objectContainerView(disablePadding: true),
39.height,
LocaleKeys.rateUI.tr().toText16(),
10.height,
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 5, crossAxisSpacing: 7, mainAxisSpacing: 7),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 0),
shrinkWrap: true,
children: [
optionUI("poor.svg", 0),
optionUI("bad.svg", 1),
optionUI("normal.svg", 2),
optionUI("good.svg", 3),
optionUI("xcellent.svg", 4),
],
),
27.height,
DynamicTextFieldWidget(
LocaleKeys.description.tr(),
LocaleKeys.typeHere.tr(),
lines: 3,
),
150.height
],
).paddingOnly(left: 21, right: 21),
],
)),
DefaultButton(LocaleKeys.submitSurvey.tr(), () async {}).insideContainer,
],
));
}
Widget optionUI(String icon, int index) {
return (_selectedIndex == index
? SvgPicture.asset(
'assets/images/' + icon,
height: 32,
width: 32,
).objectContainerBorderView(disablePadding: true, borderColor: MyColors.textMixColor, disableWidth: true, isAlignment: true)
: SvgPicture.asset(
'assets/images/' + icon,
height: 32,
width: 32,
).objectContainerView(
disablePadding: true,
))
.onPress(() {
_selectedIndex = index;
setState(() {});
});
}
}

@ -5,6 +5,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
@ -83,7 +84,8 @@ class _AppDrawerState extends State<AppDrawer> {
}),
menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {}),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,);
},),
],
).expanded,
const Divider(

@ -73,6 +73,7 @@ dependencies:
qr_flutter: ^4.0.0
url_launcher: ^6.0.15
share: 2.0.4
flutter_rating_bar: ^4.0.1
dev_dependencies:
flutter_test:

Loading…
Cancel
Save