Merge branch 'ZohaibIqbalKambrani' into 'development'
Zohaib iqbal kambrani See merge request Cloud_Solution/diplomatic-quarter!351merge-update-with-lab-changes
commit
a3984a7c1a
@ -0,0 +1,107 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||||
|
|
||||||
|
class DoctorPrePostImages {
|
||||||
|
DoctorPrePostImageModel pre;
|
||||||
|
DoctorPrePostImageModel post;
|
||||||
|
|
||||||
|
Uint8List getPreBytes(){
|
||||||
|
try{
|
||||||
|
var b64 = pre.imageStr.replaceFirst('data:image/png;base64,', '');
|
||||||
|
if(pre.imageStr != null && isBase64(b64))
|
||||||
|
return Utils.dataFromBase64String(b64);
|
||||||
|
}catch(e){
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Uint8List getPostBytes(){
|
||||||
|
try{
|
||||||
|
var b64 = post.imageStr.replaceFirst('data:image/png;base64,', '');
|
||||||
|
if(post.imageStr != null && isBase64(b64))
|
||||||
|
return Utils.dataFromBase64String(b64);
|
||||||
|
}catch(e){
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isBase64(String str) {
|
||||||
|
RegExp _base64 = RegExp(
|
||||||
|
r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$');
|
||||||
|
return _base64.hasMatch(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class DoctorPrePostImageModel {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int clinicId;
|
||||||
|
int doctorId;
|
||||||
|
int lineItemNo;
|
||||||
|
String imageStr;
|
||||||
|
int imageType;
|
||||||
|
String description;
|
||||||
|
dynamic isNewUpdated;
|
||||||
|
bool isActive;
|
||||||
|
String createdOn;
|
||||||
|
int createdBy;
|
||||||
|
dynamic editedOn;
|
||||||
|
dynamic editedBy;
|
||||||
|
|
||||||
|
DoctorPrePostImageModel({
|
||||||
|
this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.clinicId,
|
||||||
|
this.doctorId,
|
||||||
|
this.lineItemNo,
|
||||||
|
this.imageStr,
|
||||||
|
this.imageType,
|
||||||
|
this.description,
|
||||||
|
this.isNewUpdated,
|
||||||
|
this.isActive,
|
||||||
|
this.createdOn,
|
||||||
|
this.createdBy,
|
||||||
|
this.editedOn,
|
||||||
|
this.editedBy});
|
||||||
|
|
||||||
|
DoctorPrePostImageModel.fromJson(dynamic json) {
|
||||||
|
setupID = json["SetupID"];
|
||||||
|
projectID = json["ProjectID"];
|
||||||
|
clinicId = json["ClinicId"];
|
||||||
|
doctorId = json["DoctorId"];
|
||||||
|
lineItemNo = json["LineItemNo"];
|
||||||
|
imageStr = json["ImageStr"];
|
||||||
|
imageType = json["ImageType"];
|
||||||
|
description = json["Description"];
|
||||||
|
isNewUpdated = json["IsNewUpdated"];
|
||||||
|
isActive = json["IsActive"];
|
||||||
|
createdOn = json["CreatedOn"];
|
||||||
|
createdBy = json["CreatedBy"];
|
||||||
|
editedOn = json["EditedOn"];
|
||||||
|
editedBy = json["EditedBy"];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
var map = <String, dynamic>{};
|
||||||
|
map["SetupID"] = setupID;
|
||||||
|
map["ProjectID"] = projectID;
|
||||||
|
map["ClinicId"] = clinicId;
|
||||||
|
map["DoctorId"] = doctorId;
|
||||||
|
map["LineItemNo"] = lineItemNo;
|
||||||
|
map["ImageStr"] = imageStr;
|
||||||
|
map["ImageType"] = imageType;
|
||||||
|
map["Description"] = description;
|
||||||
|
map["IsNewUpdated"] = isNewUpdated;
|
||||||
|
map["IsActive"] = isActive;
|
||||||
|
map["CreatedOn"] = createdOn;
|
||||||
|
map["CreatedBy"] = createdBy;
|
||||||
|
map["EditedOn"] = editedOn;
|
||||||
|
map["EditedBy"] = editedBy;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class DoctorPostPreImagesPage extends StatefulWidget{
|
||||||
|
final DoctorPrePostImages doctorPrePostImages;
|
||||||
|
|
||||||
|
const DoctorPostPreImagesPage({this.doctorPrePostImages});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<StatefulWidget> createState() => DoctorPostPreImagesPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class DoctorPostPreImagesPageState extends State<DoctorPostPreImagesPage>{
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var images = widget.doctorPrePostImages;
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).beforeAfterImages,
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text("Before Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
|
||||||
|
Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){
|
||||||
|
return Container(
|
||||||
|
color: Colors.grey.withOpacity(0.25),
|
||||||
|
);
|
||||||
|
},)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Divider(color: Colors.grey.withOpacity(0.5)),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text("After Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
|
||||||
|
Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){
|
||||||
|
return Container(
|
||||||
|
color: Colors.grey.withOpacity(0.25),
|
||||||
|
);
|
||||||
|
},)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class DoctorPostPreImagesContent extends StatefulWidget{
|
||||||
|
final DoctorPrePostImages doctorPrePostImages;
|
||||||
|
|
||||||
|
const DoctorPostPreImagesContent({this.doctorPrePostImages});
|
||||||
|
|
||||||
|
@override
|
||||||
|
DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var images = widget.doctorPrePostImages;
|
||||||
|
return Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text("Before", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
|
||||||
|
SizedBox(height: 10,),
|
||||||
|
Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){
|
||||||
|
return Container(
|
||||||
|
color: Colors.grey.withOpacity(0.25),
|
||||||
|
);
|
||||||
|
},)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Divider(color: Colors.grey.withOpacity(0.5)),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text("After", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
|
||||||
|
SizedBox(height: 10,),
|
||||||
|
Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){
|
||||||
|
return Container(
|
||||||
|
color: Colors.grey.withOpacity(0.25),
|
||||||
|
);
|
||||||
|
},)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue