movie and tvshow list
This commit is contained in:
+30
-3
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:global_configuration/global_configuration.dart';
|
||||
|
||||
import 'package:multimedia/widgets/tabsScreen.dart';
|
||||
|
||||
@@ -15,7 +15,35 @@ final theme = ThemeData(
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await GlobalConfiguration().loadFromPath('assets/cfg/config.json');
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String? dbProtocol = prefs.getString('dbProtocol');
|
||||
String? dbHost = prefs.getString('dbHost');
|
||||
String? dbPath = prefs.getString('dbPath');
|
||||
String? dbUser = prefs.getString('dbUser');
|
||||
String? dbPassword = prefs.getString('dbPassword');
|
||||
|
||||
// if (dbProtocol == null) {
|
||||
// prefs.setString('dbProtocol', 'http');
|
||||
// }
|
||||
// if (dbHost == null) {
|
||||
// prefs.setString('dbHost', '192.168.0.70');
|
||||
// }
|
||||
if (dbProtocol == null) {
|
||||
prefs.setString('dbProtocol', 'https');
|
||||
}
|
||||
if (dbHost == null) {
|
||||
prefs.setString('dbHost', 'api.windesign.at');
|
||||
}
|
||||
if (dbPath == null) {
|
||||
prefs.setString('dbPath', '/multimedia.php');
|
||||
}
|
||||
if (dbUser == null) {
|
||||
prefs.setString('dbUser', '');
|
||||
}
|
||||
if (dbPassword == null) {
|
||||
prefs.setString('dbPassword', '');
|
||||
}
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
@@ -25,7 +53,6 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return MaterialApp(
|
||||
theme: theme,
|
||||
title: 'Multimedia',
|
||||
|
||||
@@ -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/movies.dart';
|
||||
|
||||
Color _kColorInit = const Color.fromARGB(255, 192, 192, 192);
|
||||
@@ -30,10 +29,16 @@ class _MoviesScreenState extends State<MoviesScreen> {
|
||||
List<GridColumn> _columns = [];
|
||||
|
||||
Future<List<Movie>> generateMovieList() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String? dbProtocol = prefs.getString('dbProtocol');
|
||||
String? dbHost = prefs.getString('dbHost');
|
||||
String? dbPath = prefs.getString('dbPath');
|
||||
|
||||
Uri url = Uri(
|
||||
scheme: GlobalConfiguration().getValue('dbProtocol'),
|
||||
host: GlobalConfiguration().getValue('dbHost'),
|
||||
path: GlobalConfiguration().getValue('dbPath'),
|
||||
scheme: dbProtocol,
|
||||
host: dbHost,
|
||||
path: dbPath,
|
||||
queryParameters: {
|
||||
'module': 'movie',
|
||||
'function': 'getList',
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user