mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-17 09:54:19 +01:00
simple support for nip07
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:nostr_sdk/utils/string_util.dart';
|
||||
import 'package:nowser/const/app_type.dart';
|
||||
import 'package:nowser/const/base.dart';
|
||||
import 'package:nowser/data/app.dart';
|
||||
|
||||
import '../app/app_type_component.dart';
|
||||
|
||||
class AuthAppInfoComponent extends StatefulWidget {
|
||||
App app;
|
||||
|
||||
AuthAppInfoComponent({required this.app});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return _AuthAppInfoComponent();
|
||||
@@ -16,6 +22,26 @@ class _AuthAppInfoComponent extends State<AuthAppInfoComponent> {
|
||||
Widget build(BuildContext context) {
|
||||
var themeData = Theme.of(context);
|
||||
|
||||
String? name;
|
||||
String? des;
|
||||
if (StringUtil.isNotBlank(widget.app.name)) {
|
||||
name = widget.app.name;
|
||||
des = widget.app.code;
|
||||
} else if (StringUtil.isBlank(widget.app.name)) {
|
||||
name = widget.app.code;
|
||||
}
|
||||
|
||||
List<Widget> rightList = [];
|
||||
if (StringUtil.isNotBlank(name)) {
|
||||
rightList.add(Text(
|
||||
name!,
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
));
|
||||
}
|
||||
if (StringUtil.isNotBlank(des)) {
|
||||
rightList.add(Text(des!));
|
||||
}
|
||||
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
@@ -24,12 +50,13 @@ class _AuthAppInfoComponent extends State<AuthAppInfoComponent> {
|
||||
height: 64,
|
||||
child: Card(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(Base.BASE_PADDING_HALF),
|
||||
padding: const EdgeInsets.all(Base.BASE_PADDING_HALF),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: Base.BASE_PADDING_HALF),
|
||||
margin:
|
||||
const EdgeInsets.only(right: Base.BASE_PADDING_HALF),
|
||||
child: Icon(
|
||||
Icons.image,
|
||||
size: 46,
|
||||
@@ -38,13 +65,7 @@ class _AuthAppInfoComponent extends State<AuthAppInfoComponent> {
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"APP NAME",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text("This is App info des"),
|
||||
],
|
||||
children: rightList,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user