KonectarEvents/lib/view/eventsdetails.dart

161 lines
5.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/widgets/custombutton.dart';
import 'package:konectar_events/widgets/customeventsappbar.dart';
import 'package:konectar_events/widgets/eventdetailscontainer.dart';
import 'package:konectar_events/widgets/eventdetailslistview.dart';
class EventsDetails extends StatefulWidget {
const EventsDetails({super.key});
@override
State<EventsDetails> createState() => _EventsDetailsState();
}
class _EventsDetailsState extends State<EventsDetails> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: EventsAppBar(),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: LayoutBuilder(builder:
(BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: viewportConstraints.maxHeight,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: EventDetailsContainer(
isEventDetail: true,
),
),
expandableDetails(),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Event Speakers',
style: TextStyle(
fontSize: isTablet ? 18 : 16,
fontWeight: FontWeight.bold),
),
CustomButton(
backgroundColor: Colors.green,
onPressed: () {},
textColor: Colors.black,
title: "Add To My Contacts",
fontsize: 16,
)
// const SizedBox(
// width: 10,
// ),
//
],
),
),
EventsDetailsDataTable(),
],
),
),
);
}),
),
);
}
Widget expandableDetails() {
return isTablet
? Container(
margin: EdgeInsets.symmetric(vertical: 20.0),
height: 200.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
_topicCard("Top 3 topics",
" 1. Hematologic Neoplasms \n 2. Antibodies, Bispecific \n 3. Multiple Myeloma"),
_topicCard("Speakers with most sessions",
" 1. James A. Davis \n 2. Sandra Cuellar \n 3. Allison Butts"),
_topicCard("Sponsors",
" 1. Amgen Inc \n 2. Bristol-Myers Squibb Company \n 3. Genmab A/S")
],
))
: SizedBox(
height: MediaQuery.of(context).size.height * 0.45,
child: Column(children: [
listViewTopicCard("Top 3 topics",
" 1. Hematologic Neoplasms \n 2. Antibodies, Bispecific \n 3. Multiple Myeloma"),
listViewTopicCard("Speakers with most sessions",
" 1. James A. Davis \n 2. Sandra Cuellar \n 3. Allison Butts"),
listViewTopicCard("Sponsors",
" 1. Amgen Inc \n 2. Bristol-Myers Squibb Company \n 3. Genmab A/S ")
]),
);
}
Widget _topicCard(String title, String content) {
return SizedBox(
width: MediaQuery.of(context).size.width / 3.2,
child: Card(
child: Padding(
padding: const EdgeInsets.only(top: 18.0, left: 3.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Text(
title,
style: TextStyle(fontSize: 16),
maxLines: 2,
),
),
SizedBox(
height: 20,
),
Text(
content,
style: TextStyle(fontSize: 16),
maxLines: 6,
),
],
),
),
),
);
}
Widget listViewTopicCard(String title, String content) {
return Container(
width: double.infinity,
padding: EdgeInsets.all(10.0),
child: Card(
elevation: 2.0,
child: Theme(
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(child: Text(title)),
Text(
content,
style: TextStyle(fontSize: 16),
),
],
),
),
),
);
}
}