diff --git a/Recording New Feature.mkv b/Recording New Feature.mkv new file mode 100644 index 0000000..8f14cc2 Binary files /dev/null and b/Recording New Feature.mkv differ diff --git a/Recording.mkv b/Recording.mkv new file mode 100644 index 0000000..56408ee Binary files /dev/null and b/Recording.mkv differ diff --git a/lib/task_pages/task16.dart b/lib/task_pages/task16.dart index d0d9b7a..b9825cc 100644 --- a/lib/task_pages/task16.dart +++ b/lib/task_pages/task16.dart @@ -1,4 +1,224 @@ +// ignore_for_file: curly_braces_in_flow_control_structures, prefer_const_constructors, unnecessary_new, prefer_const_literals_to_create_immutables + import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'dart:convert'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:url_launcher/url_launcher.dart'; +import 'dart:async'; +import 'package:url_launcher/link.dart'; + +// @override +// Widget build(BuildContext context) { +// var x = getData(); +// print("Values of x are"); +// print(x); + +// return Scaffold( +// appBar: AppBar( +// title: const Text( +// 'Task-16', +// style: TextStyle(color: Colors.white), +// ), +// backgroundColor: Colors.yellow.shade800, +// elevation: 16, +// leading: IconButton( +// onPressed: () { +// Navigator.of(context).pop(); +// }, +// icon: const Icon( +// Icons.arrow_back, +// color: Colors.white, +// ), +// ), +// ), +// ); +// } +//} + +Future getData() async { + // +// + // + var data1 = { + 'client_id': '8f0c491b37604d0587ecc65bf9557a18', + 'client_secret': '3cb403e55f2348389d31af17cb1e7c70', + 'grant_type': 'refresh_token', + 'refresh_token': + 'AQAuAKP--flXpdWujHuyxJQugSdEiyT9jCsxFbkxR84s95fALy0orVodcNnRKwa12HfgyUWt4LpYXzJcm--n4mTtEoTvIFfDOG5wS0EHO4KmX-c5Rfvj1gK8xQjyj9OL1UY', + 'code': + 'AQAEEcAHkWYTh32OY2SKyiwsMSFWA03T2dcWw1fIcM24FtB_4eR_PImscKgpcNGmkQoQSXlclA-8Y7n9OF62WbyHx5cJ4VSEGqqj13BR4JiVYkhT796ffidYtUMc42nc33SV5_6ppLnVcOvoBvx4scX91jEZvlLzfJWL8P9kJokfzbDLDGOLxqUgFd2yHvrSBuIGrpmRQQ', + 'redirect_uri': 'http://example.com/callback/', + }; + + var url1 = Uri.parse('https://accounts.spotify.com/api/token'); + var res1 = await http.post(url1, body: data1); + if (res1.statusCode != 200) + throw Exception('http.post error: statusCode= ${res1.statusCode}'); + print(res1.body); + final parsed1 = json.decode(res1.body).cast(); + print(parsed1['access_token']); + print(parsed1['refresh_token']); + + var Bearer = parsed1['access_token']; + + // + // + + var headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Bearer $Bearer', + }; + //try { + var url = Uri.parse('https://api.spotify.com/v1/me/playlists'); + var res = await http.get(url, headers: headers); + if (res.statusCode != 200) + throw Exception('http.get error: statusCode= ${res.statusCode}'); + + final parsed = json.decode(res.body).cast(); + var total = parsed['total']; + List playlist_links = []; + List playlist_name = []; + List playlist_likes = []; + List playlist_song_count = []; + List playlist_pic_link = []; + List playlist_spotify_link = []; + + //FOR COLLECTING LINKS AND NAMES OF " P L A Y L I S T S" + + for (int i = 1; i <= total; i++) { + //print(); + playlist_links.add(parsed['items'][i - 1]['href']); + playlist_name.add(parsed['items'][i - 1]['name']); + playlist_spotify_link + .add(parsed['items'][i - 1]['external_urls']['spotify']); + try { + playlist_pic_link.add(parsed['items'][i - 1]['images'][0]['url']); + } catch (s) { + playlist_pic_link.add( + "https://images-na.ssl-images-amazon.com/images/I/61E1238sN%2BL.__AC_SY300_QL70_ML2_.jpg"); + } + ; + //print('\n\n'); + } + print(playlist_pic_link); + + //FOR COLLECTING LIKES OF " P L A Y L I S T S" + + for (int i = 1; i <= total; i++) { + var link = playlist_links[i - 1]; + var url_temp = Uri.parse(link); + var res_temp = await http.get(url_temp, headers: headers); + if (res_temp.statusCode != 200) + throw Exception('http.get error: statusCode= ${res_temp.statusCode}'); + //print(res.body); + final parsed = json.decode(res_temp.body).cast(); + playlist_likes.add(parsed['followers']['total']); + } + + //TODO : FIND NUMBER OF SONGS IN EACH PLAYLIST + + for (int i = 1; i <= total; i++) { + var link = playlist_links[i - 1] + "/tracks"; + var url_temp = Uri.parse(link); + var res_temp = await http.get(url_temp, headers: headers); + if (res_temp.statusCode != 200) + throw Exception('http.get error: statusCode= ${res_temp.statusCode}'); + final parsed = json.decode(res_temp.body).cast(); + playlist_song_count.add(parsed['total']); + } + + // print(total); + // print(playlist_links); + // print(playlist_name); + // print(playlist_likes); + // print(playlist_song_count); + + final pl_count = total; + final pl_links_api = playlist_links; + final pl_names = playlist_name; + final pl_likes = playlist_likes; + final pl_song_cnt = playlist_song_count; + final pl_image_link = playlist_pic_link; + final pl_links_spotify = playlist_spotify_link; + print(pl_links_spotify); + print( + pl_count, + ); + print( + pl_names, + ); + print( + pl_likes, + ); + print( + pl_song_cnt, + ); + print( + pl_image_link, + ); + + var output = { + "Total Play Lists": pl_count, + "Play List Names": pl_names, + "Play List Likes": pl_likes, + "Total Song Count": pl_song_cnt, + "Play List Image Link": pl_image_link, + "Play List Link": pl_links_spotify, + }; + //print(pl_image_link); + return await output; + // } catch (exc) { + // print("Error: $exc"); + // // var output = { + // // "Total Play Lists": 7, + // // "Play List Names": [ + // // "Latest Telugu", + // // "City Back to Kasi", + // // "Bollywood Acoustic", + // // "REM sleep", + // // "Top 50 - India", + // // "Hi", + // // "Telugu Romance" + // // ], + // // "Play List Likes": [205129, 12178, 149110, 60092, 287940, 0, 78732], + // // "Total Song Count": [70, 60, 47, 44, 50, 11, 101], + // // "Play List Image Link": [ + // // "https://i.scdn.co/image/ab67706f000000032cfa1cc4381a707accda25c6", + // // "https://i.scdn.co/image/ab67706f00000003b9ccf87dfaad821588fcf41c", + // // "https://i.scdn.co/image/ab67706f0000000373b6bd23c3a67f83b4acc521", + // // "https://i.scdn.co/image/ab67706f00000003ef48a5a9c020069725ca9ee2", + // // "https://charts-images.scdn.co/assets/locale_en/regional/daily/region_in_large.jpg", + // // "https://mosaic.scdn.co/640/ab67616d0000b27355d06097244512041e6877d6ab67616d0000b27363118748c712b6ac32c0feecab67616d0000b2736f3d477e1f31b354c5de3d56ab67616d0000b273c45f8ae0957ab4b8c45dd4fc", + // // "https://i.scdn.co/image/ab67706f00000003895e50c186f1ca4de90975fc" + // // ], + // // }; + // print("1"); + // // return await output; + // } +} + +// Future getData() async { +// var headers = { +// 'Accept': 'application/json', +// 'Content-Type': 'application/json', +// 'Authorization': +// 'Bearer BQAwVKkZcEBkvoiUMOwp3M7vvesrMVGGDQv2FpvXp1A1e-kEfzB3mih-Fy-A1we0BV0ahiFTUgSicsJkMkiC7Yi59SvdzgrOlYqtFvUhx1UVYdk4QunPSDFbDKDfCuJ7UYeAhjkCH_5qzVJ_EGOpHYd7OHSSuSncjQmkA-R0HhUpFj07zDWt17kHagiz7Uc-8iS3C0La7W6Nr_19-PGOriBHwyb5FJ-8', +// }; + +// try { +// var url = Uri.parse( +// 'https://api.spotify.com/v1/playlists/37i9dQZEVXbLZ52XmnySJg/tracks'); +// var res = await http.get(url, headers: headers); +// if (res.statusCode != 200) +// throw Exception('http.get error: statusCode= ${res.statusCode}'); +// return(res.body); +// } catch (exc) { +// print("Error: $exc"); +// return "null"; +// } +// } class TaskSixteen extends StatefulWidget { const TaskSixteen({Key? key}) : super(key: key); @@ -7,28 +227,680 @@ class TaskSixteen extends StatefulWidget { _TaskDashboardState createState() => _TaskDashboardState(); } - class _TaskDashboardState extends State { + Map? dataFuture; + Future? _launched; + + final List data = [ + BarChartModel( + year: "2014", + financial: 250, + color: charts.ColorUtil.fromDartColor(Colors.black)), + BarChartModel( + year: "2015", + financial: 450, + color: charts.ColorUtil.fromDartColor(Colors.green)) + ]; + final List likeData = []; + final List songData = []; + + _TaskDashboardState() { + getData().then((value) => setState(() { + dataFuture = value; + })); + } + + Future _launchInBrowser(String url) async { + if (!await launch( + url, + forceSafariVC: false, + forceWebView: false, + headers: {'my_header_key': 'my_header_value'}, + )) { + throw 'Could not launch $url'; + } + } + // @override + // void initState() { + // super.initState(); + + // dataFuture = getData(); + // } + @override + //Widget build(BuildContext context) { + // print(dataFuture?.then((value) => x = value)); + // print(x); + // print(dataFuture?.then((value) => x = value)); + //print(dataFuture); Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text( - 'Task-16', - style: TextStyle(color: Colors.white), + final pl_count = dataFuture?["Total Play Lists"]; + final pl_names = dataFuture?["Play List Names"]; + final pl_likes = dataFuture?["Play List Likes"]; + final pl_song_cnt = dataFuture?["Total Song Count"]; + final pl_picture = dataFuture?["Play List Image Link"]; + final pl_link = dataFuture?["Play List Link"]; + + print(dataFuture); + while (pl_count == null) { + return Scaffold( + appBar: AppBar( + title: const Text( + 'Task-16', + style: TextStyle(color: Colors.white), + ), + backgroundColor: Colors.yellow.shade800, + elevation: 16, + leading: IconButton( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: const Icon( + Icons.arrow_back, + color: Colors.white, + ), + ), ), - backgroundColor: Colors.yellow.shade800, - elevation: 16, - leading: IconButton( - onPressed: () { - Navigator.of(context).pop(); - }, - icon: const Icon( - Icons.arrow_back, - color: Colors.white, + body: Center(child: CircularProgressIndicator()), + ); + } + + for (int index = 1; index <= pl_count; index++) + likeData.add(BarChartModelLikes( + name: "$index", //pl_names[index - 1], + likes: pl_likes[index - 1], + color: charts.ColorUtil.fromDartColor(Colors.green))); + for (int index = 1; index <= pl_count; index++) + songData.add(BarChartModelSongs( + name: "$index", //pl_names[index - 1], + songs: pl_song_cnt[index - 1], + color: charts.ColorUtil.fromDartColor(Colors.green))); + + List> series = [ + charts.Series( + id: "Finanacial", + data: data, + domainFn: (BarChartModel series, _) => series.year, + measureFn: (BarChartModel series, _) => series.financial, + colorFn: (BarChartModel series, _) => series.color, + ), + ]; + + List> seriesLikes = [ + charts.Series( + id: "Likes", + data: likeData, + domainFn: (BarChartModelLikes seriesLikes, _) => seriesLikes.name, + measureFn: (BarChartModelLikes seriesLikes, _) => seriesLikes.likes, + colorFn: (BarChartModelLikes seriesLikes, _) => seriesLikes.color, + ), + ]; + + List> seriesSongs = [ + charts.Series( + id: "Number of Songs", + data: songData, + domainFn: (BarChartModelSongs seriesSongs, _) => seriesSongs.name, + measureFn: (BarChartModelSongs seriesSongs, _) => seriesSongs.songs, + colorFn: (BarChartModelSongs seriesSongs, _) => seriesSongs.color, + ), + ]; + return MaterialApp( + home: DefaultTabController( + length: 4, + child: Scaffold( + appBar: AppBar( + //automaticallyImplyLeading: false, + bottom: const TabBar( + tabs: [ + Tab( + icon: Icon(Icons.audiotrack), + ), + Tab(icon: Icon(Icons.favorite)), + Tab(icon: Icon(Icons.mic_external_on)), + Tab(icon: Icon(Icons.info)), + ], + ), + title: Text( + 'Task-16', + style: TextStyle(color: Colors.white), + ), + backgroundColor: Colors.yellow.shade800, + elevation: 16, + leading: IconButton( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: const Icon( + Icons.arrow_back, + color: Colors.white, + ), + ), ), + body: TabBarView( + children: [ + Scaffold( + appBar: AppBar( + title: Center(child: Text("Saved Playlists")), + backgroundColor: Colors.yellow.shade800, + ), + body: Scrollbar( + child: ListView( + restorationId: 'list_demo_list_view', + padding: + const EdgeInsets.symmetric(vertical: 8, horizontal: 8), + children: [ + for (int index = 1; index <= pl_count; index++) + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Padding( + padding: const EdgeInsets.all(0.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(1.0), + // child: ListTile( + // leading: ExcludeSemantics( + // child: Image.network(pl_picture[index - 1]), + // ), + // title: Text( + // pl_names[index - 1], + // ), + // ), + //child: Image.network(pl_picture[index - 1]), + ), + Padding( + padding: + const EdgeInsets.symmetric(vertical: 5.0), + child: Container( + height: 130.0, + width: 130.0, + decoration: BoxDecoration( + image: DecorationImage( + image: + NetworkImage(pl_picture[index - 1]), + fit: BoxFit.fill, + ), + ), + ), + ), + //child: Image(image: NetworkImage(pl_picture[index - 1]))), + Container( + child: Padding( + padding: const EdgeInsets.all(14.0), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // Container( + // height: 170.0, + // width: 170.0, + // child: Text( + // pl_names[index - 1], + // ), + // ) + Container( + child: Text( + "${pl_names[index - 1]}", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18), + overflow: TextOverflow.ellipsis, + ), + ), + + SizedBox( + width: 80, + ), + Container( + child: Flexible( + child: Text( + "Likes : ${pl_likes[index - 1]}", + overflow: + TextOverflow.ellipsis, + ), + ), + ), + Container( + child: Flexible( + child: Text( + "Number of Songs : ${pl_song_cnt[index - 1]}", + overflow: + TextOverflow.ellipsis, + ), + ), + ), + ElevatedButton( + onPressed: () => setState(() { + _launched = _launchInBrowser( + '${pl_link[index - 1]}'); + }), + child: + const Text('Open in Browser'), + ), + ]), + ), + ), + ) + ], + ), + ), + ), + ], + ), + ), + ), + Scaffold( + appBar: AppBar( + title: Center(child: Text("Number Of Likes")), + backgroundColor: Colors.yellow.shade800, + ), + body: Scrollbar( + child: ListView( + restorationId: 'list_demo_list_view', + padding: + const EdgeInsets.symmetric(vertical: 8, horizontal: 8), + children: [ + Container( + height: 500, + width: 100, + padding: const EdgeInsets.all(10), + child: charts.BarChart( + seriesLikes, + animate: true, + behaviors: [ + new charts.SeriesLegend( + position: charts.BehaviorPosition.top, + horizontalFirst: false, + cellPadding: + new EdgeInsets.only(right: 4.0, bottom: 4.0), + showMeasures: true, + ) + ], + ), + ), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + child: DataTable(columns: [ + DataColumn( + label: Text('ID', + //overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Playlist Name', + //overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Number Of Likes', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Number Of Songs', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + ], rows: [ + for (int index = 1; index <= pl_count; index++) + DataRow(cells: [ + DataCell(Text('$index')), + DataCell(Text('${pl_names[index - 1]}')), + DataCell(Text('${pl_likes[index - 1]}')), + DataCell(Text('${pl_song_cnt[index - 1]}')), + ]), + ]), + ), + ), + ], + ), + ), + ), + Scaffold( + appBar: AppBar( + title: Center(child: Text("Number Of Songs In Playlists")), + backgroundColor: Colors.yellow.shade800, + ), + body: Scrollbar( + child: ListView( + restorationId: 'list_demo_list_view', + padding: + const EdgeInsets.symmetric(vertical: 8, horizontal: 8), + children: [ + Container( + height: 500, + width: 100, + padding: const EdgeInsets.all(10), + child: charts.BarChart( + seriesSongs, + animate: true, + behaviors: [ + new charts.SeriesLegend( + position: charts.BehaviorPosition.top, + horizontalFirst: false, + cellPadding: + new EdgeInsets.only(right: 4.0, bottom: 4.0), + showMeasures: true, + ) + ], + ), + ), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + child: DataTable(columns: [ + DataColumn( + label: Text('ID', + //overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Playlist Name', + //overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Number Of Likes', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Number Of Songs', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + ], rows: [ + for (int index = 1; index <= pl_count; index++) + DataRow(cells: [ + DataCell(Text('$index')), + DataCell(Text('${pl_names[index - 1]}')), + DataCell(Text('${pl_likes[index - 1]}')), + DataCell(Text('${pl_song_cnt[index - 1]}')), + ]), + ]), + ), + ), + ], + ), + ), + ), + Scaffold( + appBar: AppBar( + backgroundColor: Colors.transparent, + elevation: 0, + title: Center( + child: Text( + "Info", + style: TextStyle( + color: Colors.black, // 2 + ), + )), + ), + body: Scrollbar( + child: ListView( + restorationId: 'list_demo_list_view', + padding: + const EdgeInsets.symmetric(vertical: 8, horizontal: 8), + children: [ + Text("The data is Scrollable in both axis"), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + child: DataTable(columns: [ + DataColumn( + label: Text('ID', + //overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Playlist Name', + //overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Number Of Likes', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Number Of Songs', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold))), + ], rows: [ + for (int index = 1; index <= pl_count; index++) + DataRow(cells: [ + DataCell(Text('$index')), + DataCell(Text('${pl_names[index - 1]}')), + DataCell(Text('${pl_likes[index - 1]}')), + DataCell(Text('${pl_song_cnt[index - 1]}')), + ]), + ]), + ), + ), + ], + ), + ), + ), + //Icon(Icons.directions_car), + //Icon(Icons.directions_transit), + //Icon(Icons.directions_bike), + ], + ), + // body: Scrollbar( + // child: ListView( + // restorationId: 'list_demo_list_view', + // padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 8), + // children: [ + // Container( + // height: 500, + // width: 100, + // padding: const EdgeInsets.all(10), + // child: charts.BarChart( + // seriesLikes, + // animate: true, + // behaviors: [ + // new charts.SeriesLegend( + // position: charts.BehaviorPosition.top, + // horizontalFirst: false, + // cellPadding: + // new EdgeInsets.only(right: 4.0, bottom: 4.0), + // showMeasures: true, + // ) + // ], + // ), + // ), + // Container( + // height: 500, + // width: 100, + // padding: const EdgeInsets.all(10), + // child: charts.BarChart( + // seriesSongs, + // animate: true, + // behaviors: [ + // new charts.SeriesLegend( + // position: charts.BehaviorPosition.top, + // horizontalFirst: false, + // cellPadding: + // new EdgeInsets.only(right: 4.0, bottom: 4.0), + // showMeasures: true, + // ) + // ], + // ), + // ), + // // Container( + // // margin: EdgeInsets.all(20), + // // child: Table( + // // defaultColumnWidth: FixedColumnWidth(120.0), + // // border: TableBorder.all( + // // color: Colors.black, style: BorderStyle.solid, width: 2), + // // children: [ + // // TableRow(children: [ + // // Column(children: [ + // // Text('Playlist Name', style: TextStyle(fontSize: 15.0)) + // // ]), + // // Column(children: [ + // // Text('Playlist ID', style: TextStyle(fontSize: 15.0)) + // // ]), + // // Column(children: [ + // // Text('Number Of Likes', style: TextStyle(fontSize: 15.0)) + // // ]), + // // ]), + // // TableRow(children: [ + // // Column(children: [Text('Javatpoint')]), + // // Column(children: [Text('Flutter')]), + // // Column(children: [Text('5*')]), + // // ]), + // // TableRow(children: [ + // // Column(children: [Text('Javatpoint')]), + // // Column(children: [Text('MySQL')]), + // // Column(children: [Text('5*')]), + // // ]), + // // TableRow(children: [ + // // Column(children: [Text('Javatpoint')]), + // // Column(children: [Text('ReactJS')]), + // // Column(children: [Text('5*')]), + // // ]), + // // for (int index = 1; index <= pl_count; index++) + // // TableRow(children: [ + // // Column(children: [Text('${pl_names[index - 1]}')]), + // // Column(children: [Text('$index')]), + // // Column(children: [Text('${pl_likes[index - 1]}')]), + // // ]), + // // ], + // // ), + // // ), + // SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: Container( + // child: DataTable(columns: [ + // DataColumn( + // label: Text('ID', + // //overflow: TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 15, fontWeight: FontWeight.bold))), + // DataColumn( + // label: Text('Playlist Name', + // //overflow: TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 15, fontWeight: FontWeight.bold))), + // DataColumn( + // label: Text('Number Of Likes', + // overflow: TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 15, fontWeight: FontWeight.bold))), + // DataColumn( + // label: Text('Number Of Songs', + // overflow: TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 15, fontWeight: FontWeight.bold))), + // ], rows: [ + // for (int index = 1; index <= pl_count; index++) + // DataRow(cells: [ + // DataCell(Text('$index')), + // DataCell(Text('${pl_names[index - 1]}')), + // DataCell(Text('${pl_likes[index - 1]}')), + // DataCell(Text('${pl_song_cnt[index - 1]}')), + // ]), + // ]), + // ), + // ), + // for (int index = 1; index <= pl_count; index++) + // Padding( + // padding: const EdgeInsets.all(0.0), + // child: Row( + // children: [ + // Padding( + // padding: const EdgeInsets.all(1.0), + // // child: ListTile( + // // leading: ExcludeSemantics( + // // child: Image.network(pl_picture[index - 1]), + // // ), + // // title: Text( + // // pl_names[index - 1], + // // ), + // // ), + // //child: Image.network(pl_picture[index - 1]), + // ), + // Padding( + // padding: const EdgeInsets.symmetric(vertical: 5.0), + // child: Container( + // height: 170.0, + // width: 170.0, + // decoration: BoxDecoration( + // image: DecorationImage( + // image: NetworkImage(pl_picture[index - 1]), + // fit: BoxFit.fill, + // ), + // ), + // ), + // ), + // //child: Image(image: NetworkImage(pl_picture[index - 1]))), + // Column(children: [ + // // Container( + // // height: 170.0, + // // width: 170.0, + // // child: Text( + // // pl_names[index - 1], + // // ), + // // ) + + // Text(pl_names[index - 1]), + // Text("Likes : ${pl_likes[index - 1]}"), + // Text("Number of Songs : ${pl_song_cnt[index - 1]}") + // ]) + // ], + // ), + // ), + // ], + // ), + // ), ), ), ); } -} \ No newline at end of file +} + +class BarChartModel { + String year; + int financial; + final charts.Color color; + + BarChartModel( + {required this.year, required this.financial, required this.color}); +} + +class BarChartModelLikes { + String name; + int likes; + final charts.Color color; + + BarChartModelLikes( + {required this.name, required this.likes, required this.color}); +} + +class BarChartModelSongs { + String name; + int songs; + final charts.Color color; + + BarChartModelSongs( + {required this.name, required this.songs, required this.color}); +} diff --git a/pubspec.lock b/pubspec.lock index af07b70..947e221 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,6 +29,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" clock: dependency: transitive description: @@ -79,6 +93,27 @@ packages: description: flutter source: sdk version: "0.0.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" js: dependency: transitive description: @@ -93,6 +128,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index afa30f8..c8622e6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,6 +35,8 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 url_launcher: ^6.0.20 + http: ^0.13.4 + charts_flutter: ^0.12.0 dev_dependencies: flutter_test: