dashboard cont

main_design2.0
Sikander Saleem 2 years ago
parent f4afe5ca5a
commit fd18e5d39c

@ -0,0 +1,5 @@
<svg width="23" height="24" viewBox="0 0 23 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.58385 21.4216C9.58385 22.8433 10.7405 23.9999 12.1621 23.9999C13.5838 23.9999 14.7404 22.8433 14.7404 21.4216V21.2012H9.5838V21.4216H9.58385Z" fill="#767676"/>
<path d="M21.4183 18.3917C20.922 18.3917 20.5182 17.9879 20.5182 17.4915V10.5065C20.5182 6.85703 18.1688 3.663 14.7404 2.5561C14.7285 1.14455 13.5765 0 12.1622 0C10.7479 0 9.59592 1.14455 9.58398 2.5561C8.73777 2.82929 7.95744 3.22985 7.26183 3.73282C9.10171 4.72752 10.3545 6.67454 10.3545 8.9088C10.3545 12.1508 7.71685 14.7885 4.47482 14.7885C4.24874 14.7885 4.0257 14.7752 3.80618 14.7502V17.4916C3.80618 17.9879 3.40239 18.3917 2.90602 18.3917C2.5181 18.3917 2.20361 18.7062 2.20361 19.0941C2.20361 19.482 2.5181 19.7965 2.90602 19.7965H21.4183C21.8062 19.7965 22.1207 19.482 22.1207 19.0941C22.1207 18.7062 21.8063 18.3917 21.4183 18.3917Z" fill="#767676"/>
<path d="M8.94964 8.90888C8.94964 6.44146 6.94226 4.43408 4.4748 4.43408C2.00734 4.43408 0 6.44151 0 8.90888C0 11.3762 2.00738 13.3837 4.4748 13.3837C6.94221 13.3837 8.94964 11.3763 8.94964 8.90888ZM3.77244 10.1888V8.33122H3.4594C3.07148 8.33122 2.75699 8.01673 2.75699 7.62881C2.75699 7.2409 3.07148 6.92641 3.4594 6.92641H4.47484C4.86276 6.92641 5.17725 7.2409 5.17725 7.62881V10.1888C5.17725 10.5767 4.86276 10.8912 4.47484 10.8912C4.08693 10.8912 3.77244 10.5767 3.77244 10.1888Z" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 0C5.36761 0 0 5.367 0 12C0 18.6323 5.367 24 12 24C18.6324 24 24 18.633 24 12C24 5.36761 18.633 0 12 0ZM11.6449 17.6165C10.9657 17.6165 10.4445 17.0479 10.4445 16.4002C10.4445 15.7368 10.9815 15.184 11.6449 15.184C12.3084 15.184 12.8611 15.7368 12.8611 16.4002C12.8611 17.0478 12.3241 17.6165 11.6449 17.6165ZM13.4456 11.472C12.5768 12.1512 12.561 12.6251 12.561 13.4464C12.561 13.7466 12.403 14.0941 11.6291 14.0941C10.9814 14.0941 10.7603 13.8571 10.7603 13.0358C10.7603 11.6774 11.3606 11.0297 11.8186 10.6349C12.3399 10.1925 13.2245 9.70294 13.2245 8.85C13.2245 8.12334 12.5926 7.77586 11.8028 7.77586C10.1917 7.77586 10.5392 8.99217 9.6862 8.99217C9.25974 8.99217 8.73848 8.70778 8.73848 8.0918C8.73848 7.23886 9.7178 5.97516 11.8502 5.97516C13.872 5.97516 15.2147 7.09669 15.2147 8.58145C15.2147 10.0662 13.872 11.1403 13.4456 11.472Z" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 978 B

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.77">
<path d="M12 0C5.38322 0 0 5.38322 0 12C0 18.6168 5.38322 24 12 24C18.6168 24 24 18.6168 24 12C24 5.38322 18.6168 0 12 0ZM10.9091 5.45456C10.9091 4.85208 11.3975 4.36364 12 4.36364C12.6025 4.36364 13.0909 4.85208 13.0909 5.45456V10.1298C13.0909 10.7323 12.6025 11.2208 12 11.2208C11.3975 11.2208 10.9091 10.7323 10.9091 10.1298V5.45456ZM12 19.6364C8.17598 19.6364 5.06494 16.5253 5.06494 12.7013C5.06494 10.9976 5.6888 9.35925 6.82153 8.08819C7.22241 7.63828 7.91194 7.59881 8.3618 7.99959C8.81161 8.40047 8.85117 9.09 8.45039 9.53991C7.67423 10.4108 7.24673 11.5335 7.24673 12.7013C7.24673 15.3222 9.37903 17.4545 12 17.4545C14.6209 17.4545 16.7532 15.3222 16.7532 12.7013C16.7532 11.5334 16.3258 10.4107 15.5496 9.53991C15.1486 9.09014 15.1883 8.40056 15.6381 7.99969C16.0878 7.59881 16.7775 7.63833 17.1783 8.08819C18.3111 9.35911 18.935 10.9973 18.935 12.7013C18.9351 16.5253 15.824 19.6364 12 19.6364Z" fill="#D02127"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1,7 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.3196 7.34982L12 6.65311L13.6804 7.34982C13.9056 7.44277 14.1642 7.41338 14.3629 7.26919C14.5608 7.12524 14.6695 6.88852 14.6503 6.64472L14.5073 4.83127L15.689 3.44776C15.8479 3.26208 15.8986 3.00657 15.8231 2.77402C15.7476 2.54101 15.5564 2.36424 15.3183 2.30752L13.5497 1.88274L12.5995 0.331365C12.3466 -0.110478 11.6533 -0.110432 11.4004 0.331365L10.4503 1.88274L8.6817 2.30752C8.44358 2.36424 8.25233 2.54101 8.17686 2.77402C8.10139 3.00657 8.15201 3.26208 8.31092 3.44776L9.49264 4.83127L9.34967 6.64472C9.33045 6.88852 9.4392 7.12529 9.63701 7.26919C9.83534 7.41263 10.0936 7.44357 10.3196 7.34982Z" fill="#767676"/>
<path d="M23.9657 5.54053C23.8902 5.30752 23.6989 5.13075 23.4608 5.07403L21.6922 4.64925L20.7421 3.09788C20.6141 2.88924 20.3872 2.76221 20.1425 2.76221C19.8978 2.76221 19.671 2.88929 19.543 3.09788L18.5928 4.64925L16.8242 5.07403C16.5861 5.13075 16.3949 5.30752 16.3194 5.54053C16.2439 5.77308 16.2946 6.0286 16.4535 6.21427L17.6352 7.59778L17.4922 9.41124C17.473 9.65503 17.5817 9.8918 17.7796 10.0357C17.9778 10.1792 18.2361 10.2101 18.4621 10.1163L20.1425 9.41963L21.823 10.1163C22.0481 10.2093 22.3067 10.1799 22.5055 10.0357C22.7033 9.89175 22.8121 9.65503 22.7928 9.41124L22.6499 7.59778L23.8316 6.21427C23.9905 6.0286 24.0411 5.77308 23.9657 5.54053Z" fill="#767676"/>
<path d="M5.80702 10.1698C5.95328 10.1698 6.09812 10.1243 6.22046 10.0357C6.41827 9.89175 6.52702 9.65503 6.50781 9.41124L6.36484 7.59778L7.54656 6.21427C7.70546 6.0286 7.75609 5.77308 7.68062 5.54053C7.60515 5.30752 7.4139 5.13075 7.17577 5.07403L5.40718 4.64925L4.45703 3.09788C4.32906 2.88924 4.10218 2.76221 3.85749 2.76221C3.61281 2.76221 3.38593 2.88929 3.25796 3.09788L2.30781 4.64925L0.539214 5.07403C0.301089 5.13075 0.109839 5.30752 0.0343699 5.54053C-0.0410988 5.77308 0.0095262 6.0286 0.168432 6.21427L1.35015 7.59778L1.20718 9.41124C1.18796 9.65503 1.29671 9.8918 1.49453 10.0357C1.69281 10.1792 1.95109 10.2101 2.17703 10.1163L3.85749 9.41963L5.53796 10.1163C5.62468 10.152 5.71609 10.1698 5.80702 10.1698Z" fill="#767676"/>
<path d="M20.2771 16.9132L19.4451 21.6818C19.236 22.8757 18.1996 23.7467 16.9879 23.7467H12.1893C11.8542 23.7467 11.5256 23.6796 11.2214 23.5545C10.9171 23.4279 10.6373 23.2432 10.4006 23.006C10.386 22.9915 10.371 22.977 10.356 22.9624V15.0415L10.3879 15.0303C11.0643 14.7874 11.5917 14.2456 11.8148 13.5621L12.2343 12.2196L12.7996 10.4107C12.966 9.90213 13.5126 9.6251 14.0217 9.7915C14.9535 10.0953 15.546 10.9615 15.546 11.891C15.546 12.1188 15.5104 12.3504 15.4354 12.5782L14.8054 14.6454H18.3712C19.5731 14.6454 20.4843 15.7296 20.2771 16.9132Z" fill="#767676"/>
<path d="M8.25086 23.9998H4.99609C4.60998 23.9998 4.297 23.6869 4.297 23.3008V14.8715C4.297 14.4853 4.60998 14.1724 4.99609 14.1724H8.25086C8.63696 14.1724 8.94995 14.4853 8.94995 14.8715V23.3008C8.94995 23.6869 8.63696 23.9998 8.25086 23.9998Z" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -0,0 +1,3 @@
<svg width="24" height="22" viewBox="0 0 24 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.6368 17.7455L14.3201 1.36012C13.8359 0.508475 12.9685 0 12 0C11.0315 0 10.1641 0.508475 9.67986 1.36012L0.3632 17.7455C-0.121067 18.5971 -0.121067 19.614 0.3632 20.4657C0.847467 21.3174 1.7148 21.8259 2.68333 21.8259H21.3167C22.2852 21.8259 23.1526 21.3174 23.6368 20.4657C24.1211 19.6141 24.1211 18.5971 23.6368 17.7455ZM11.2964 7.29823H12.7036V14.6811H11.2964V7.29823ZM12 18.0154C11.4827 18.0154 11.0618 17.588 11.0618 17.0627C11.0618 16.5374 11.4827 16.1101 12 16.1101C12.5173 16.1101 12.9382 16.5374 12.9382 17.0627C12.9382 17.588 12.5173 18.0154 12 18.0154Z" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 701 B

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.4672 9.91191L20.7142 9.23489C20.5488 8.71303 20.3359 8.20697 20.0791 7.72289C20.4924 7.03486 21.3611 5.58675 21.3611 5.58675C21.5273 5.31005 21.4833 4.95572 21.2553 4.72777L19.2668 2.73923C19.0388 2.51058 18.6852 2.46666 18.4078 2.63348L16.2682 3.91547C15.7868 3.6607 15.2835 3.44991 14.7652 3.2858L14.0881 0.532875C14.0098 0.21975 13.729 0 13.4062 0H10.5938C10.271 0 9.98948 0.21975 9.91191 0.532828C9.91191 0.532828 9.44292 2.45423 9.23555 3.28509C8.6828 3.46017 8.14861 3.68747 7.63978 3.96487L5.42123 2.63348C5.14383 2.46867 4.79091 2.51128 4.56225 2.73923L2.57372 4.72777C2.34577 4.95572 2.3018 5.31005 2.46797 5.58675L3.83991 7.87809C3.6188 8.31413 3.43341 8.76797 3.2858 9.23283L0.532875 9.91191C0.21975 9.99019 0 10.271 0 10.5938V13.4062C0 13.729 0.21975 14.0105 0.532828 14.0881L3.28645 14.7651C3.45333 15.2945 3.67027 15.8088 3.93328 16.3025L2.70558 18.3487C2.53941 18.6254 2.58337 18.9797 2.81133 19.2077L4.79986 21.1962C5.02716 21.4235 5.38144 21.4667 5.65884 21.302C5.65884 21.302 7.03556 20.4766 7.70986 20.0729C8.19806 20.3331 8.70891 20.548 9.23559 20.7149L9.91195 23.4671C9.98948 23.7803 10.271 24 10.5938 24H13.4062C13.729 24 14.0098 23.7803 14.0881 23.4672L14.7645 20.7149C15.3062 20.5432 15.828 20.3214 16.3245 20.0523C17.0173 20.4677 18.4078 21.302 18.4078 21.302C18.6845 21.4674 19.0388 21.4249 19.2668 21.1962L21.2553 19.2077C21.4832 18.9797 21.5272 18.6254 21.361 18.3487L20.0969 16.2428C20.3461 15.7696 20.5529 15.2746 20.7142 14.7651L23.4671 14.0881C23.7803 14.0098 24 13.729 24 13.4062V10.5938C24 10.271 23.7803 9.99019 23.4672 9.91191ZM12 16.9219C9.28636 16.9219 7.07812 14.7136 7.07812 12C7.07812 9.28636 9.28636 7.07812 12 7.07812C14.7136 7.07812 16.9219 9.28636 16.9219 12C16.9219 14.7136 14.7136 16.9219 12 16.9219Z" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.9058 11.6485L22.4866 9.18998V6.35156C22.4866 6.10036 22.3526 5.86818 22.135 5.74261L19.6766 4.32342L18.2574 1.86501C18.1318 1.64746 17.8997 1.51345 17.6485 1.51345H14.81L12.3515 0.094166C12.134 -0.0313652 11.866 -0.0314121 11.6484 0.094166L9.18999 1.5134H6.35157C6.10037 1.5134 5.8682 1.64742 5.74262 1.86501L4.32348 4.32342L1.86503 5.74261C1.64743 5.86818 1.51342 6.10031 1.51342 6.35156V9.18998L0.0941835 11.6485C-0.0313945 11.866 -0.0313945 12.134 0.0941835 12.3515L1.51337 14.81V17.6484C1.51337 17.8996 1.64739 18.1318 1.86498 18.2574L4.32343 19.6766L5.74262 22.135C5.8682 22.3526 6.10032 22.4866 6.35157 22.4866H9.19004L11.6485 23.9058C11.7572 23.9686 11.8786 24 12 24C12.1215 24 12.2428 23.9686 12.3516 23.9058L14.81 22.4866H17.6484C17.8996 22.4866 18.1318 22.3526 18.2574 22.135L19.6765 19.6766L22.1349 18.2574C22.3525 18.1319 22.4865 17.8997 22.4865 17.6485V14.8101L23.9058 12.3516C24.0314 12.134 24.0314 11.866 23.9058 11.6485ZM8.56093 14.2594C8.56093 14.5692 8.3581 14.8425 8.06157 14.9323C7.76279 15.0227 7.44347 14.9054 7.27276 14.6494L5.54841 12.0629V14.2594C5.54841 14.6477 5.2336 14.9625 4.84529 14.9625C4.45698 14.9625 4.14217 14.6477 4.14217 14.2594V9.74062C4.14217 9.43078 4.34499 9.1575 4.64152 9.06768C4.9381 8.97797 5.25845 9.09281 5.43034 9.35062L7.15468 11.9371V9.74062C7.15468 9.35231 7.46949 9.0375 7.8578 9.0375C8.24611 9.0375 8.56093 9.35231 8.56093 9.74062V14.2594ZM11.6235 11.2969C12.0118 11.2969 12.3266 11.6117 12.3266 12C12.3266 12.3883 12.0118 12.7031 11.6235 12.7031H10.8203V13.5562H12.3766C12.7649 13.5562 13.0797 13.8711 13.0797 14.2594C13.0797 14.6477 12.7649 14.9625 12.3766 14.9625H10.1172C9.72891 14.9625 9.4141 14.6477 9.4141 14.2594V9.74062C9.4141 9.35231 9.72891 9.0375 10.1172 9.0375H12.3766C12.7649 9.0375 13.0797 9.35231 13.0797 9.74062C13.0797 10.1289 12.7649 10.4437 12.3766 10.4437H10.8203V11.2969H11.6235ZM20.2134 9.91115L19.0837 14.4299C19.0079 14.7332 18.7409 14.95 18.4285 14.962C18.4195 14.9624 18.4103 14.9625 18.4013 14.9625C18.0998 14.9626 17.8305 14.7697 17.7345 14.4817L16.8953 11.9641L16.0561 14.4817C15.9572 14.7783 15.6744 14.9732 15.3621 14.962C15.0497 14.95 14.7827 14.7332 14.7069 14.4299L13.5772 9.91115C13.483 9.53442 13.7121 9.15267 14.0888 9.05854C14.4656 8.96418 14.8473 9.19336 14.9415 9.57014L15.4855 11.7464L16.2282 9.51834C16.3239 9.23123 16.5926 9.03754 16.8952 9.03754C17.1978 9.03754 17.4665 9.23123 17.5622 9.51834L18.3049 11.7464L18.849 9.57014C18.9432 9.1934 19.3249 8.96428 19.7016 9.05854C20.0785 9.15267 20.3076 9.53437 20.2134 9.91115Z" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -21,8 +21,8 @@ class URLs {
// static String getFileUrl(String file) => (file == null || file.isEmpty) ? null :1 (file.contains("/") ? file : "$_host/attachment/$file");
// API Routes
// static get login => "$_baseUrl/MobileAuth/Login"; // web login
static get login => "$_baseUrl/MobileAuth/LoginIntegration"; // mobile login
static get login => "$_baseUrl/MobileAuth/Login"; // web login
// static get login => "$_baseUrl/MobileAuth/LoginIntegration"; // mobile login
static get register => "$_baseUrl/handle/create/user"; // post
static get updateProfile => "$_baseUrl/update/user/profile"; // post
static get getSites => "$_baseUrl/Customer/GetCustomers"; // get

@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.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/new_views/app_style/app_color.dart';
import '../../models/enums/translation_keys.dart';
@ -21,8 +23,16 @@ class AppBottomNavigationBar extends StatelessWidget {
borderRadius: const BorderRadius.only(topLeft: Radius.circular(20.0), topRight: Radius.circular(20.0)),
child: Container(
height: 100.toScreenHeight,
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 14)],
decoration: const BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x0C000000),
blurRadius: 14,
offset: Offset(0, 0),
spreadRadius: 0,
)
],
),
child: BottomNavigationBar(
items: <BottomNavigationBarItem>[
@ -32,8 +42,11 @@ class AppBottomNavigationBar extends StatelessWidget {
navBarItem(context, index: 3, iconName: "message", label: context.translation.contactUs),
],
currentIndex: selectedIndex,
selectedFontSize: 12,
onTap: onPressed,
selectedLabelStyle: AppTextStyles.tinyFont.copyWith(fontSize: 11),
unselectedLabelStyle: AppTextStyles.tinyFont.copyWith(fontSize: 11),
selectedItemColor: AppColor.primary70,
unselectedItemColor: const Color(0xFF757575),
),
),
);

@ -1,6 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.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/new_views/app_style/app_color.dart';
import '../../controllers/providers/api/user_provider.dart';
import '../../controllers/providers/settings/setting_provider.dart';
@ -15,27 +20,59 @@ class AppDrawer extends StatelessWidget {
final settingProvider = Provider.of<SettingProvider>(context, listen: false);
final userProvider = Provider.of<UserProvider>(context, listen: false);
return Drawer(
width: MediaQuery.of(context).size.width * .8,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppFilledButton(
label: context.translation.login,
onPressed: () async {
/// TODO [zaid] : show dialog before logout
// bool result = await showDialog(
// context: context,
// builder: (_) => const AAlertDialog(
// title: "_subtitle.signOut",
// content: "_subtitle.signOutAlert",
// ),
// );
if (true) {
settingProvider.resetSettings();
userProvider.reset();
Navigator.of(context).pop();
Navigator.of(context).pop();
}
}),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 90,
height: 90,
decoration: const ShapeDecoration(
image: DecorationImage(
image: NetworkImage(
"https://www.shutterstock.com/shutterstock/photos/1714666150/display_1500/stock-photo-head-shot-portrait-close-up-smiling-confident-businessman-wearing-glasses-looking-at-camera-1714666150.jpg"),
fit: BoxFit.cover,
),
shape: OvalBorder(
side: BorderSide(width: 1, color: Color(0xFFE4E5E6)),
),
),
),
Icon(Icons.clear).onPress(() => Navigator.of(context).pop())
],
),
8.height,
Text(
"Eng Mahmoud",
style: AppTextStyles.heading2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, fontWeight: FontWeight.w600, letterSpacing: -0.12),
),
Text(
"context.welcome@gmail.com",
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
),
18.height,
1.divider,
ListView(
padding: EdgeInsets.only(top: 24),
children: [
drawerItem("drawer_notification", "Notification"),
18.height,
drawerItem("help_center", "Help Center"),
18.height,
drawerItem("rate_us", "Rate Us"),
18.height,
drawerItem("setting", "Settings"),
18.height,
drawerItem("report", "Report a bug"),
18.height,
drawerItem("whats_new", "What's New"),
],
).expanded,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -60,8 +97,45 @@ class AppDrawer extends StatelessWidget {
),
],
),
drawerItem("logout", "Logout").onPress(() {
/// TODO [zaid] : show dialog before logout
// bool result = await showDialog(
// context: context,
// builder: (_) => const AAlertDialog(
// title: "_subtitle.signOut",
// content: "_subtitle.signOutAlert",
// ),
// );
if (true) {
settingProvider.resetSettings();
userProvider.reset();
Navigator.of(context).pop();
Navigator.of(context).pop();
}
}),
18.height,
1.divider,
24.height,
],
),
).paddingOnly(top: 66, start: 16, end: 24, bottom: 62),
);
}
Widget drawerItem(String icon, String title, {Color color}) {
return Row(
children: [
SvgPicture.asset(
"assets/images/$icon.svg",
color: color ?? const Color(0xFF757575),
width: 24,
height: 24,
),
16.width,
Text(
title,
style: AppTextStyles.heading6.copyWith(color: const Color(0xFF3B3D4A)),
),
],
);
}
}

@ -1,13 +1,19 @@
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/models/enums/translation_keys.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_drawer.dart';
import 'package:test_sa/new_views/common_widgets/app_floating_action_button.dart';
import 'dashboard_page_indicator.dart';
class DashboardPage extends StatefulWidget {
const DashboardPage({Key key}) : super(key: key);
final VoidCallback onDrawerPress;
const DashboardPage({Key key, this.onDrawerPress}) : super(key: key);
@override
State<DashboardPage> createState() => _DashboardPageState();
@ -35,50 +41,100 @@ class _DashboardPageState extends State<DashboardPage> {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.translation.welcome,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
),
Text(
"Eng Mahmoud",
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, fontWeight: FontWeight.w600),
),
24.height,
Row(
return Scaffold(
floatingActionButton: const AppFloatingActionButton(),
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: const Color(0xffF8F9FB),
titleSpacing: 0,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
DashboardPageIndicator(index: 0, currentPage: _currentPage, controller: _controller),
3.width,
DashboardPageIndicator(index: 1, currentPage: _currentPage, controller: _controller),
3.width,
DashboardPageIndicator(index: 2, currentPage: _currentPage, controller: _controller),
10.width,
Text(
"0$_currentPage/03",
style: Theme.of(context).textTheme.labelMedium?.copyWith(fontWeight: FontWeight.w500),
Container(
width: 48,
height: 48,
decoration: const ShapeDecoration(
image: DecorationImage(
image: NetworkImage(
"https://www.shutterstock.com/shutterstock/photos/1714666150/display_1500/stock-photo-head-shot-portrait-close-up-smiling-confident-businessman-wearing-glasses-looking-at-camera-1714666150.jpg"),
fit: BoxFit.cover,
),
shape: OvalBorder(
side: BorderSide(width: 1, color: Color(0xFFE4E5E6)),
),
),
).onPress(widget.onDrawerPress),
Stack(
alignment: Alignment.topRight,
children: [
const Icon(
Icons.notifications,
color: Color(0xff767676),
size: 30,
).paddingOnly(top: 6, end: 0),
Positioned(
top: 0,
right: 0,
child: Container(
padding: const EdgeInsets.all(4),
decoration: const ShapeDecoration(
color: Color(0xFFD02127),
shape: CircleBorder(),
),
child: Text("3", style: AppTextStyles.bodyText),
),
)
],
),
],
),
8.height,
Expanded(
child: PageView(
controller: _controller,
children: const [
Center(
child: Text('First Page'),
),
Center(
child: Text('Second Page'),
),
Center(
child: Text('Third Page'),
).paddingOnly(start: 16, end: 16),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.translation.welcome,
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
),
Text(
"Eng Mahmoud",
style: AppTextStyles.heading2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, fontWeight: FontWeight.w600),
),
24.height,
Row(
children: [
DashboardPageIndicator(index: 0, currentPage: _currentPage, controller: _controller),
3.width,
DashboardPageIndicator(index: 1, currentPage: _currentPage, controller: _controller),
3.width,
DashboardPageIndicator(index: 2, currentPage: _currentPage, controller: _controller),
10.width,
Text(
"0$_currentPage/03",
style: Theme.of(context).textTheme.labelMedium?.copyWith(fontWeight: FontWeight.w500),
),
],
),
),
],
8.height,
Expanded(
child: PageView(
controller: _controller,
children: const [
Center(
child: Text('First Page'),
),
Center(
child: Text('Second Page'),
),
Center(
child: Text('Third Page'),
),
],
),
),
],
).paddingAll(16),
);
}
}

@ -6,6 +6,7 @@ import '../../app_style/app_color.dart';
class DashboardPageIndicator extends StatelessWidget {
final PageController controller;
final int index, currentPage;
const DashboardPageIndicator({
Key key,
@required this.controller,
@ -21,7 +22,7 @@ class DashboardPageIndicator extends StatelessWidget {
controller.animateToPage(index, duration: const Duration(milliseconds: 500), curve: Curves.ease);
},
child: Container(
width: (isActive ? 30 : 16).toScreenWidth,
width: (isActive ? 30 : 12).toScreenWidth,
height: 9.toScreenHeight,
decoration: BoxDecoration(color: isActive ? AppColor.green50 : AppColor.neutral40, borderRadius: BorderRadius.circular(8)),
),

@ -6,6 +6,9 @@ import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/new_views/pages/land_page/home_app_bar.dart';
import 'package:test_sa/new_views/pages/land_page/my_assets_page.dart';
import 'package:test_sa/new_views/pages/land_page/my_request/my_requests_page.dart';
import 'package:test_sa/views/pages/device_transfer/asset_search_screen.dart';
import 'package:test_sa/views/pages/user/land_page.dart' as old_page;
import 'package:test_sa/views/widgets/equipment/single_device_picker.dart';
import '../../common_widgets/app_bottom_nav_bar.dart';
import '../../common_widgets/app_drawer.dart';
@ -15,6 +18,7 @@ import 'dashboard_page.dart';
class LandPage extends StatefulWidget {
static const String routeName = "/land-page";
const LandPage({Key key}) : super(key: key);
@override
@ -24,12 +28,21 @@ class LandPage extends StatefulWidget {
class _LandPageState extends State<LandPage> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
int currentPageIndex = 0;
bool showAppbar =true;
final List<Widget> _pages = const <Widget>[
DashboardPage(),
MyRequestsPage(),
MyAssetsPage(),
];
bool showAppbar = true;
List<Widget> _pages;
@override
void initState() {
_pages = <Widget>[
DashboardPage(onDrawerPress: (() {
_scaffoldKey.currentState.isDrawerOpen ? _scaffoldKey.currentState.closeDrawer() : _scaffoldKey.currentState.openDrawer();
})),
old_page.LandPage(),
SingleDevicePicker(),
MyRequestsPage(),
];
super.initState();
}
@override
Widget build(BuildContext context) {
@ -54,10 +67,8 @@ class _LandPageState extends State<LandPage> {
},
child: Scaffold(
key: _scaffoldKey,
appBar: showAppbar?HomeAppBar(scaffoldKey: _scaffoldKey): null,
drawer: AppDrawer(),
body: _pages[currentPageIndex],
drawer: const AppDrawer(),
floatingActionButton: const AppFloatingActionButton(),
bottomNavigationBar: AppBottomNavigationBar(
selectedIndex: currentPageIndex,
onPressed: (index) {
@ -73,13 +84,13 @@ class _LandPageState extends State<LandPage> {
currentPageIndex = index;
});
if(index == 1){
if (index == 1) {
setState(() {
showAppbar =false;
showAppbar = false;
});
}else{
} else {
setState(() {
showAppbar =true;
showAppbar = true;
});
}
}

@ -6,6 +6,7 @@ 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/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import '../../controllers/providers/api/user_provider.dart';
import '../../controllers/providers/settings/setting_provider.dart';
@ -102,7 +103,7 @@ class _LoginPageState extends State<LoginPage> {
/// The below line for the new design
// Navigator.pushNamed(context, LandPage.routeName);
Navigator.pushNamed(context, old.LandPage.id);
Navigator.pushNamed(context, LandPage.routeName);
} else {
Fluttertoast.showToast(msg: _userProvider.user?.message ?? context.translation.failedToCompleteRequest);
}

@ -9,6 +9,7 @@ import 'package:test_sa/controllers/providers/api/user_provider.dart';
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/app_notification.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import 'package:test_sa/new_views/pages/login_page.dart';
import '../../models/size_config.dart';
@ -53,7 +54,7 @@ class _SplashPageState extends State<SplashPage> {
Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true);
if (_settingProvider.isLoaded && (_settingProvider.user?.isLiveToken ?? false)) {
_userProvider.user = _settingProvider.user;
Navigator.of(context).pushNamedAndRemoveUntil(old.LandPage.id, (routes) => true);
Navigator.of(context).pushNamedAndRemoveUntil(LandPage.routeName, (routes) => true);
/// The below line for the new design
// Navigator.of(context).pushNamedAndRemoveUntil(LandPage.routeName, (routes) => true);

@ -9,8 +9,8 @@ import 'package:test_sa/controllers/validator/validator.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/models/user.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import 'package:test_sa/views/app_style/sizing.dart';
import 'package:test_sa/views/pages/user/land_page.dart';
import 'package:test_sa/views/widgets/app_text_form_field.dart';
import 'package:test_sa/views/widgets/buttons/app_button.dart';
import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
@ -117,7 +117,7 @@ class _LoginState extends State<Login> {
if (status >= 200 && status < 300) {
if (_userProvider.user.isAuthenticated ?? false) {
_settingProvider.setUser(_userProvider.user);
Navigator.of(context).pushNamed(LandPage.id);
Navigator.of(context).pushNamed(LandPage.routeName);
} else {
Fluttertoast.showToast(msg: _userProvider.user.message);
}
@ -129,8 +129,9 @@ class _LoginState extends State<Login> {
} else {
if (status >= 400 && status < 500) return;
String errorMessage =
status == 400 || _userProvider.user?.userName == null ? context.translation.wrongEmailOrPassword : HttpStatusManger.getStatusMessage(status: status, subtitle: context.translation);
String errorMessage = status == 400 || _userProvider.user?.userName == null
? context.translation.wrongEmailOrPassword
: HttpStatusManger.getStatusMessage(status: status, subtitle: context.translation);
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(errorMessage),
));

@ -9,7 +9,8 @@ import 'package:test_sa/controllers/providers/api/user_provider.dart';
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
import 'package:test_sa/models/app_notification.dart';
import 'package:test_sa/models/user.dart';
import 'package:test_sa/views/pages/user/land_page.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import 'login.dart';
@ -29,7 +30,7 @@ class _SplashScreenState extends State<SplashScreen> {
if (user.tokenlife != null && (DateTime.tryParse(user.tokenlife)?.isAfter(DateTime.now()) ?? false)) {
_userProvider.user = user;
// Navigator.of(context).pushNamed(Login.id);
Navigator.of(context).pushNamed(LandPage.id);
Navigator.of(context).pushNamed(LandPage.routeName);
}
}

@ -7,6 +7,7 @@ import 'package:test_sa/models/service_request/search_work_order.dart';
import 'package:test_sa/models/service_request/supplier_details.dart';
import 'package:test_sa/views/widgets/app_text_form_field.dart';
import 'package:test_sa/views/widgets/buttons/app_button.dart';
import 'package:test_sa/views/widgets/status/report/service_report_assistant_employee_menu.dart';
import 'package:test_sa/views/widgets/status/report/service_report_maintenance_situation.dart';
import 'package:test_sa/views/widgets/status/report/service_report_repair_location.dart';
import 'package:test_sa/views/widgets/status/service_request/supplier_engineers_menu.dart';

@ -22,7 +22,7 @@ import '../qr/scan_qr.dart';
class SingleDevicePicker extends StatefulWidget {
static final String id = "/single-device-Picker";
final bool sandraChoice = true;
const SingleDevicePicker({Key key}) : super(key: key);
@override
_SingleDevicePickerState createState() => _SingleDevicePickerState();

Loading…
Cancel
Save