46 lines
1.3 KiB
Dart
46 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:manager_app/Components/rounded_input_field.dart';
|
|
import 'package:manager_app/constants.dart';
|
|
|
|
class StringInputContainer extends StatelessWidget {
|
|
final Color color;
|
|
final String label;
|
|
final String initialValue;
|
|
final ValueChanged<String> onChanged;
|
|
final bool isUrl;
|
|
const StringInputContainer({
|
|
Key key,
|
|
this.color = kSecond,
|
|
this.label,
|
|
this.initialValue,
|
|
this.onChanged,
|
|
this.isUrl = false,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Size size = MediaQuery.of(context).size;
|
|
return Container(
|
|
child: Row(
|
|
children: [
|
|
Align(
|
|
alignment: AlignmentDirectional.centerStart,
|
|
child: Text(label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(10.0),
|
|
child: Container(
|
|
width: isUrl ? size.width *0.6 : size.width *0.2,
|
|
child: RoundedInputField(
|
|
color: kSecond,
|
|
textColor: kBlack,
|
|
initialValue: initialValue,
|
|
onChanged: onChanged,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |