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-moe/lib/ui/screens/profile/widgets/profile_info.dart

123 lines
4.0 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ProfileInFo extends StatelessWidget {
String data = '.';
double sliderValue = 75;
List<ProfileMenu> menu = [
ProfileMenu(name: 'Personal information', icon: ''),
ProfileMenu(name: 'Basic Details', icon: ''),
ProfileMenu(name: 'Family Details', icon: ''),
];
@override
Widget build(BuildContext context) {
return Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
/// card header
customLabel('Sultan khan', 22, Colors.black, true),
customLabel('217869 | Software Developer', 14, Colors.grey, false),
customLabel('sultan.khan@cloudsolutions.com.sa', 13, Colors.black, true),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
customLabel('We appreciates you for completing the service of', 10, Colors.black, true),
SizedBox(height: 10),
Container(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [
Column(
children: [customLabel('Years', 14, const Color(0xff808080), true), customLabel('03', 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel('Month', 14, const Color(0xff808080), true), customLabel('06', 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel('Day', 14, const Color(0xff808080), true), customLabel('20', 22, Color(0xff2BB8A6), true)],
)
])),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
Container(
padding: EdgeInsets.only(
left: 20,
right: 20,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
customLabel('Profile Completion 75%', 18, Colors.black, true),
const SizedBox(height: 10),
Row(
children: [
for (var i = 0; i < 4; i++)
if (i < 3) Expanded(child: drawSlider(Color(0xff2BB8A6))) else Expanded(child: drawSlider(const Color(0xffefefef)))
],
),
const SizedBox(height: 10),
Text(
'Complete Profile',
style: TextStyle(color: Color(0xff2BB8A6), fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
),
],
)),
/// description
Divider(height: 50, thickness: 8, color: const Color(0xffefefef)),
Column(
children: menu.map((i) => rowItem(i, context)).toList(),
)
]));
}
Widget drawSlider(color) {
return Row(children: [
Expanded(
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Container(
height: 6,
width: 20,
color: color,
),
)),
Container(height: 6, width: 3, color: Colors.white),
]);
}
Widget rowItem(obj, context) {
return InkWell(
onTap: () {
// Navigator.pushNamed(
// context,
// AppRoutes.addEitScreen,
// arguments: obj,
// );
},
child: ListTile(
leading: FlutterLogo(),
title: Text(obj.name),
trailing: Icon(Icons.arrow_forward),
),
);
}
Widget customLabel(String label, double size, Color color, bool isBold, {double padding = 0.0}) => Container(
padding: EdgeInsets.all(padding),
// height: 50,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))]));
}
class ProfileMenu {
final String name;
final String icon;
ProfileMenu({this.name = '', this.icon = ''});
}