mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Layout created for single screen app (#2)
This commit is contained in:
37
lib/views/DropDownBox.dart
Normal file
37
lib/views/DropDownBox.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:dropdown_search/dropdown_search.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Utils/Constants.dart';
|
||||
|
||||
class DropDownBox extends StatelessWidget {
|
||||
final List<String> _selection;
|
||||
final Function(String?) _onChanged;
|
||||
|
||||
const DropDownBox(this._selection, this._onChanged, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
color: colourThree,
|
||||
elevation: 2,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(22))),
|
||||
child: DropdownSearch<String>(
|
||||
popupProps: const PopupProps.dialog(showSearchBox: true),
|
||||
items: _selection,
|
||||
dropdownDecoratorProps: const DropDownDecoratorProps(
|
||||
dropdownSearchDecoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.all(14),
|
||||
border: InputBorder.none,
|
||||
filled: true,
|
||||
fillColor: Colors.transparent,
|
||||
hintText: "Select a currency",
|
||||
),
|
||||
),
|
||||
onChanged: _onChanged,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
36
lib/views/EditText.dart
Normal file
36
lib/views/EditText.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Utils/Constants.dart';
|
||||
|
||||
class EditText extends StatelessWidget {
|
||||
final String _hintText;
|
||||
final String? _input;
|
||||
final Function(String?) _onChanged;
|
||||
|
||||
const EditText(this._hintText, this._input, this._onChanged, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 4),
|
||||
child: TextField(
|
||||
controller: TextEditingController(
|
||||
text: _input
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(14),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(22)),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: colourTwo,
|
||||
hintText: _hintText,
|
||||
),
|
||||
onChanged: _onChanged,
|
||||
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user