Files

106 lines
3.7 KiB
Dart

import 'package:flutter/material.dart';
import '../../../../theme.dart';
import '../../../../size_config.dart';
class FieldKupon extends StatelessWidget {
final TextEditingController controler;
final IconButton? prefix;
const FieldKupon({Key? key, required this.controler, this.prefix})
: super(key: key);
@override
Widget build(BuildContext context) {
OutlineInputBorder outlineInputBorder = OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
gapPadding: 10,
);
// width: SizeConfig.screenWidth * 0.9,
// height: 33,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(15),
// border: Border.all(
// color: kSecondaryColor.withOpacity(0.5),
// width: 2,
// return Scaffold(
// body: Container(
// height: 36,
// //padding: EdgeInsets.only(top: getProportionateScreenWidth(20)),
// child: TextField(
// controller: controler,
// cursorColor: secondaryColor,
// enabled: true,
// //obscureText: true,
// textAlignVertical: TextAlignVertical.center,
// style: TextStyle(fontSize: 12, color: Colors.white),
// onChanged: (value) => print(value),
// decoration: InputDecoration(
// //isDense: true,
// contentPadding: EdgeInsets.only(top: 10, left: 15),
// filled: true,
// fillColor: Colors.transparent,
// enabledBorder: outlineInputBorder,
// focusedBorder: outlineInputBorder,
// border: outlineInputBorder,
// hintText: "Masukkan kode kupon",
// hintStyle: primaryTextStyle.copyWith(
// fontSize: 12,
// color: fourthColor,
// fontWeight: reguler,
// letterSpacing: 0.5),
// ),
// ),
// ),
// // SizedBox(height: getProportionateScreenHeight(16)),
// );
return Column(
children: [
Container(
height: getProportionateScreenHeight(32),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Theme.of(context).brightness == Brightness.dark
? seventeenColor.withOpacity(0.9)
: secondaryColor.withOpacity(0.2),
),
child: TextField(
controller: controler,
cursorColor: Theme.of(context).colorScheme.onPrimary,
enabled: true,
textAlignVertical: TextAlignVertical.center,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).colorScheme.onPrimary,
),
onChanged: (value) => print(value),
decoration: InputDecoration(
prefix: prefix,
contentPadding: EdgeInsets.only(
top: getProportionateScreenHeight(10),
left: getProportionateScreenWidth(15),
),
filled: true,
fillColor: Colors.transparent,
enabledBorder: outlineInputBorder,
focusedBorder: outlineInputBorder,
border: outlineInputBorder,
hintText: "Masukkan kode kupon",
hintStyle: thirdTextStyle.copyWith(
fontSize: getProportionateScreenWidth(10),
color: Theme.of(context).brightness == Brightness.dark
? baruTextutih.withOpacity(0.5)
: Colors.grey,
fontWeight: reguler,
letterSpacing: 0.5,
),
),
),
),
SizedBox(height: getProportionateScreenHeight(16)),
],
);
}
}