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