DiscoverModule/lib/contacts_module/ui_screen/awardshowmore.dart

111 lines
3.7 KiB
Dart
Raw Normal View History

2024-10-07 12:41:28 +00:00
// import 'package:discover_module/provider_class/award_provider.dart';
// import 'package:discover_module/ui_screen/bottom_sheet.dart';
import 'package:discover_module/contacts_module/provider_class/award_provider.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 AwardShowMore extends StatefulWidget {
AwardShowMore({required this.text, Key? key}) : super(key: key);
final int text;
@override
State<AwardShowMore> createState() => _AwardShowMoreState();
}
class _AwardShowMoreState extends State<AwardShowMore> {
List award = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
var awa = Provider.of<AwardProvider>(context, listen: false);
await awa.awainfo(widget.text);
final awa1 = awa.awardlist;
setState(() {
award = awa1;
});
print("locationList: ${award}");
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Awards'),
),
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(
award.length,
(index) => DataRow(
onSelectChanged: (value) {
print("message ${award[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(award[index]);
},
);
},
cells: [
DataCell(Text(award[index]['Education Type'].toString(),
softWrap: true)),
DataCell(Text(
award[index]['Institution Name'].toString(),
softWrap: true)),
],
),
),
),
),
),
),
));
}
}