mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-10 03:57:39 +08:00
chore: update
This commit is contained in:
@@ -54,6 +54,10 @@ class MyApp extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
routes: [
|
routes: [
|
||||||
|
GoRoute(
|
||||||
|
path: "/",
|
||||||
|
redirect: (context, state) => WelcomePage.route,
|
||||||
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: WelcomePage.route,
|
path: WelcomePage.route,
|
||||||
builder: (context, state) => const WelcomePage(),
|
builder: (context, state) => const WelcomePage(),
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:ui/APIs.dart';
|
import 'package:ui/APIs.dart';
|
||||||
|
import 'package:ui/providers/welcome_data.dart';
|
||||||
import 'package:ui/server_response.dart';
|
import 'package:ui/server_response.dart';
|
||||||
import 'package:ui/utils.dart';
|
import 'package:ui/utils.dart';
|
||||||
|
|
||||||
class SearchPage extends StatefulWidget {
|
class SearchPage extends ConsumerStatefulWidget {
|
||||||
const SearchPage({super.key});
|
const SearchPage({super.key});
|
||||||
|
|
||||||
static const route = "/search";
|
static const route = "/search";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
ConsumerState<ConsumerStatefulWidget> createState() {
|
||||||
return _SearchPageState();
|
return _SearchPageState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SearchPageState extends State<SearchPage> {
|
class _SearchPageState extends ConsumerState<SearchPage> {
|
||||||
List<dynamic> list = List.empty();
|
List<dynamic> list = List.empty();
|
||||||
|
|
||||||
void _queryResults(BuildContext context, String q) async {
|
void _queryResults(BuildContext context, String q) async {
|
||||||
@@ -140,6 +142,7 @@ class _SearchPageState extends State<SearchPage> {
|
|||||||
if (sp.code != 0 && context.mounted) {
|
if (sp.code != 0 && context.mounted) {
|
||||||
Utils.showAlertDialog(context, sp.message);
|
Utils.showAlertDialog(context, sp.message);
|
||||||
}
|
}
|
||||||
|
ref.refresh(welcomePageDataProvider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class _SystemSettingsPageState extends ConsumerState<SystemSettingsPage> {
|
|||||||
tilePadding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
tilePadding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
childrenPadding: const EdgeInsets.fromLTRB(50, 0, 50, 0),
|
childrenPadding: const EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||||
initiallyExpanded: true,
|
initiallyExpanded: true,
|
||||||
title: const Text("下载器设置"),
|
title: const Text("下载客户端设置"),
|
||||||
children: [downloadSetting],
|
children: [downloadSetting],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -277,7 +277,7 @@ class _SystemSettingsPageState extends ConsumerState<SystemSettingsPage> {
|
|||||||
barrierDismissible: true, // user must tap button!
|
barrierDismissible: true, // user must tap button!
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('下载器'),
|
title: const Text('下载客户端'),
|
||||||
content: SingleChildScrollView(
|
content: SingleChildScrollView(
|
||||||
child: ListBody(
|
child: ListBody(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:ui/providers/welcome_data.dart';
|
|||||||
import 'package:ui/tv_details.dart';
|
import 'package:ui/tv_details.dart';
|
||||||
|
|
||||||
class WelcomePage extends ConsumerWidget {
|
class WelcomePage extends ConsumerWidget {
|
||||||
static const route = "/welcome";
|
static const route = "/series";
|
||||||
|
|
||||||
const WelcomePage({super.key});
|
const WelcomePage({super.key});
|
||||||
|
|
||||||
@@ -16,9 +16,10 @@ class WelcomePage extends ConsumerWidget {
|
|||||||
|
|
||||||
return switch (data) {
|
return switch (data) {
|
||||||
AsyncData(:final value) => GridView.builder(
|
AsyncData(:final value) => GridView.builder(
|
||||||
|
padding: const EdgeInsets.all(30),
|
||||||
itemCount: value.length,
|
itemCount: value.length,
|
||||||
gridDelegate:
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 6),
|
crossAxisCount: 6),
|
||||||
itemBuilder: (context, i) {
|
itemBuilder: (context, i) {
|
||||||
var item = value[i];
|
var item = value[i];
|
||||||
return Card(
|
return Card(
|
||||||
@@ -33,28 +34,21 @@ class WelcomePage extends ConsumerWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: SizedBox(
|
|
||||||
width: 300,
|
|
||||||
height: 600,
|
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
APIs.tmdbImgBaseUrl + item.posterPath!,
|
APIs.tmdbImgBaseUrl + item.posterPath!,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
Flexible(
|
|
||||||
child: Text(
|
|
||||||
item.name!,
|
item.name!,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14, fontWeight: FontWeight.bold),
|
fontSize: 14, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}),
|
}),
|
||||||
_ => const CircularProgressIndicator(),
|
_ => const CircularProgressIndicator(),
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user