2022-09-04 19:54:21 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
|
|
|
class OptionsTextField extends StatelessWidget {
|
|
|
|
const OptionsTextField({Key? key, required this.hint}) : super(key: key);
|
2023-01-30 13:35:06 +01:00
|
|
|
final String hint;
|
2022-09-04 19:54:21 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final sHeight = MediaQuery.of(context).size.height;
|
|
|
|
final sWidth = MediaQuery.of(context).size.width;
|
|
|
|
return Container(
|
|
|
|
margin: const EdgeInsets.only(top: 12, bottom: 6),
|
2023-01-30 13:35:06 +01:00
|
|
|
padding: EdgeInsets.zero,
|
2022-09-04 19:54:21 +02:00
|
|
|
child: TextField(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxHeight: sHeight * 0.05,
|
|
|
|
maxWidth: sWidth * 1,
|
|
|
|
),
|
|
|
|
border: const OutlineInputBorder(),
|
|
|
|
labelText: hint,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class OptionsFilePicker extends StatelessWidget {
|
|
|
|
const OptionsFilePicker({Key? key, required this.optionName})
|
|
|
|
: super(key: key);
|
2023-01-30 13:35:06 +01:00
|
|
|
final String optionName;
|
2022-09-04 19:54:21 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 4.0),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
2022-09-12 15:20:25 +02:00
|
|
|
children: <Widget>[
|
2022-09-04 19:54:21 +02:00
|
|
|
I18nText(
|
|
|
|
optionName,
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.inter(
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ElevatedButton(
|
|
|
|
style: ButtonStyle(
|
|
|
|
backgroundColor: MaterialStateProperty.all(
|
2022-09-06 19:07:23 +02:00
|
|
|
Theme.of(context).colorScheme.primary,
|
2022-09-04 19:54:21 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
// pick files
|
|
|
|
},
|
2022-09-06 19:07:23 +02:00
|
|
|
child: Text(
|
|
|
|
'Select File',
|
|
|
|
style: TextStyle(
|
2023-02-19 04:16:49 +01:00
|
|
|
color: Theme.of(context).textTheme.bodyLarge?.color,
|
2022-09-06 19:07:23 +02:00
|
|
|
),
|
|
|
|
),
|
2022-09-04 19:54:21 +02:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|