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.
jade_gui/lib/functions/keymap/variant.dart

44 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
String chosenVariant = "none";
String getChosenVariant() {
return chosenVariant;
}
Widget variantButton(variant, nextPage) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
ElevatedButton(
onPressed: () {
chosenVariant = variant;
nextPage();
},
child: Text(variant),
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: const Color.fromARGB(100, 169, 0, 255),
),
),
const SizedBox(height: 10),
],
);
}
Widget variant(keymap, nextPage) {
return Container(
padding: const EdgeInsets.all(8),
color: const Color.fromARGB(100, 169, 0, 255),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: keymap.variant
.map<Widget>((variant) => variantButton(variant, nextPage))
.toList()),
),
);
}