Browse Source

Increased size of instance selection fields, started adding background also

master
Robby Zambito 5 months ago
parent
commit
44d1b22bc4
2 changed files with 41 additions and 35 deletions
  1. +21
    -15
      lib/views/unauthenticated/instance_selector.dart
  2. +20
    -20
      pubspec.lock

+ 21
- 15
lib/views/unauthenticated/instance_selector.dart View File

@ -34,6 +34,8 @@ class _InstanceSelectorState extends State {
var _isCustomInstance = false;
final _formKey = GlobalKey<FormState>();
static const _selectionScaleFactor = 1.5;
List<Widget> _buildCountryList() {
if (this.widget._hamletInstances.isEmpty) {
return [Text("None")];
@ -48,7 +50,7 @@ class _InstanceSelectorState extends State {
res.sort();
return res.map((c) => Text(c)).toList();
return res.map((c) => Text(c, textScaleFactor: _selectionScaleFactor)).toList();
}
int _selectedCountryIndex = 0;
@ -69,7 +71,7 @@ class _InstanceSelectorState extends State {
.toSet()
.toList();
return res.map((s) => Text(s)).toList();
return res.map((s) => Text(s, textScaleFactor: _selectionScaleFactor)).toList();
}
int _selectedStateIndex = 0;
@ -93,7 +95,7 @@ class _InstanceSelectorState extends State {
.toList();
res.sort();
return res.map((c) => Text(c)).toList();
return res.map((c) => Text(c, textScaleFactor: _selectionScaleFactor)).toList();
}
int _selectedCityIndex = 0;
@ -122,18 +124,22 @@ class _InstanceSelectorState extends State {
child: Text("Country"),
),
),
DirectSelect(
itemExtent: 35,
selectedIndex: _selectedCountryIndex,
child: _buildCountryList()[_selectedCountryIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedCountryIndex = index;
_selectedStateIndex = 0;
_selectedCityIndex = 0;
});
},
items: _buildCountryList(),
Container(
color: Color.fromRGBO(153, 153, 153, .4),
padding: const EdgeInsets.all(10),
child: DirectSelect(
itemExtent: 35,
selectedIndex: _selectedCountryIndex,
child: _buildCountryList()[_selectedCountryIndex],
onSelectedItemChanged: (index) {
setState(() {
_selectedCountryIndex = index;
_selectedStateIndex = 0;
_selectedCityIndex = 0;
});
},
items: _buildCountryList(),
),
),
_selectedCountryHasStates()
? Column(

+ 20
- 20
pubspec.lock View File

@ -7,42 +7,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.2"
version: "2.5.0-nullsafety.3"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.2"
version: "2.1.0-nullsafety.3"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.4"
version: "1.1.0-nullsafety.5"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.2"
version: "1.2.0-nullsafety.3"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
version: "1.1.0-nullsafety.3"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.4"
version: "1.15.0-nullsafety.5"
convert:
dependency: transitive
description:
@ -91,7 +91,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.2"
version: "1.2.0-nullsafety.3"
feather_icons_flutter:
dependency: transitive
description:
@ -162,7 +162,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3-nullsafety.2"
version: "0.6.3-nullsafety.3"
json_annotation:
dependency: transitive
description:
@ -176,14 +176,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.2"
version: "0.12.10-nullsafety.3"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
version: "1.3.0-nullsafety.6"
nested:
dependency: transitive
description:
@ -197,7 +197,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.0-nullsafety.3"
path_provider_linux:
dependency: transitive
description:
@ -332,42 +332,42 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
version: "1.8.0-nullsafety.4"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.5"
version: "1.10.0-nullsafety.6"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.2"
version: "2.1.0-nullsafety.3"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
version: "1.1.0-nullsafety.3"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.2"
version: "1.2.0-nullsafety.3"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.4"
version: "0.2.19-nullsafety.6"
timeago:
dependency: transitive
description:
@ -381,7 +381,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.5"
url_launcher:
dependency: transitive
description:
@ -430,7 +430,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.4"
version: "2.1.0-nullsafety.5"
web_socket_channel:
dependency: transitive
description:
@ -453,5 +453,5 @@ packages:
source: hosted
version: "0.1.2"
sdks:
dart: ">=2.11.0-0.0 <2.12.0"
dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0 <2.0.0"

Loading…
Cancel
Save