dark mode color fixes

design_3.0_TM_Module_snagsFix
WaseemAbbasi22 2 months ago
parent e0ad359295
commit 5e3b09315f

@ -37,6 +37,7 @@ class _AssetRetiredState extends State<AssetRetired> with TickerProviderStateMix
bool _isLoading = false; bool _isLoading = false;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
final List<GenericAttachmentModel> _attachments = [];
@override @override
void initState() { void initState() {
@ -54,7 +55,7 @@ class _AssetRetiredState extends State<AssetRetired> with TickerProviderStateMix
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<GenericAttachmentModel> attachments = [];
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
@ -106,8 +107,10 @@ class _AssetRetiredState extends State<AssetRetired> with TickerProviderStateMix
23.height, 23.height,
AttachmentPicker( AttachmentPicker(
label: context.translation.attachFiles, label: context.translation.attachFiles,
attachment: attachments, attachment: _attachments,
buttonIcon: 'image-plus'.toSvgAsset(), onlyImages: false,
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
buttonColor: AppColor.black10,
), ),
], ],
).paddingOnly(start: 13, end: 13, top: 14, bottom: 16), ).paddingOnly(start: 13, end: 13, top: 14, bottom: 16),
@ -121,10 +124,10 @@ class _AssetRetiredState extends State<AssetRetired> with TickerProviderStateMix
loading: requestDetailProvider.isLoading, loading: requestDetailProvider.isLoading,
onPressed: () async { onPressed: () async {
requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments = []; requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments = [];
for (var attachment in attachments) { for (var item in _attachments) {
String fileName = ServiceRequestUtils.isLocalUrl(attachment.name??'') ? ("${attachment.name??''.split("/").last}|${base64Encode(File(attachment.name??'').readAsBytesSync())}") :attachment.name??''; String fileName = ServiceRequestUtils.isLocalUrl(item.name??'') ? ("${item.name??''.split("/").last}|${base64Encode(File(item.name??'').readAsBytesSync())}") :item.name??'';
requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments
?.add(ActivityAssetToBeRetiredAttachments(id: attachment.id, name: fileName)); ?.add(ActivityAssetToBeRetiredAttachments(id: item.id, name: fileName));
} }
int status = await requestDetailProvider.createActivityAssetToBeRetired(); int status = await requestDetailProvider.createActivityAssetToBeRetired();
if (status == 200) { if (status == 200) {

@ -78,7 +78,7 @@ class _CreateTaskViewState extends State<CreateTaskView> with TickerProviderStat
height: 56.toScreenHeight, height: 56.toScreenHeight,
title: context.translation.taskType, title: context.translation.taskType,
showShadow: false, showShadow: false,
backgroundColor: AppColor.neutral100, backgroundColor: AppColor.fieldBgColor(context),
showAsBottomSheet: true, showAsBottomSheet: true,
initialValue: selectedType, initialValue: selectedType,
onSelect: (type) { onSelect: (type) {
@ -102,9 +102,9 @@ class _CreateTaskViewState extends State<CreateTaskView> with TickerProviderStat
initialValue: _addTaskModel?.callComment, initialValue: _addTaskModel?.callComment,
controller: commentController, controller: commentController,
labelText: context.translation.callComments, labelText: context.translation.callComments,
backgroundColor: AppColor.neutral100, backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
showShadow: false, showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle,
alignLabelWithHint: true, alignLabelWithHint: true,
textInputType: TextInputType.multiline, textInputType: TextInputType.multiline,
onChange: (value) { onChange: (value) {
@ -117,7 +117,7 @@ class _CreateTaskViewState extends State<CreateTaskView> with TickerProviderStat
attachment: attachments, attachment: attachments,
buttonColor: AppColor.black10, buttonColor: AppColor.black10,
onlyImages: false, onlyImages: false,
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120), buttonIcon: 'image-plus'.toSvgAsset(color:context.isDark?AppColor.primary10: AppColor.neutral120),
//verify this if not required delete this .. //verify this if not required delete this ..
onChange: (attachments) { onChange: (attachments) {
attachments = attachments; attachments = attachments;

@ -17,7 +17,7 @@ class ConfirmDialog extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Dialog( return Dialog(
backgroundColor: Colors.white, backgroundColor:AppColor.background(context),
shape: const RoundedRectangleBorder(), shape: const RoundedRectangleBorder(),
insetPadding: const EdgeInsets.only(left: 21, right: 21), insetPadding: const EdgeInsets.only(left: 21, right: 21),
child: Padding( child: Padding(
@ -32,20 +32,20 @@ class ConfirmDialog extends StatelessWidget {
Expanded( Expanded(
child: Text( child: Text(
title ?? "Confirm", title ?? "Confirm",
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Colors.black87, height: 35 / 24, letterSpacing: -0.96), style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: AppColor.headingTextColor(context), height: 35 / 24, letterSpacing: -0.96),
).paddingOnly(top: 16), ).paddingOnly(top: 16),
), ),
IconButton( IconButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
color: Colors.black87, color: AppColor.iconColor(context),
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
onPressed: () => onCloseTap ?? Navigator.pop(context), onPressed: () => onCloseTap ?? Navigator.pop(context),
// onPressed: () => Navigator.pop(context), // onPressed: () => Navigator.pop(context),
) )
], ],
), ),
message != null ? message!.heading5(context).custom(color: AppColor.neutral70) : const SizedBox(), message != null ? message!.heading5(context).custom(color: AppColor.textColor(context)) : const SizedBox(),
28.height, 28.height,
AppFilledButton( AppFilledButton(
label: okTitle ?? "OK", label: okTitle ?? "OK",

@ -4,6 +4,10 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:nfc_manager/nfc_manager.dart'; import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager/platform_tags.dart'; import 'package:nfc_manager/platform_tags.dart';
import 'package:test_sa/dashboard_latest/dashboard_view.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/views/app_style/sizing.dart';
void showNfcReader(BuildContext context, {Function(String nfcId)? onNcfScan}) { void showNfcReader(BuildContext context, {Function(String nfcId)? onNcfScan}) {
showModalBottomSheet( showModalBottomSheet(
@ -79,6 +83,7 @@ class _NfcLayoutState extends State<NfcLayout> {
Widget scanNfc() { Widget scanNfc() {
return Container( return Container(
color: AppColor.background(context),
key: ValueKey(1), key: ValueKey(1),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -86,11 +91,12 @@ class _NfcLayoutState extends State<NfcLayout> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
const Text( Text(
"Ready To Scan", "Ready To Scan",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 24, fontSize: 24,
color:AppColor.headingTextColor(context)
), ),
), ),
SizedBox( SizedBox(
@ -99,6 +105,7 @@ class _NfcLayoutState extends State<NfcLayout> {
Image.asset( Image.asset(
"assets/images/ic_nfc.png", "assets/images/ic_nfc.png",
height: MediaQuery.of(context).size.width / 3, height: MediaQuery.of(context).size.width / 3,
color: AppColor.iconColor(context),
width: double.infinity, width: double.infinity,
), ),
const SizedBox( const SizedBox(
@ -139,6 +146,7 @@ class _NfcLayoutState extends State<NfcLayout> {
Widget doneNfc() { Widget doneNfc() {
return Container( return Container(
color: AppColor.background(context),
key: ValueKey(2), key: ValueKey(2),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -151,6 +159,7 @@ class _NfcLayoutState extends State<NfcLayout> {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 24, fontSize: 24,
color:AppColor.headingTextColor(context)
), ),
), ),
SizedBox( SizedBox(
@ -161,6 +170,7 @@ class _NfcLayoutState extends State<NfcLayout> {
"assets/images/ic_done.png", "assets/images/ic_done.png",
height: MediaQuery.of(context).size.width / 3, height: MediaQuery.of(context).size.width / 3,
width: double.infinity, width: double.infinity,
color: AppColor.iconColor(context),
), ),
SizedBox( SizedBox(
height: 30, height: 30,
@ -189,7 +199,7 @@ class _NfcLayoutState extends State<NfcLayout> {
// }, // },
onPressed: null, onPressed: null,
// elevation: 0, // elevation: 0,
child: Text("DONE"), child: Text("DONE",style: TextStyle(color: context.isDark?AppColor.primary10:null),),
), ),
), ),
SizedBox( SizedBox(

@ -113,19 +113,20 @@ class SwipeGeneralUtils {
} }
Widget attendanceTypeCard(String title, String icon, bool isEnabled, VoidCallback onPress, BuildContext context) { Widget attendanceTypeCard(String title, String icon, bool isEnabled, VoidCallback onPress, BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isEnabled ? Colors.white : AppColor.white70, color: isEnabled ?context.isDark ? AppColor.neutral60 : Colors.white : AppColor.background(context),
borderRadius: BorderRadius.circular(18), borderRadius: BorderRadius.circular(18),
border: Border.all(color: AppColor.white70, width: 2), border: Border.all(color:context.isDark ? AppColor.neutral60 : Colors.white70 , width: 2),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
icon.toSvgAsset(color: isEnabled ? null : Colors.grey.withOpacity(0.5)), icon.toSvgAsset(color: isEnabled ?context.isDark ? AppColor.neutral30 : AppColor.neutral50 : Colors.grey.withOpacity(0.5)),
title.heading5(context).custom(color: isEnabled ? AppColor.neutral50 : Colors.grey.withOpacity(0.5)), title.heading5(context).custom(color: isEnabled ?context.isDark ? AppColor.neutral30 : AppColor.neutral50 : Colors.grey.withOpacity(0.5)),
], ],
), ),
).onPress( ).onPress(
@ -428,12 +429,13 @@ class SwipeGeneralUtils {
top: Radius.circular(20), top: Radius.circular(20),
), ),
), ),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
builder: (BuildContext context) => Column( builder: (BuildContext context) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
context.translation.markAttendance.heading4(context).custom(color: AppColor.white936), context.translation.markAttendance.heading4(context).custom(color:context.isDark?AppColor.white50: AppColor.white936),
8.height, 8.height,
context.translation.selectMethodToMarkAttendance.bodyText2(context).custom(color: AppColor.neutral120), context.translation.selectMethodToMarkAttendance.bodyText2(context).custom(color: AppColor.neutral120),
12.height, 12.height,

Loading…
Cancel
Save