revanced-manager/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart
EvadeMaster 3ae4d69110
chore: migrate deprecation code && code cleanup (#708)
Fixes all issues in `flutter analyze`.
<Reviewed>

Commits:
* chore: migrate deprecated text style

* chore: migrate `toggleableActiveColor` to individual theme

* chore: don't use 'BuildContext's across async gaps
2023-02-20 16:53:53 +07:00

73 lines
2.0 KiB
Dart

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);
final String hint;
@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),
padding: EdgeInsets.zero,
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);
final String optionName;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
I18nText(
optionName,
child: Text(
'',
style: GoogleFonts.inter(
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.primary,
),
),
onPressed: () {
// pick files
},
child: Text(
'Select File',
style: TextStyle(
color: Theme.of(context).textTheme.bodyLarge?.color,
),
),
),
],
),
);
}
}