SDK version upgrade
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_datagrid/datagrid.dart';
|
||||
|
||||
class Movie {
|
||||
int movieID;
|
||||
String movieTitle;
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_datagrid/datagrid.dart';
|
||||
|
||||
class EpisodeCount {
|
||||
int season;
|
||||
int cnt;
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:logger/logger.dart';
|
||||
|
||||
Logger getLogger() {
|
||||
// Logger.level = Level.debug;
|
||||
Logger.level = Level.info;
|
||||
return Logger(
|
||||
printer: MyLogPrinter(
|
||||
printTime: true,
|
||||
colors: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyLogPrinter extends LogPrinter {
|
||||
static final levelPrefixes = {
|
||||
Level.trace: ' [TRACE]',
|
||||
Level.debug: ' [DEBUG]',
|
||||
Level.info: ' [INFO]',
|
||||
Level.warning: '[WARNING]',
|
||||
Level.error: ' [ERROR]',
|
||||
Level.fatal: ' [FATAL]',
|
||||
};
|
||||
|
||||
static final levelColors = {
|
||||
Level.trace: AnsiColor.fg(AnsiColor.grey(0.5)),
|
||||
Level.debug: const AnsiColor.none(),
|
||||
Level.info: const AnsiColor.fg(12),
|
||||
Level.warning: const AnsiColor.fg(208),
|
||||
Level.error: const AnsiColor.fg(196),
|
||||
Level.fatal: const AnsiColor.fg(199),
|
||||
};
|
||||
|
||||
final bool printTime;
|
||||
final bool colors;
|
||||
|
||||
MyLogPrinter({this.printTime = false, this.colors = true});
|
||||
|
||||
@override
|
||||
List<String> log(LogEvent event) {
|
||||
var messageStr = _stringifyMessage(event.message);
|
||||
var errorStr = event.error != null ? ' ERROR: ${event.error}' : '';
|
||||
var timeStr = printTime ? event.time.toIso8601String() : '';
|
||||
return ['${_labelFor(event.level)} $timeStr $messageStr$errorStr'];
|
||||
}
|
||||
|
||||
String _labelFor(Level level) {
|
||||
var prefix = levelPrefixes[level]!;
|
||||
var color = levelColors[level]!;
|
||||
|
||||
return colors ? color(prefix) : prefix;
|
||||
}
|
||||
|
||||
String _stringifyMessage(dynamic message) {
|
||||
final finalMessage = message is Function ? message() : message;
|
||||
if (finalMessage is Map || finalMessage is Iterable) {
|
||||
var encoder = const JsonEncoder.withIndent(null);
|
||||
return encoder.convert(finalMessage);
|
||||
} else {
|
||||
return finalMessage.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
-3
@@ -2,7 +2,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'package:multimedia/widgets/tabsScreen.dart';
|
||||
import 'package:multimedia/widgets/tabs_screen.dart';
|
||||
|
||||
import 'package:logger/logger.dart';
|
||||
import 'package:multimedia/log_printer.dart';
|
||||
|
||||
final theme = ThemeData(
|
||||
useMaterial3: true,
|
||||
@@ -14,11 +17,16 @@ final theme = ThemeData(
|
||||
);
|
||||
|
||||
void main() async {
|
||||
Logger logger = getLogger();
|
||||
logger.i('Start application');
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
logger.i('Load preferences');
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String? dbProtocol = prefs.getString('dbProtocol');
|
||||
String? dbHost = prefs.getString('dbHost');
|
||||
//LATER String? dbProtocol = prefs.getString('dbProtocol');
|
||||
//LATER String? dbHost = prefs.getString('dbHost');
|
||||
String? dbPath = prefs.getString('dbPath');
|
||||
String? dbUser = prefs.getString('dbUser');
|
||||
String? dbPassword = prefs.getString('dbPassword');
|
||||
@@ -47,6 +55,8 @@ void main() async {
|
||||
prefs.setString('dbPassword', '');
|
||||
}
|
||||
|
||||
logger.i('Run application');
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
||||
+60
-61
@@ -3,18 +3,17 @@ import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'package:transparent_image/transparent_image.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:multimedia/data/movies.dart';
|
||||
|
||||
import 'package:multimedia/widgets/movies/details/castBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/crewBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/overviewBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/genreBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/companiesBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/countriesBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/settingsBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/cast_box.dart';
|
||||
import 'package:multimedia/widgets/movies/details/crew_box.dart';
|
||||
import 'package:multimedia/widgets/movies/details/overview_box.dart';
|
||||
import 'package:multimedia/widgets/movies/details/genre_box.dart';
|
||||
import 'package:multimedia/widgets/movies/details/companies_box.dart';
|
||||
import 'package:multimedia/widgets/movies/details/countries_box.dart';
|
||||
import 'package:multimedia/widgets/movies/details/settings_box.dart';
|
||||
|
||||
class MovieDetailsScreen extends StatelessWidget {
|
||||
MovieDetailsScreen({
|
||||
@@ -44,23 +43,23 @@ class MovieDetailsScreen extends StatelessWidget {
|
||||
);
|
||||
|
||||
final response = await http.get(url);
|
||||
bool? error;
|
||||
String? errorMessage;
|
||||
//LATER final bool? error;
|
||||
//LATER String? errorMessage;
|
||||
|
||||
Map<String, dynamic> movies = json.decode(response.body);
|
||||
error = movies['error'];
|
||||
errorMessage = movies['errmsg'];
|
||||
var list = movies['data'];
|
||||
//LATER error = movies['error'];
|
||||
//LATER errorMessage = movies['errmsg'];
|
||||
final list = movies['data'];
|
||||
|
||||
List<Movie> _movies =
|
||||
List<Movie> moviesTmp =
|
||||
await list.map<Movie>((json) => Movie.fromJson(json)).toList();
|
||||
|
||||
if (_movies.isNotEmpty) {
|
||||
movieDetails = _movies[0];
|
||||
return _movies[0];
|
||||
if (moviesTmp.isNotEmpty) {
|
||||
movieDetails = moviesTmp[0];
|
||||
return moviesTmp[0];
|
||||
}
|
||||
|
||||
return _movies[0];
|
||||
return moviesTmp[0];
|
||||
}
|
||||
|
||||
Widget generateLists(BuildContext context) {
|
||||
@@ -290,52 +289,52 @@ class MovieDetailsScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<bool> updateMovie() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String? dbProtocol = prefs.getString('dbProtocol');
|
||||
String? dbHost = prefs.getString('dbHost');
|
||||
String? dbPath = prefs.getString('dbPath');
|
||||
// String? dbProtocol = prefs.getString('dbProtocol');
|
||||
// String? dbHost = prefs.getString('dbHost');
|
||||
// String? dbPath = prefs.getString('dbPath');
|
||||
|
||||
Uri url = Uri(
|
||||
scheme: dbProtocol,
|
||||
host: dbHost,
|
||||
path: dbPath,
|
||||
);
|
||||
// Uri url = Uri(
|
||||
// scheme: dbProtocol,
|
||||
// host: dbHost,
|
||||
// path: dbPath,
|
||||
// );
|
||||
|
||||
try {
|
||||
final r = await http.post(
|
||||
url,
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: jsonEncode(
|
||||
<String, String>{
|
||||
'module': 'movie',
|
||||
'function': 'update',
|
||||
'movieID': movieDetails.movieID.toString(),
|
||||
'movieTitle': movieDetails.movieTitle,
|
||||
'originalTitle': movieDetails.originalTitle,
|
||||
'overview': movieDetails.overview,
|
||||
'releaseDate':
|
||||
DateFormat('yyyy-MM-dd').format(movieDetails.releaseDate),
|
||||
'resolution': movieDetails.resolution,
|
||||
'state': movieDetails.state.toString(),
|
||||
'backdropPath': movieDetails.backdropPath,
|
||||
'languages': movieDetails.languages,
|
||||
'productionCountries': movieDetails.productionCountries,
|
||||
'productionCompanies': movieDetails.productionCompanies,
|
||||
'voteAverage': movieDetails.voteAverage.toString(),
|
||||
'voteCount': movieDetails.voteCount.toString(),
|
||||
'cast': movieDetails.cast,
|
||||
'crew': movieDetails.crew,
|
||||
'genre': movieDetails.genre,
|
||||
'localPath': movieDetails.localPath,
|
||||
},
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
// try {
|
||||
// final r = await http.post(
|
||||
// url,
|
||||
// headers: <String, String>{
|
||||
// 'Content-Type': 'application/json; charset=UTF-8',
|
||||
// },
|
||||
// body: jsonEncode(
|
||||
// <String, String>{
|
||||
// 'module': 'movie',
|
||||
// 'function': 'update',
|
||||
// 'movieID': movieDetails.movieID.toString(),
|
||||
// 'movieTitle': movieDetails.movieTitle,
|
||||
// 'originalTitle': movieDetails.originalTitle,
|
||||
// 'overview': movieDetails.overview,
|
||||
// 'releaseDate':
|
||||
// DateFormat('yyyy-MM-dd').format(movieDetails.releaseDate),
|
||||
// 'resolution': movieDetails.resolution,
|
||||
// 'state': movieDetails.state.toString(),
|
||||
// 'backdropPath': movieDetails.backdropPath,
|
||||
// 'languages': movieDetails.languages,
|
||||
// 'productionCountries': movieDetails.productionCountries,
|
||||
// 'productionCompanies': movieDetails.productionCompanies,
|
||||
// 'voteAverage': movieDetails.voteAverage.toString(),
|
||||
// 'voteCount': movieDetails.voteCount.toString(),
|
||||
// 'cast': movieDetails.cast,
|
||||
// 'crew': movieDetails.crew,
|
||||
// 'genre': movieDetails.genre,
|
||||
// 'localPath': movieDetails.localPath,
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
// } catch (e) {
|
||||
// print(e.toString());
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
import 'package:multimedia/widgets/movies/details/settingsBoxLocalPath.dart';
|
||||
import 'package:multimedia/widgets/movies/details/settingsBoxResolution.dart';
|
||||
import 'package:multimedia/widgets/movies/details/stateBox.dart';
|
||||
import 'package:multimedia/widgets/movies/details/settings_box_local_path.dart';
|
||||
import 'package:multimedia/widgets/movies/details/settings_box_resolution.dart';
|
||||
import 'package:multimedia/widgets/movies/details/state_box.dart';
|
||||
|
||||
class MovieDetailsSettingsBox extends StatelessWidget {
|
||||
MovieDetailsSettingsBox({
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MovieDetailsSettingsBoxLocalPath extends StatelessWidget {
|
||||
MovieDetailsSettingsBoxLocalPath({
|
||||
const MovieDetailsSettingsBoxLocalPath({
|
||||
super.key,
|
||||
required this.localPath,
|
||||
required this.localPathChanged,
|
||||
});
|
||||
|
||||
String localPath;
|
||||
final String localPath;
|
||||
|
||||
final Function(String localPath) localPathChanged;
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MovieDetailsSettingsBoxResolution extends StatefulWidget {
|
||||
MovieDetailsSettingsBoxResolution({
|
||||
const MovieDetailsSettingsBoxResolution({
|
||||
super.key,
|
||||
required this.resolution,
|
||||
required this.resolutionChanged,
|
||||
});
|
||||
|
||||
String resolution;
|
||||
final String resolution;
|
||||
|
||||
final Function(String resolution) resolutionChanged;
|
||||
|
||||
+3
-5
@@ -1,7 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class MovieDetailsSettingsStateBox extends StatefulWidget {
|
||||
MovieDetailsSettingsStateBox({
|
||||
super.key,
|
||||
@@ -52,7 +50,7 @@ class _MovieDetailsSettingsStateBoxState
|
||||
SizedBox(
|
||||
width: 180,
|
||||
child: CheckboxListTile(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) =>
|
||||
const BorderSide(width: 1.0, color: Colors.grey),
|
||||
),
|
||||
@@ -75,7 +73,7 @@ class _MovieDetailsSettingsStateBoxState
|
||||
SizedBox(
|
||||
width: 180,
|
||||
child: CheckboxListTile(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) =>
|
||||
const BorderSide(width: 1.0, color: Colors.grey),
|
||||
),
|
||||
@@ -98,7 +96,7 @@ class _MovieDetailsSettingsStateBoxState
|
||||
SizedBox(
|
||||
width: 130,
|
||||
child: CheckboxListTile(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) =>
|
||||
const BorderSide(width: 1.0, color: Colors.grey),
|
||||
),
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'package:multimedia/widgets/movies/details/detailsScreen.dart';
|
||||
import 'package:multimedia/widgets/movies/details/details_screen.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -47,21 +47,21 @@ class _MoviesScreenState extends State<MoviesScreen> {
|
||||
|
||||
try {
|
||||
final response = await http.get(url);
|
||||
bool? error;
|
||||
String? errorMessage;
|
||||
//LATER bool? error;
|
||||
//LATER String? errorMessage;
|
||||
|
||||
Map<String, dynamic> movies = json.decode(response.body);
|
||||
error = movies['error'];
|
||||
errorMessage = movies['errmsg'];
|
||||
//LATER error = movies['error'];
|
||||
//LATER errorMessage = movies['errmsg'];
|
||||
var list = movies['data'];
|
||||
|
||||
List<Movie> _movies =
|
||||
List<Movie> moviesTmp =
|
||||
await list.map<Movie>((json) => Movie.fromJson(json)).toList();
|
||||
movieDataSource = MovieDataSource(_movies);
|
||||
movieDataSource = MovieDataSource(moviesTmp);
|
||||
|
||||
_moviesList = _movies;
|
||||
_moviesList = moviesTmp;
|
||||
|
||||
return _movies;
|
||||
return moviesTmp;
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/widgets/tvshows/listScreen.dart';
|
||||
import 'package:multimedia/widgets/movies/listScreen.dart';
|
||||
import 'package:multimedia/widgets/tvshows/list_screen.dart';
|
||||
import 'package:multimedia/widgets/movies/list_screen.dart';
|
||||
|
||||
class TabsScreen extends StatefulWidget {
|
||||
const TabsScreen({super.key});
|
||||
+69
-67
@@ -1,21 +1,23 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:multimedia/widgets/tvshows/details/companiesBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/countriesBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/crewBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/castBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/genreBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/overviewBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/companies_box.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/countries_box.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/crew_box.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/cast_box.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/genre_box.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/overview_box.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/seasons.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settings_box.dart';
|
||||
|
||||
import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
import 'package:logger/logger.dart';
|
||||
import 'package:multimedia/log_printer.dart';
|
||||
|
||||
class TVShowDetailsScreen extends StatelessWidget {
|
||||
TVShowDetailsScreen({
|
||||
super.key,
|
||||
@@ -26,6 +28,7 @@ class TVShowDetailsScreen extends StatelessWidget {
|
||||
late int maxSeason;
|
||||
late List<EpisodeCount> episodeCount;
|
||||
late TVShow tvShowDetails;
|
||||
Logger logger = getLogger();
|
||||
|
||||
Future<http.Response> testPost(String data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
@@ -76,38 +79,38 @@ class TVShowDetailsScreen extends StatelessWidget {
|
||||
);
|
||||
|
||||
final response = await http.get(url);
|
||||
bool? error;
|
||||
String? errorMessage;
|
||||
//LATER bool? error;
|
||||
//LATER String? errorMessage;
|
||||
String? mSeason;
|
||||
|
||||
Map<String, dynamic> tvshows = json.decode(response.body);
|
||||
error = tvshows['error'];
|
||||
errorMessage = tvshows['errmsg'];
|
||||
//LATER error = tvshows['error'];
|
||||
//LATER errorMessage = tvshows['errmsg'];
|
||||
mSeason = tvshows['maxSeason'];
|
||||
|
||||
var tvshowList = tvshows['tvshows'];
|
||||
var episodeList = tvshows['episodeCount'];
|
||||
|
||||
if (mSeason != null) {
|
||||
if (int.tryParse(mSeason!) != null) {
|
||||
if (int.tryParse(mSeason) != null) {
|
||||
maxSeason = int.parse(mSeason);
|
||||
}
|
||||
}
|
||||
|
||||
List<TVShow> _tvshows =
|
||||
List<TVShow> tvshowsTmp =
|
||||
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
||||
|
||||
List<EpisodeCount> _episodecount = await episodeList
|
||||
List<EpisodeCount> episodecountTmp = await episodeList
|
||||
.map<EpisodeCount>((json) => EpisodeCount.fromJson(json))
|
||||
.toList();
|
||||
|
||||
episodeCount = _episodecount;
|
||||
episodeCount = episodecountTmp;
|
||||
|
||||
if (_tvshows.isNotEmpty) {
|
||||
tvShowDetails = _tvshows[0];
|
||||
if (tvshowsTmp.isNotEmpty) {
|
||||
tvShowDetails = tvshowsTmp[0];
|
||||
}
|
||||
|
||||
return _tvshows[0];
|
||||
return tvshowsTmp[0];
|
||||
}
|
||||
|
||||
Widget generateLists(BuildContext context) {
|
||||
@@ -337,57 +340,57 @@ class TVShowDetailsScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<bool> updateTVShow() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String? dbProtocol = prefs.getString('dbProtocol');
|
||||
String? dbHost = prefs.getString('dbHost');
|
||||
String? dbPath = prefs.getString('dbPath');
|
||||
// String? dbProtocol = prefs.getString('dbProtocol');
|
||||
// String? dbHost = prefs.getString('dbHost');
|
||||
// String? dbPath = prefs.getString('dbPath');
|
||||
|
||||
Uri url = Uri(
|
||||
scheme: dbProtocol,
|
||||
host: dbHost,
|
||||
path: dbPath,
|
||||
);
|
||||
// Uri url = Uri(
|
||||
// scheme: dbProtocol,
|
||||
// host: dbHost,
|
||||
// path: dbPath,
|
||||
// );
|
||||
|
||||
var seasonState = jsonEncode(tvShowDetails.seasonStatus.map((e) => e.toJson()).toList());
|
||||
// var seasonState = jsonEncode(tvShowDetails.seasonStatus.map((e) => e.toJson()).toList());
|
||||
|
||||
try {
|
||||
final r = await http.post(
|
||||
url,
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: jsonEncode(
|
||||
<String, dynamic>{
|
||||
'module': 'tvshow',
|
||||
'function': 'update',
|
||||
'seriesID': tvShowDetails.seriesID.toString(),
|
||||
'seriesName': tvShowDetails.seriesName,
|
||||
'overview': tvShowDetails.overview,
|
||||
'firstAired':
|
||||
DateFormat('yyyy-MM-dd').format(tvShowDetails.firstAired),
|
||||
'resolution': tvShowDetails.resolution,
|
||||
'cliffhanger': tvShowDetails.cliffhanger.toString(),
|
||||
'status': tvShowDetails.status.toString(),
|
||||
'backdropPath': tvShowDetails.backdropPath,
|
||||
'seriesState': tvShowDetails.seriesState.toString(),
|
||||
'languages': tvShowDetails.languages,
|
||||
'networks': tvShowDetails.networks,
|
||||
'productionCompanies': tvShowDetails.productionCompanies,
|
||||
'voteAverage': tvShowDetails.voteAverage.toString(),
|
||||
'voteCount': tvShowDetails.voteCount.toString(),
|
||||
'cast': tvShowDetails.cast,
|
||||
'crew': tvShowDetails.crew,
|
||||
'genre': tvShowDetails.genre,
|
||||
'download': tvShowDetails.download,
|
||||
'localPath': tvShowDetails.localPath,
|
||||
'seasons': seasonState,
|
||||
},
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
// try {
|
||||
// final r = await http.post(
|
||||
// url,
|
||||
// headers: <String, String>{
|
||||
// 'Content-Type': 'application/json; charset=UTF-8',
|
||||
// },
|
||||
// body: jsonEncode(
|
||||
// <String, dynamic>{
|
||||
// 'module': 'tvshow',
|
||||
// 'function': 'update',
|
||||
// 'seriesID': tvShowDetails.seriesID.toString(),
|
||||
// 'seriesName': tvShowDetails.seriesName,
|
||||
// 'overview': tvShowDetails.overview,
|
||||
// 'firstAired':
|
||||
// DateFormat('yyyy-MM-dd').format(tvShowDetails.firstAired),
|
||||
// 'resolution': tvShowDetails.resolution,
|
||||
// 'cliffhanger': tvShowDetails.cliffhanger.toString(),
|
||||
// 'status': tvShowDetails.status.toString(),
|
||||
// 'backdropPath': tvShowDetails.backdropPath,
|
||||
// 'seriesState': tvShowDetails.seriesState.toString(),
|
||||
// 'languages': tvShowDetails.languages,
|
||||
// 'networks': tvShowDetails.networks,
|
||||
// 'productionCompanies': tvShowDetails.productionCompanies,
|
||||
// 'voteAverage': tvShowDetails.voteAverage.toString(),
|
||||
// 'voteCount': tvShowDetails.voteCount.toString(),
|
||||
// 'cast': tvShowDetails.cast,
|
||||
// 'crew': tvShowDetails.crew,
|
||||
// 'genre': tvShowDetails.genre,
|
||||
// 'download': tvShowDetails.download,
|
||||
// 'localPath': tvShowDetails.localPath,
|
||||
// 'seasons': seasonState,
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
// } catch (e) {
|
||||
// logger.e(e.toString());
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -545,7 +548,6 @@ class TVShowDetailsScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
]);
|
||||
;
|
||||
} else {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(
|
||||
+4
-4
@@ -100,7 +100,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
||||
Map<int, TableColumnWidth> colWidths = {};
|
||||
|
||||
for (int i = 0; i <= maxEpisode; i++) {
|
||||
colWidths.addEntries({i: IntrinsicColumnWidth()}.entries);
|
||||
colWidths.addEntries({i: const IntrinsicColumnWidth()}.entries);
|
||||
}
|
||||
|
||||
return Container(
|
||||
@@ -194,7 +194,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(
|
||||
width: 1.0, color: Colors.grey),
|
||||
),
|
||||
@@ -239,7 +239,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(
|
||||
width: 1.0, color: Colors.grey),
|
||||
),
|
||||
@@ -284,7 +284,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(
|
||||
width: 1.0, color: Colors.grey),
|
||||
),
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/seasonBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/season_box.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
class TVShowDetailsSeasons extends StatefulWidget {
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxDownloadLink.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxLocalPath.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxResolution.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxCliffhanger.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settings_box_download_link.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settings_box_local_path.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settings_box_resolution.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settings_box_cliffhanger.dart';
|
||||
|
||||
class TVShowDetailsSettingsBox extends StatelessWidget {
|
||||
TVShowDetailsSettingsBox({
|
||||
+2
-2
@@ -47,8 +47,8 @@ class _TVShowDetailsSettingsBoxCliffhangerState
|
||||
height: 10,
|
||||
),
|
||||
Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) => BorderSide(width: 1.0, color: Colors.grey),
|
||||
side: WidgetStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(width: 1.0, color: Colors.grey),
|
||||
),
|
||||
value: (_curCliffhanger == 1),
|
||||
onChanged: (bool? value) {
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:multimedia/widgets/tvshows/details/detailsScreen.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/details_screen.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -15,7 +13,6 @@ import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
|
||||
String convertState(String state) {
|
||||
List<String> stateList = state.split(',');
|
||||
int maxEpisode = 0;
|
||||
@@ -104,34 +101,34 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
|
||||
try {
|
||||
final response = await http.get(url);
|
||||
bool? error;
|
||||
String? errorMessage;
|
||||
//LATER bool? error;
|
||||
//LATER String? errorMessage;
|
||||
String? mSeason;
|
||||
|
||||
Map<String, dynamic> tvshows = json.decode(response.body);
|
||||
error = tvshows['error'];
|
||||
errorMessage = tvshows['errmsg'];
|
||||
//LATER error = tvshows['error'];
|
||||
//LATER errorMessage = tvshows['errmsg'];
|
||||
mSeason = tvshows['maxSeason'];
|
||||
|
||||
var tvshowList = tvshows['tvshows'];
|
||||
var episodeList = tvshows['episodeCount'];
|
||||
|
||||
if (mSeason != null) {
|
||||
if (int.tryParse(mSeason!) != null) {
|
||||
if (int.tryParse(mSeason) != null) {
|
||||
maxSeason = int.parse(mSeason);
|
||||
}
|
||||
}
|
||||
|
||||
List<TVShow> _tvshows = await tvshowList
|
||||
List<TVShow> tvshowsTmp = await tvshowList
|
||||
.map<TVShow>((json) => TVShow.fromJson(json))
|
||||
.toList();
|
||||
tvshowDataSource = TVShowDataSource(_tvshows, maxSeason);
|
||||
tvshowDataSource = TVShowDataSource(tvshowsTmp, maxSeason);
|
||||
|
||||
List<EpisodeCount> _episodecount = await episodeList
|
||||
List<EpisodeCount> episodecountTmp = await episodeList
|
||||
.map<EpisodeCount>((json) => EpisodeCount.fromJson(json))
|
||||
.toList();
|
||||
|
||||
episodeCount = _episodecount;
|
||||
episodeCount = episodecountTmp;
|
||||
|
||||
if (initDone == false) {
|
||||
addSeasonColumns(maxSeason);
|
||||
@@ -139,9 +136,9 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
|
||||
initDone = true;
|
||||
|
||||
_tvshowsList = _tvshows;
|
||||
_tvshowsList = tvshowsTmp;
|
||||
|
||||
return _tvshows;
|
||||
return tvshowsTmp;
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
Reference in New Issue
Block a user