DiscoverModule/lib/contacts_module/ui_screen/edu_show_more.dart

113 lines
3.9 KiB
Dart
Raw Permalink Normal View History

2024-10-07 12:41:28 +00:00
// import 'package:discover_module/provider_class/educationprovider.dart';
// import 'package:discover_module/ui_screen/bottom_sheet.dart';
import 'package:discover_module/contacts_module/provider_class/educationprovider.dart';
import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart';
2024-08-30 12:24:54 +00:00
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class EducationShowMore extends StatefulWidget {
EducationShowMore({required this.text, Key? key}) : super(key: key);
final int text;
@override
State<EducationShowMore> createState() => _EducationShowMoreState();
}
class _EducationShowMoreState extends State<EducationShowMore> {
@override
List education = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
var edu = Provider.of<EducationProvider>(context, listen: false);
await edu.eduinfo(widget.text);
final edu1 = edu.educationlist;
setState(() {
education = edu1;
});
print("locationList: ${education}");
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Education'),
),
body: Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Container(
constraints:
BoxConstraints(minWidth: MediaQuery.of(context).size.width),
color: Colors.white,
child: DataTable(
showCheckboxColumn: false,
columns: const [
DataColumn(
label: Expanded(
child: Text('Education Type',
style: TextStyle(fontWeight: FontWeight.w600),
softWrap: true),
)),
DataColumn(
label: Expanded(
child: Text('Institution Name',
style:
TextStyle(fontWeight: FontWeight.w600)))),
],
rows: List.generate(
education.length,
(index) => DataRow(
onSelectChanged: (value) {
print("message ${education[index]}");
showModalBottomSheet(
useRootNavigator: true,
isScrollControlled: false,
enableDrag: true,
useSafeArea: true,
constraints: const BoxConstraints(
maxWidth: double.infinity,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(0),
),
),
clipBehavior: Clip.antiAliasWithSaveLayer,
context: context,
builder: (context) {
return bsheet(education[index]);
},
);
},
cells: [
DataCell(Text(
education[index]['Education Type'].toString(),
softWrap: true)),
DataCell(Text(
education[index]['Institution Name'].toString(),
softWrap: true)),
],
),
),
),
),
),
),
));
}
}