|
|
|
|
@ -8,7 +8,7 @@ import 'package:tangheem/classes/colors.dart';
|
|
|
|
|
import 'package:tangheem/classes/utils.dart';
|
|
|
|
|
import 'package:tangheem/models/surah_model.dart';
|
|
|
|
|
import 'package:tangheem/models/tangheem_type_model.dart';
|
|
|
|
|
import 'package:tangheem/ui/screens/surah_screen.dart';
|
|
|
|
|
import 'package:tangheem/ui/screens/quran_screen.dart';
|
|
|
|
|
import 'package:tangheem/ui/screens/tangheem_screen.dart';
|
|
|
|
|
import 'package:tangheem/widgets/common_dropdown_button.dart';
|
|
|
|
|
|
|
|
|
|
@ -147,51 +147,56 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16),
|
|
|
|
|
Container(
|
|
|
|
|
height: 50,
|
|
|
|
|
padding: EdgeInsets.only(top: 4, bottom: 6),
|
|
|
|
|
child: TextField(
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
focusNode: _searchFocusNode,
|
|
|
|
|
style: TextStyle(color: ColorConsts.primaryBlack, fontSize: 14),
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
contentPadding: EdgeInsets.fromLTRB(4, 4, 4, 4),
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
fillColor: Colors.white,
|
|
|
|
|
filled: true,
|
|
|
|
|
hintStyle: TextStyle(color: ColorConsts.textHintGrey, fontSize: 12),
|
|
|
|
|
hintText: "البحث عن سورة أو آية",
|
|
|
|
|
prefixIconConstraints: BoxConstraints(maxHeight: 16),
|
|
|
|
|
prefixIcon: Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 6),
|
|
|
|
|
child: SvgPicture.asset("assets/icons/search.svg"),
|
|
|
|
|
),
|
|
|
|
|
suffixIcon: InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
_searchFocusNode.unfocus();
|
|
|
|
|
_searchFocusNode.canRequestFocus = false;
|
|
|
|
|
await Navigator.pushNamed(context, SurahScreen.routeName, arguments: _searchController.text);
|
|
|
|
|
_searchFocusNode.canRequestFocus = true;
|
|
|
|
|
},
|
|
|
|
|
splashColor: Colors.transparent,
|
|
|
|
|
highlightColor: Colors.transparent,
|
|
|
|
|
child: Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
width: 80,
|
|
|
|
|
child: Text(
|
|
|
|
|
"بحث",
|
|
|
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: ColorConsts.secondaryPink,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
bottomLeft: Radius.circular(6),
|
|
|
|
|
topLeft: Radius.circular(6),
|
|
|
|
|
|
|
|
|
|
// todo "Sikander" : hide this search ui, later when we have search requirement, then visible this ui.
|
|
|
|
|
Visibility(
|
|
|
|
|
visible: false,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 50,
|
|
|
|
|
padding: EdgeInsets.only(top: 4, bottom: 6),
|
|
|
|
|
child: TextField(
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
focusNode: _searchFocusNode,
|
|
|
|
|
style: TextStyle(color: ColorConsts.primaryBlack, fontSize: 14),
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
contentPadding: EdgeInsets.fromLTRB(4, 4, 4, 4),
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
fillColor: Colors.white,
|
|
|
|
|
filled: true,
|
|
|
|
|
hintStyle: TextStyle(color: ColorConsts.textHintGrey, fontSize: 12),
|
|
|
|
|
hintText: "البحث عن سورة أو آية",
|
|
|
|
|
prefixIconConstraints: BoxConstraints(maxHeight: 16),
|
|
|
|
|
prefixIcon: Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 6),
|
|
|
|
|
child: SvgPicture.asset("assets/icons/search.svg"),
|
|
|
|
|
),
|
|
|
|
|
suffixIcon: InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
_searchFocusNode.unfocus();
|
|
|
|
|
_searchFocusNode.canRequestFocus = false;
|
|
|
|
|
await Navigator.pushNamed(context, QuranScreen.routeName, arguments: _searchController.text);
|
|
|
|
|
_searchFocusNode.canRequestFocus = true;
|
|
|
|
|
},
|
|
|
|
|
splashColor: Colors.transparent,
|
|
|
|
|
highlightColor: Colors.transparent,
|
|
|
|
|
child: Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
width: 80,
|
|
|
|
|
child: Text(
|
|
|
|
|
"بحث",
|
|
|
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: ColorConsts.secondaryPink,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
bottomLeft: Radius.circular(6),
|
|
|
|
|
topLeft: Radius.circular(6),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(6), borderSide: BorderSide.none),
|
|
|
|
|
),
|
|
|
|
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(6), borderSide: BorderSide.none),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
|