Browse Source

fix UI

pull/18/head
Sun 4 years ago
parent
commit
1b37cbe184
  1. 153
      lib/pages/account_domain.dart

153
lib/pages/account_domain.dart

@ -79,89 +79,92 @@ class AccountDomainScreenState extends State<AccountDomainScreen> {
? this._providers[this._selected]! : ProviderServer.empty(); ? this._providers[this._selected]! : ProviderServer.empty();
return Scaffold( return Scaffold(
body: Center( body: Padding(
child: Column( padding: const EdgeInsets.all(20.0),
mainAxisAlignment: MainAxisAlignment.center, child: Center(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.center,
RichText( crossAxisAlignment: CrossAxisAlignment.center,
text: TextSpan( children: [
text: lang.register + ' ', RichText(
style: TextStyle( text: TextSpan(
color: color.onSurface, fontSize: 20.0, fontWeight: FontWeight.bold text: lang.register + ' ',
), style: TextStyle(
children: <TextSpan>[ color: color.onSurface, fontSize: 20.0, fontWeight: FontWeight.bold
TextSpan(text: widget.name, style: TextStyle(color: Color(0xFF6174FF))),
TextSpan(text: ' -> '),
TextSpan(text: provider.name,
style: TextStyle(color: Color(0xFF6174FF), fontStyle: FontStyle.italic)
), ),
TextSpan(text: ' ?'), children: <TextSpan>[
], TextSpan(text: widget.name, style: TextStyle(color: Color(0xFF6174FF))),
TextSpan(text: ' -> '),
TextSpan(text: provider.name,
style: TextStyle(color: Color(0xFF6174FF), fontStyle: FontStyle.italic)
),
TextSpan(text: ' ?'),
],
),
), ),
), const SizedBox(height: 10.0),
const SizedBox(height: 10.0), Container(
Container( width: 600.0,
width: 600.0, child: Text(lang.domainCreateTip),
child: Text(lang.domainCreateTip),
),
SizedBox(
height: 40.0,
child: Center(child: Text(this._exist ? lang.domainRegisterFailure : '',
style: TextStyle(color: Colors.red))),
),
if (this._showName)
Container(
width: 600.0,
height: 50.0,
padding: const EdgeInsets.symmetric(horizontal: 20.0),
decoration: BoxDecoration(
color: color.surface,
border: Border.all(
color: _nameFocus.hasFocus ? color.primary : color.surface),
borderRadius: BorderRadius.circular(10.0),
), ),
child: TextField( SizedBox(
style: TextStyle(fontSize: 16.0), height: 40.0,
decoration: InputDecoration( child: Center(child: Text(this._exist ? lang.domainRegisterFailure : '',
border: InputBorder.none, style: TextStyle(color: Colors.red))),
hintText: lang.domainName,
),
controller: _nameController,
focusNode: _nameFocus
), ),
), if (this._showName)
const SizedBox(height: 20.0), Container(
ButtonText(
enable: this._providers.length > 0 && !this._waiting,
text: this._waiting ? lang.waiting : lang.send,
action: () {
final name = _nameController.text.trim();
if (name.length > 0) {
rpc.send('domain-register', [provider.id, provider.addr, name, '']);
setState(() {
this._waiting = true;
this._exist = false;
});
}
}),
const SizedBox(height: 20.0),
InkWell(
child: Container(
width: 600.0, width: 600.0,
height: 50.0, height: 50.0,
padding: const EdgeInsets.symmetric(horizontal: 20.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Color(0xFF6174FF)), color: color.surface,
borderRadius: BorderRadius.circular(10.0)), border: Border.all(
child: Center(child: Text(lang.skip, style: TextStyle( color: _nameFocus.hasFocus ? color.primary : color.surface),
fontSize: 20.0, color: Color(0xFF6174FF) borderRadius: BorderRadius.circular(10.0),
))), ),
child: TextField(
style: TextStyle(fontSize: 16.0),
decoration: InputDecoration(
border: InputBorder.none,
hintText: lang.domainName,
),
controller: _nameController,
focusNode: _nameFocus
),
),
const SizedBox(height: 20.0),
ButtonText(
enable: this._providers.length > 0 && !this._waiting,
text: this._waiting ? lang.waiting : lang.send,
action: () {
final name = _nameController.text.trim();
if (name.length > 0) {
rpc.send('domain-register', [provider.id, provider.addr, name, '']);
setState(() {
this._waiting = true;
this._exist = false;
});
}
}),
const SizedBox(height: 20.0),
InkWell(
child: Container(
width: 600.0,
height: 50.0,
decoration: BoxDecoration(
border: Border.all(color: Color(0xFF6174FF)),
borderRadius: BorderRadius.circular(10.0)),
child: Center(child: Text(lang.skip, style: TextStyle(
fontSize: 20.0, color: Color(0xFF6174FF)
))),
),
onTap: () {
Navigator.of(context).pushNamedAndRemoveUntil("/", (Route<dynamic> route) => false);
}
), ),
onTap: () { ]
Navigator.of(context).pushNamedAndRemoveUntil("/", (Route<dynamic> route) => false); )
}
),
]
) )
) )
); );

Loading…
Cancel
Save