|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
@ -7,8 +8,6 @@ import 'package:http/http.dart' as http;
|
|
|
|
|
import 'package:syncfusion_flutter_datagrid/datagrid.dart';
|
|
|
|
|
import 'package:syncfusion_flutter_core/theme.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:global_configuration/global_configuration.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:multimedia/data/tvshows.dart';
|
|
|
|
|
|
|
|
|
|
Color _kColorInit = const Color.fromARGB(255, 192, 192, 192);
|
|
|
|
|
@ -30,10 +29,18 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
List<GridColumn> _columns = [];
|
|
|
|
|
|
|
|
|
|
Future<List<TVShow>> generateTVShowList() async {
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
|
|
|
|
|
|
|
|
String? dbProtocol = prefs.getString('dbProtocol');
|
|
|
|
|
String? dbHost = prefs.getString('dbHost');
|
|
|
|
|
String? dbPath = prefs.getString('dbPath');
|
|
|
|
|
|
|
|
|
|
print(dbHost);
|
|
|
|
|
|
|
|
|
|
Uri url = Uri(
|
|
|
|
|
scheme: GlobalConfiguration().getValue('dbProtocol'),
|
|
|
|
|
host: GlobalConfiguration().getValue('dbHost'),
|
|
|
|
|
path: GlobalConfiguration().getValue('dbPath'),
|
|
|
|
|
scheme: dbProtocol,
|
|
|
|
|
host: dbHost,
|
|
|
|
|
path: dbPath,
|
|
|
|
|
queryParameters: {
|
|
|
|
|
'module': 'tvshow',
|
|
|
|
|
'function': 'getList',
|
|
|
|
|
@ -110,6 +117,13 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('Resolution'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
columnName: 'season1',
|
|
|
|
|
columnWidthMode: ColumnWidthMode.auto,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('Season 1'))),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -173,6 +187,7 @@ class TVShowDataSource extends DataGridSource {
|
|
|
|
|
value: DateFormat('yyyy-MM-dd').format(e.firstAired)),
|
|
|
|
|
DataGridCell<String>(
|
|
|
|
|
columnName: 'resolution', value: e.resolution),
|
|
|
|
|
DataGridCell(columnName: 'season1', value: ''),
|
|
|
|
|
]))
|
|
|
|
|
.toList();
|
|
|
|
|
}
|
|
|
|
|
@ -216,6 +231,13 @@ class TVShowDataSource extends DataGridSource {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (e.columnName.startsWith('season')) {
|
|
|
|
|
// return Container(
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
// child: Icon(Icons.location_on),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
return Container(
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
|