mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
28 lines
806 B
Dart
28 lines
806 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:wger/core/validators.dart';
|
|
import 'package:wger/l10n/generated/app_localizations.dart';
|
|
|
|
class ServerField extends StatelessWidget {
|
|
final TextEditingController controller;
|
|
final Function(String?) onSaved;
|
|
|
|
const ServerField({required this.controller, required this.onSaved, super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final i18n = AppLocalizations.of(context);
|
|
|
|
return TextFormField(
|
|
key: const Key('inputServer'),
|
|
decoration: InputDecoration(
|
|
labelText: i18n.customServerUrl,
|
|
helperText: i18n.customServerHint,
|
|
helperMaxLines: 4,
|
|
),
|
|
controller: controller,
|
|
validator: (value) => validateUrl(value, i18n, required: true),
|
|
onSaved: onSaved,
|
|
);
|
|
}
|
|
}
|