DiscoverModule/lib/contacts_module/ui_screen/pro_show_more.dart

110 lines
3.8 KiB
Dart
Raw Normal View History

2024-10-07 12:41:28 +00:00
// import 'package:discover_module/provider_class/procedureprovider.dart';
// import 'package:discover_module/ui_screen/bottom_sheet.dart';
import 'package:discover_module/contacts_module/provider_class/procedureprovider.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 ProShowMore extends StatefulWidget {
ProShowMore({required this.text, Key? key}) : super(key: key);
final int text;
@override
State<ProShowMore> createState() => _ProShowMoreState();
}
class _ProShowMoreState extends State<ProShowMore> {
List procedure = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
var pro = Provider.of<ProcedureProvider>(context, listen: false);
await pro.proinfo(widget.text);
final pro1 = pro.prolist;
setState(() {
procedure = pro1;
});
print("locationList: ${procedure}");
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Procedures'),
),
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('Program Year',
style: TextStyle(fontWeight: FontWeight.w600),
softWrap: true),
)),
DataColumn(
label: Expanded(
child: Text('Procedure',
style:
TextStyle(fontWeight: FontWeight.w600)))),
],
rows: List.generate(
procedure.length,
(index) => DataRow(
onSelectChanged: (value) {
print("message ${procedure[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(procedure[index]);
},
);
},
cells: [
DataCell(Text(procedure[index]['Procedure'].toString(),
softWrap: true)),
DataCell(Text(
procedure[index]['Place of Service'].toString(),
softWrap: true)),
],
),
),
),
),
),
),
));
}
}