mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +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 {
|
func (c *Client) GetSetting(key string) string {
|
||||||
v, err := c.ent.Settings.Query().Where(settings.Key(key)).Only(context.TODO())
|
v, err := c.ent.Settings.Query().Where(settings.Key(key)).Only(context.TODO())
|
||||||
if err != nil {
|
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 ""
|
||||||
}
|
}
|
||||||
return v.Value
|
return v.Value
|
||||||
|
|||||||
@@ -29,7 +29,14 @@ class WelcomePage extends ConsumerWidget {
|
|||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
runSpacing: 20,
|
runSpacing: 20,
|
||||||
children: List.generate(value.length, (i) {
|
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];
|
var item = value[i];
|
||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
|
|||||||
Reference in New Issue
Block a user