mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-10 03:57:39 +08:00
chore: ui improvement
This commit is contained in:
25
ui/.metadata
25
ui/.metadata
@@ -4,7 +4,7 @@
|
|||||||
# This file should be version controlled and should not be manually edited.
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
version:
|
version:
|
||||||
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
|
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
|
|
||||||
project_type: app
|
project_type: app
|
||||||
@@ -13,26 +13,11 @@ project_type: app
|
|||||||
migration:
|
migration:
|
||||||
platforms:
|
platforms:
|
||||||
- platform: root
|
- platform: root
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
|
||||||
- platform: android
|
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
- platform: ios
|
- platform: ios
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
|
||||||
- platform: linux
|
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
- platform: macos
|
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
- platform: web
|
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
- platform: windows
|
|
||||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
|
||||||
|
|
||||||
# User provided section
|
# User provided section
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,10 @@ class SeriesDetailData
|
|||||||
"id": int.parse(id!),
|
"id": int.parse(id!),
|
||||||
"resolution": resolution,
|
"resolution": resolution,
|
||||||
"target_dir": targetDir,
|
"target_dir": targetDir,
|
||||||
"limiter": {"size_min": limiter.start.toInt()*1000*1000, "size_max": limiter.end.toInt()*1000*1000},
|
"limiter": {
|
||||||
|
"size_min": limiter.start.toInt() * 1000 * 1000,
|
||||||
|
"size_max": limiter.end.toInt() * 1000 * 1000
|
||||||
|
},
|
||||||
});
|
});
|
||||||
var sp = ServerResponse.fromJson(resp.data);
|
var sp = ServerResponse.fromJson(resp.data);
|
||||||
if (sp.code != 0) {
|
if (sp.code != 0) {
|
||||||
@@ -83,6 +86,7 @@ class SeriesDetailData
|
|||||||
class SeriesDetails {
|
class SeriesDetails {
|
||||||
int? id;
|
int? id;
|
||||||
int? tmdbId;
|
int? tmdbId;
|
||||||
|
String? imdbid;
|
||||||
String? name;
|
String? name;
|
||||||
String? originalName;
|
String? originalName;
|
||||||
String? overview;
|
String? overview;
|
||||||
@@ -101,6 +105,7 @@ class SeriesDetails {
|
|||||||
SeriesDetails(
|
SeriesDetails(
|
||||||
{this.id,
|
{this.id,
|
||||||
this.tmdbId,
|
this.tmdbId,
|
||||||
|
this.imdbid,
|
||||||
this.name,
|
this.name,
|
||||||
this.originalName,
|
this.originalName,
|
||||||
this.overview,
|
this.overview,
|
||||||
@@ -119,6 +124,7 @@ class SeriesDetails {
|
|||||||
SeriesDetails.fromJson(Map<String, dynamic> json) {
|
SeriesDetails.fromJson(Map<String, dynamic> json) {
|
||||||
id = json['id'];
|
id = json['id'];
|
||||||
tmdbId = json['tmdb_id'];
|
tmdbId = json['tmdb_id'];
|
||||||
|
imdbid = json["imdb_id"];
|
||||||
name = json['name_cn'];
|
name = json['name_cn'];
|
||||||
originalName = json['original_name'];
|
originalName = json['original_name'];
|
||||||
overview = json['overview'];
|
overview = json['overview'];
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class WelcomePage extends ConsumerWidget {
|
|||||||
return switch (data) {
|
return switch (data) {
|
||||||
AsyncData(:final value) => SingleChildScrollView(
|
AsyncData(:final value) => SingleChildScrollView(
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
alignment: WrapAlignment.spaceEvenly,
|
alignment: WrapAlignment.start,
|
||||||
spacing: isSmallScreen(context) ? 0 : 10,
|
spacing: isSmallScreen(context) ? 0 : 10,
|
||||||
runSpacing: isSmallScreen(context) ? 10 : 20,
|
runSpacing: isSmallScreen(context) ? 10 : 20,
|
||||||
children: value.isEmpty
|
children: value.isEmpty
|
||||||
|
|||||||
@@ -3,10 +3,12 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:quiver/strings.dart';
|
||||||
import 'package:ui/providers/APIs.dart';
|
import 'package:ui/providers/APIs.dart';
|
||||||
import 'package:ui/providers/series_details.dart';
|
import 'package:ui/providers/series_details.dart';
|
||||||
import 'package:ui/welcome_page.dart';
|
import 'package:ui/welcome_page.dart';
|
||||||
import 'package:ui/widgets/utils.dart';
|
import 'package:ui/widgets/utils.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import 'widgets.dart';
|
import 'widgets.dart';
|
||||||
|
|
||||||
@@ -22,16 +24,22 @@ class DetailCard extends ConsumerStatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _DetailCardState extends ConsumerState<DetailCard> {
|
class _DetailCardState extends ConsumerState<DetailCard> {
|
||||||
|
final tmdbBase = "https://www.themoviedb.org/";
|
||||||
|
final imdbBase = "https://www.imdb.com/title/";
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
final url = Uri.parse(tmdbBase +
|
||||||
|
(widget.details.mediaType == "tv" ? "tv/" : "movie/") +
|
||||||
|
widget.details.tmdbId.toString());
|
||||||
|
|
||||||
|
final imdbUrl = Uri.parse(imdbBase + (widget.details.imdbid ?? ""));
|
||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
child: Container(
|
child: Container(
|
||||||
constraints:
|
constraints:
|
||||||
BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.4),
|
BoxConstraints(maxHeight: 400),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
@@ -43,8 +51,10 @@ class _DetailCardState extends ConsumerState<DetailCard> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[screenWidth<600? SizedBox():
|
children: <Widget>[
|
||||||
Flexible(
|
screenWidth < 600
|
||||||
|
? SizedBox()
|
||||||
|
: Flexible(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
@@ -61,38 +71,79 @@ class _DetailCardState extends ConsumerState<DetailCard> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Text(""),
|
//const Text(""),
|
||||||
Wrap(
|
|
||||||
children: [
|
|
||||||
Text("${widget.details.resolution}"),
|
|
||||||
const SizedBox(
|
|
||||||
width: 30,
|
|
||||||
),
|
|
||||||
Text("${widget.details.storage!.name}:"),
|
|
||||||
Text(
|
|
||||||
"${widget.details.mediaType == "tv" ? widget.details.storage!.tvPath : widget.details.storage!.moviePath}"
|
|
||||||
"${widget.details.targetDir}"),
|
|
||||||
const SizedBox(
|
|
||||||
width: 30,
|
|
||||||
),
|
|
||||||
widget.details.limiter != null &&
|
|
||||||
widget.details.limiter!.sizeMax > 0
|
|
||||||
? Text(
|
|
||||||
"${(widget.details.limiter!.sizeMin).readableFileSize()} - ${(widget.details.limiter!.sizeMax).readableFileSize()}")
|
|
||||||
: const SizedBox()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Divider(thickness: 1, height: 1),
|
|
||||||
Text(
|
Text(
|
||||||
"${widget.details.name} ${widget.details.name != widget.details.originalName ? widget.details.originalName : ''} (${widget.details.airDate!.split("-")[0]})",
|
"${widget.details.name} ${widget.details.name != widget.details.originalName ? widget.details.originalName : ''} (${widget.details.airDate!.split("-")[0]})",
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 20, fontWeight: FontWeight.bold),
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
height: 2.5),
|
||||||
),
|
),
|
||||||
const Text(""),
|
const Divider(thickness: 1, height: 1),
|
||||||
|
Text(
|
||||||
|
"",
|
||||||
|
style: TextStyle(height: 0.2),
|
||||||
|
),
|
||||||
|
Wrap(
|
||||||
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
Chip(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: ContinuousRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(100.0)),
|
||||||
|
label: Text("${widget.details.resolution}"),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
Chip(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: ContinuousRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(100.0)),
|
||||||
|
label: Text(
|
||||||
|
"${widget.details.storage!.name}: ${widget.details.mediaType == "tv" ? widget.details.storage!.tvPath : widget.details.storage!.moviePath}"
|
||||||
|
"${widget.details.targetDir}"),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
widget.details.limiter != null &&
|
||||||
|
widget.details.limiter!.sizeMax > 0
|
||||||
|
? Chip(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: ContinuousRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(100.0)),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
label: Text(
|
||||||
|
"${(widget.details.limiter!.sizeMin).readableFileSize()} - ${(widget.details.limiter!.sizeMax).readableFileSize()}"))
|
||||||
|
: const SizedBox(),
|
||||||
|
Chip(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: ContinuousRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(100.0)),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
label: InkWell(
|
||||||
|
child: Text("TMDB"),
|
||||||
|
onTap: () => launchUrl(url),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
isBlank(widget.details.imdbid)
|
||||||
|
? SizedBox()
|
||||||
|
: Chip(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: ContinuousRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(100.0)),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
label: InkWell(
|
||||||
|
child: Text("IMDB"),
|
||||||
|
onTap: () => launchUrl(imdbUrl),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Text("",style: TextStyle(height: 1)),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 9,
|
maxLines: 7,
|
||||||
widget.details.overview ?? "",
|
widget.details.overview ?? "",
|
||||||
)),
|
)),
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
Reference in New Issue
Block a user