mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-16 16:30:52 +08:00
feat: add text to empty screen
This commit is contained in:
2
db/db.go
2
db/db.go
@@ -98,7 +98,7 @@ func (c *Client) generateDefaultLocalStorage() error {
|
||||
func (c *Client) GetSetting(key string) string {
|
||||
v, err := c.ent.Settings.Query().Where(settings.Key(key)).Only(context.TODO())
|
||||
if err != nil {
|
||||
log.Errorf("get setting by key: %s error: %v", key, err)
|
||||
log.Warnf("get setting by key: %s error: %v", key, err)
|
||||
return ""
|
||||
}
|
||||
return v.Value
|
||||
|
||||
@@ -29,50 +29,57 @@ class WelcomePage extends ConsumerWidget {
|
||||
child: Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 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: () {
|
||||
if (uri == routeMoivie) {
|
||||
context.go(MovieDetailsPage.toRoute(item.id!));
|
||||
} else {
|
||||
context.go(TvDetailsPage.toRoute(item.id!));
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 140,
|
||||
height: 210,
|
||||
child: Image.network(
|
||||
"${APIs.imagesUrl}/${item.id}/poster.jpg",
|
||||
fit: BoxFit.fill,
|
||||
headers: APIs.authHeaders,
|
||||
children: value.isEmpty
|
||||
? [
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.6,
|
||||
alignment: Alignment.center,
|
||||
child: const Text("啥都没有...", style: TextStyle(fontSize: 16),))
|
||||
]
|
||||
: 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: () {
|
||||
if (uri == routeMoivie) {
|
||||
context.go(MovieDetailsPage.toRoute(item.id!));
|
||||
} else {
|
||||
context.go(TvDetailsPage.toRoute(item.id!));
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 140,
|
||||
height: 210,
|
||||
child: Image.network(
|
||||
"${APIs.imagesUrl}/${item.id}/poster.jpg",
|
||||
fit: BoxFit.fill,
|
||||
headers: APIs.authHeaders,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 140,
|
||||
child: LinearProgressIndicator(
|
||||
value: 1,
|
||||
color: item.status == "downloaded"
|
||||
? Colors.green
|
||||
: Colors.blue,
|
||||
)),
|
||||
Text(
|
||||
item.name!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 2.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 140,
|
||||
child: LinearProgressIndicator(
|
||||
value: 1,
|
||||
color: item.status == "downloaded"
|
||||
? Colors.green
|
||||
: Colors.blue,
|
||||
)),
|
||||
Text(
|
||||
item.name!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 2.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
));
|
||||
}),
|
||||
),
|
||||
),
|
||||
_ => const MyProgressIndicator(),
|
||||
|
||||
Reference in New Issue
Block a user