38 lines
1000 B
Dart
38 lines
1000 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:notube/constants.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:notube/states/dlFormState.dart';
|
|
|
|
class UrlTextField extends StatelessWidget {
|
|
const UrlTextField({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var dlForm = context.watch<DlFormState>();
|
|
|
|
return Flexible(
|
|
child: TextFormField(
|
|
decoration: InputDecoration(
|
|
border: InputBorder.none,
|
|
hintText: 'search_url'.tr(),
|
|
filled: true,
|
|
fillColor: colorBackgroundBlack,
|
|
contentPadding: EdgeInsets.symmetric(
|
|
horizontal: 20,
|
|
),
|
|
),
|
|
validator: (value) {
|
|
if (value == null || value.isEmpty) {
|
|
return 'Please enter some text';
|
|
}
|
|
return null;
|
|
},
|
|
onChanged: (value) {
|
|
dlForm.setUrl(value);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|