178 lines
5.9 KiB
Dart
178 lines
5.9 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:konectar_events/model/eventsmodel.dart';
|
|
import 'package:konectar_events/model/neweventsmodel.dart';
|
|
import 'package:konectar_events/utils/constants.dart';
|
|
import 'package:konectar_events/view/eventdetailstab.dart';
|
|
import 'package:konectar_events/view/eventsdetails.dart';
|
|
import 'package:konectar_events/view/eventslist.dart';
|
|
import 'package:konectar_events/view/insights.dart';
|
|
import 'package:konectar_events/view/socialmedia.dart';
|
|
import 'package:konectar_events/widgets/autocompletetags_widget.dart';
|
|
import 'package:konectar_events/widgets/customactionsheet.dart';
|
|
import 'package:konectar_events/widgets/gridview.dart';
|
|
import 'package:konectar_events/widgets/word_cloud.dart';
|
|
import 'package:word_cloud/word_cloud_data.dart';
|
|
import 'package:word_cloud/word_cloud_shape.dart';
|
|
import 'package:word_cloud/word_cloud_tap.dart';
|
|
import 'package:word_cloud/word_cloud_tap_view.dart';
|
|
import 'package:word_cloud/word_cloud_view.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:add_2_calendar/add_2_calendar.dart';
|
|
|
|
class EventsTab extends StatefulWidget {
|
|
EventsList event;
|
|
EventsTab({super.key, required this.event});
|
|
|
|
@override
|
|
State<EventsTab> createState() => _EventsTabState();
|
|
}
|
|
|
|
class _EventsTabState extends State<EventsTab> {
|
|
int _selectedIndex = 0;
|
|
List<Map> word_list = [
|
|
{'word': 'Apple', 'value': 100.0},
|
|
{'word': 'Samsung', 'value': 60.0},
|
|
{'word': 'Intel', 'value': 55.0},
|
|
{'word': 'Tesla', 'value': 50.0},
|
|
{'word': 'AMD', 'value': 40.0},
|
|
{'word': 'Google', 'value': 35.0},
|
|
{'word': 'Qualcom', 'value': 31.0},
|
|
{'word': 'Spotify', 'value': 14.0},
|
|
{'word': 'Udemy', 'value': 13.0},
|
|
{'word': 'Quizlet', 'value': 13.0},
|
|
{'word': 'Visa', 'value': 12.0},
|
|
{'word': 'Lucid', 'value': 22.0},
|
|
{'word': 'Naver', 'value': 20.0},
|
|
{'word': 'Hyundai', 'value': 16.0},
|
|
{'word': 'KIA', 'value': 16.0},
|
|
{'word': 'twitter', 'value': 16.0},
|
|
{'word': 'Tencent', 'value': 15.0},
|
|
{'word': 'Alibaba', 'value': 15.0},
|
|
{'word': 'Disney', 'value': 14.0},
|
|
{'word': 'Spotify', 'value': 14.0},
|
|
{'word': 'Visa', 'value': 12.0},
|
|
{'word': 'Microsoft', 'value': 10.0},
|
|
{'word': 'TSMC', 'value': 10.0},
|
|
];
|
|
late WordCloudData wcdata;
|
|
int count = 0;
|
|
String wordstring = '';
|
|
void _onItemTapped(int index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
wcdata = WordCloudData(data: word_list);
|
|
super.initState();
|
|
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
// init();
|
|
// });
|
|
}
|
|
|
|
Event buildEvent({Recurrence? recurrence}) {
|
|
return Event(
|
|
title: widget.event.name1!,
|
|
description: widget.event.name1!,
|
|
location: widget.event.region,
|
|
startDate: DateTime.parse(widget.event.start!),
|
|
endDate: DateTime.parse(widget.event.end!),
|
|
allDay: false,
|
|
iosParams: IOSParams(
|
|
reminder: Duration(minutes: 40),
|
|
url: widget.event.url1,
|
|
),
|
|
androidParams: const AndroidParams(
|
|
emailInvites: ["test@aissel.com"],
|
|
),
|
|
recurrence: recurrence,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
wcdata = WordCloudData(data: word_list);
|
|
WordCloudTap wordtaps = WordCloudTap();
|
|
EventsList selectedEvent = widget.event;
|
|
//WordCloudTap Setting
|
|
for (int i = 0; i < word_list.length; i++) {
|
|
void tap() {
|
|
setState(() {
|
|
count += 1;
|
|
wordstring = word_list[i]['word'];
|
|
});
|
|
}
|
|
|
|
wordtaps.addWordtap(word_list[i]['word'], tap);
|
|
}
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(
|
|
SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132)));
|
|
return SafeArea(
|
|
top: false,
|
|
child: Scaffold(
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
backgroundColor: Constants.blueColor,
|
|
type: BottomNavigationBarType.fixed,
|
|
currentIndex: _selectedIndex,
|
|
//backgroundColor: Color.fromARGB(255, 35, 79, 150),
|
|
selectedItemColor: Colors.white,
|
|
unselectedItemColor: const Color.fromARGB(255, 153, 153, 163),
|
|
iconSize: 40,
|
|
onTap: _onItemTapped,
|
|
elevation: 1,
|
|
items: <BottomNavigationBarItem>[
|
|
BottomNavigationBarItem(
|
|
icon: Icon(
|
|
Icons.event,
|
|
size: 18,
|
|
),
|
|
label: 'Details',
|
|
backgroundColor: const Color.fromARGB(255, 168, 170, 173)),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(
|
|
Icons.insights,
|
|
size: 18,
|
|
),
|
|
label: 'Insights',
|
|
backgroundColor: Colors.blue,
|
|
),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(
|
|
Icons.people,
|
|
size: 18,
|
|
),
|
|
label: 'Social Media',
|
|
backgroundColor: Colors.blue,
|
|
),
|
|
// const BottomNavigationBarItem(
|
|
// icon: Icon(
|
|
// Icons.settings,
|
|
// size: 18,
|
|
// ),
|
|
// label: 'Actions',
|
|
// backgroundColor: Color.fromARGB(255, 168, 170, 173),
|
|
// ),
|
|
]),
|
|
body: EventsListingScreen(
|
|
event: selectedEvent,
|
|
)
|
|
// _selectedIndex == 0
|
|
// ? EventsListingScreen(
|
|
// event: selectedEvent,
|
|
// )
|
|
// : _selectedIndex == 1
|
|
// SocialMedia()
|
|
),
|
|
// : EventsListingScreen()),
|
|
);
|
|
}
|
|
}
|