You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-app/lib/ui/screens/profile/profile_screen.dart

102 lines
3.8 KiB
Dart

import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/ui/screens/profile/widgets/header.dart';
import 'package:mohem_flutter_app/ui/screens/profile/widgets/profile_panel.dart';
class ProfileScreen extends StatefulWidget {
const ProfileScreen({Key? key}) : super(key: key);
@override
_ProfileScreenState createState() => _ProfileScreenState();
}
class _ProfileScreenState extends State<ProfileScreen> {
late MemberInformationListModel memberInformationList;
List<GetEmployeeBasicDetailsList> getEmployeeBasicDetailsList = [];
@override
void initState() {
super.initState();
memberInformationList = AppState().memberInformationList!;
//getEmployeeBasicDetails();
}
@override
Widget build(BuildContext context) {
return Scaffold(
extendBody: true,
backgroundColor: const Color(0xffefefef),
body: Stack(children: [
Container(
height: 300,
margin: EdgeInsets.only(top: 50),
decoration: BoxDecoration(image: DecorationImage(image: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)), fit: BoxFit.cover)),
child: new BackdropFilter(
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(
decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)),
),
)),
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
SizedBox(
height: 80,
),
Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
)),
InkWell(
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.black.withOpacity(.3)),
child: Row(children: [
Icon(Icons.photo, color: Colors.white),
Text(
'Edit',
style: TextStyle(color: Colors.white, fontSize: 12),
)
]))),
],
)),
HeaderPanel(memberInformationList),
ProfilePanle(memberInformationList)
]),
)
]));
}
void getEmployeeBasicDetails() async {
try {
Utils.showLoading(context);
getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails();
Utils.hideLoading(context);
//basicDetails();
print("getEmployeeBasicDetailsList.length");
print(getEmployeeBasicDetailsList.length);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
}