You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.7 KiB
Dart
67 lines
1.7 KiB
Dart
3 years ago
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
String selectedRegion = "";
|
||
3 years ago
|
|
||
|
Widget locationTemplate(next, location) {
|
||
|
return Container(
|
||
|
padding: const EdgeInsets.all(8),
|
||
|
child: ElevatedButton(
|
||
|
onPressed: () {
|
||
|
next();
|
||
|
selectedRegion = location.name;
|
||
|
},
|
||
|
style: TextButton.styleFrom(
|
||
|
primary: Colors.white,
|
||
|
backgroundColor: const Color.fromARGB(100, 169, 0, 255),
|
||
|
padding: const EdgeInsets.all(10),
|
||
|
),
|
||
|
child: Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
children: [
|
||
|
Text(location.name),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
//color: Color.fromARGB(255, 83, 83, 83),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Widget region(next, locations) {
|
||
3 years ago
|
return SingleChildScrollView(
|
||
|
child: Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||
|
children: [
|
||
|
const SizedBox(height: 20),
|
||
|
Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
children: const [
|
||
|
Text(
|
||
|
'Please choose your Locale',
|
||
|
style: TextStyle(
|
||
|
fontSize: 50,
|
||
|
fontWeight: FontWeight.bold,
|
||
|
color: Color.fromARGB(255, 169, 0, 255)),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
const SizedBox(height: 10),
|
||
|
GridView.count(
|
||
|
primary: false,
|
||
|
padding: const EdgeInsets.all(20),
|
||
|
shrinkWrap: true,
|
||
|
crossAxisSpacing: 10,
|
||
|
mainAxisSpacing: 10,
|
||
|
crossAxisCount: 3,
|
||
3 years ago
|
children: locations
|
||
|
.map<Widget>((location) => locationTemplate(next, location))
|
||
|
.toList(),
|
||
3 years ago
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
String getSelectedRegion() {
|
||
|
return selectedRegion;
|
||
|
}
|