KonectarEvents/lib/contacts_module/ui_screen/email_show_more.dart

110 lines
3.7 KiB
Dart

// import 'package:konectar_events/provider_class/email_provider.dart';
// import 'package:konectar_events/ui_screen/bottom_sheet.dart';
import 'package:konectar_events/contacts_module/provider_class/email_provider.dart';
import 'package:konectar_events/contacts_module/ui_screen/bottom_sheet.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class EmailShowMore extends StatefulWidget {
EmailShowMore({required this.text, Key? key}) : super(key: key);
final int text;
@override
State<EmailShowMore> createState() => _EmailShowMoreState();
}
class _EmailShowMoreState extends State<EmailShowMore> {
@override
List emailid = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
var email = Provider.of<EmailProvider>(context, listen: false);
await email.emailinfo(widget.text);
final emailno1 = email.emailkollist;
setState(() {
emailid = emailno1;
});
print("locationList: ${emailid}");
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Emails'),
),
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('Email Type',
style: TextStyle(fontWeight: FontWeight.w600),
softWrap: true),
)),
DataColumn(
label: Expanded(
child: Text('Email',
style:
TextStyle(fontWeight: FontWeight.w600)))),
],
rows: List.generate(
emailid.length,
(index) => DataRow(
onSelectChanged: (value) {
print("message ${emailid[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(emailid[index]);
},
);
},
cells: [
DataCell(Text(emailid[index]['Email Type'].toString(),
softWrap: true)),
DataCell(Text(emailid[index]['Email'].toString(),
softWrap: true)),
],
),
),
),
),
),
),
));
}
}