mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-08 02:30:52 +08:00
feat: change ui
This commit is contained in:
@@ -73,7 +73,7 @@ class MyApp extends StatelessWidget {
|
||||
child: NavDrawer(),
|
||||
),
|
||||
const VerticalDivider(thickness: 1, width: 1),
|
||||
Flexible(flex: 7, child: child)
|
||||
Flexible(flex: 7, child: Padding(padding: const EdgeInsets.all(20),child: child), )
|
||||
]))),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -18,40 +18,40 @@ class MovieWatchlistPage extends ConsumerWidget {
|
||||
final data = ref.watch(movieWatchlistDataProvider);
|
||||
|
||||
return switch (data) {
|
||||
AsyncData(:final value) => GridView.builder(
|
||||
padding: const EdgeInsets.all(30),
|
||||
itemCount: value.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 6),
|
||||
itemBuilder: (context, i) {
|
||||
var item = value[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.all(4),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
//splashColor: Colors.blue.withAlpha(30),
|
||||
onTap: () {
|
||||
context.go(MovieDetailsPage.toRoute(item.id!));
|
||||
//showDialog(context: context, builder: builder)
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Image.network(
|
||||
"${APIs.imagesUrl}/${item.id}/poster.jpg",
|
||||
fit: BoxFit.contain,
|
||||
headers: APIs.authHeaders,
|
||||
),
|
||||
AsyncData(:final value) => SingleChildScrollView(
|
||||
child: Wrap(
|
||||
spacing: 20,
|
||||
children: List.generate(value.length, (i) {
|
||||
var item = value[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.all(4),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
//splashColor: Colors.blue.withAlpha(30),
|
||||
onTap: () {
|
||||
context.go(MovieDetailsPage.toRoute(item.id!));
|
||||
//showDialog(context: context, builder: builder)
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 160,
|
||||
height: 240,
|
||||
child: Image.network(
|
||||
"${APIs.imagesUrl}/${item.id}/poster.jpg",
|
||||
fit: BoxFit.fill,
|
||||
headers: APIs.authHeaders,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
item.name!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.bold, height: 2.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
item.name!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
));
|
||||
}))),
|
||||
_ => const MyProgressIndicator(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,52 +6,52 @@ import 'package:ui/providers/welcome_data.dart';
|
||||
import 'package:ui/tv_details.dart';
|
||||
import 'package:ui/widgets/progress_indicator.dart';
|
||||
|
||||
class TvWatchlistPage
|
||||
extends ConsumerWidget {
|
||||
class TvWatchlistPage extends ConsumerWidget {
|
||||
static const route = "/series";
|
||||
|
||||
const TvWatchlistPage
|
||||
({super.key});
|
||||
const TvWatchlistPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final data = ref.watch(tvWatchlistDataProvider);
|
||||
|
||||
return switch (data) {
|
||||
AsyncData(:final value) => GridView.builder(
|
||||
padding: const EdgeInsets.all(30),
|
||||
itemCount: value.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 6),
|
||||
itemBuilder: (context, i) {
|
||||
var item = value[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.all(4),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
//splashColor: Colors.blue.withAlpha(30),
|
||||
onTap: () {
|
||||
context.go(TvDetailsPage.toRoute(item.id!));
|
||||
//showDialog(context: context, builder: builder)
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Image.network(
|
||||
"${APIs.imagesUrl}/${item.id}/poster.jpg" ,
|
||||
fit: BoxFit.contain,
|
||||
headers: APIs.authHeaders,
|
||||
AsyncData(:final value) => SingleChildScrollView(
|
||||
child: Wrap(
|
||||
spacing: 20,
|
||||
children: List.generate(value.length, (i) {
|
||||
var item = value[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.all(4),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
//splashColor: Colors.blue.withAlpha(30),
|
||||
onTap: () {
|
||||
context.go(TvDetailsPage.toRoute(item.id!));
|
||||
//showDialog(context: context, builder: builder)
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 160,
|
||||
height: 240,
|
||||
child:Image.network(
|
||||
"${APIs.imagesUrl}/${item.id}/poster.jpg",
|
||||
fit: BoxFit.fill,
|
||||
headers: APIs.authHeaders,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
item.name!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.bold, height: 2.5),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
item.name!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
),
|
||||
),
|
||||
_ => MyProgressIndicator(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user