Browse Source

Added space between welcome message and inputs, and between inputs and the custom instance toggle. Left aligned labels

master
Robby Zambito 6 months ago
parent
commit
a0804ed741
1 changed files with 85 additions and 67 deletions
  1. +85
    -67
      lib/views/unauthenticated/instance_selector.dart

+ 85
- 67
lib/views/unauthenticated/instance_selector.dart View File

@ -108,82 +108,100 @@ class _InstanceSelectorState extends State {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: <Widget>[
!_isCustomInstance
? Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 0),
const leftLabelInset = 30.0;
return Column(
children: <Widget>[
!_isCustomInstance
? Column(
children: [
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.only(left: leftLabelInset),
child: Text("Country"),
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedCountryIndex,
child: _buildCountryList()[_selectedCountryIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedCountryIndex = index;
_selectedStateIndex = 0;
_selectedCityIndex = 0;
});
},
items: _buildCountryList(),
),
_selectedCountryHasStates()
? Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 10),
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedCountryIndex,
child: _buildCountryList()[_selectedCountryIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedCountryIndex = index;
_selectedStateIndex = 0;
_selectedCityIndex = 0;
});
},
items: _buildCountryList(),
),
_selectedCountryHasStates()
? Column(
children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.only(
left: leftLabelInset, top: 10),
child: Text("State"),
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedStateIndex,
child: _buildStateList()[_selectedStateIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedStateIndex = index;
_selectedCityIndex = 0;
});
},
items: _buildStateList(),
),
],
)
: SizedBox.shrink(),
Padding(
padding: const EdgeInsets.only(top: 10),
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedStateIndex,
child: _buildStateList()[_selectedStateIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedStateIndex = index;
_selectedCityIndex = 0;
});
},
items: _buildStateList(),
),
],
)
: SizedBox.shrink(),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding:
const EdgeInsets.only(left: leftLabelInset, top: 10),
child: Text("City"),
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedCityIndex,
child: _buildCityList()[_selectedCityIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedCityIndex = index;
});
},
items: _buildCityList(),
),
],
)
: Column(
children: <Widget>[TextFormField()],
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedCityIndex,
child: _buildCityList()[_selectedCityIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedCityIndex = index;
});
},
items: _buildCityList(),
),
],
)
: Column(
children: <Widget>[TextFormField()],
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
child: GestureDetector(
onTap: this._toggleIsCustomInstance,
child: Padding(
padding: const EdgeInsets.all(15),
child: Text(_isCustomInstance
? "Connect to a Hamlet instance instead"
: "Connect to a custom instance instead"),
),
GestureDetector(
onTap: this._toggleIsCustomInstance,
child: Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(_isCustomInstance
? "Connect to a Hamlet instance instead"
: "Connect to a custom instance instead"),
),
),
),
],
),
),
],
);
}
}

Loading…
Cancel
Save