mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 18:35:28 +03:00
update
This commit is contained in:
@@ -48,11 +48,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_searchFocusNode.addListener(() {
|
|
||||||
if (_searchFocusNode.hasFocus) {
|
|
||||||
_scrollToSearch();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -66,9 +61,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
void _scrollToSearch() {
|
void _scrollToSearch() {
|
||||||
if (!_scrollController.hasClients) return;
|
if (!_scrollController.hasClients) return;
|
||||||
_scrollController.animateTo(
|
_scrollController.animateTo(
|
||||||
320.0,
|
400.0,
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 500),
|
||||||
curve: Curves.easeOut,
|
curve: Curves.fastOutSlowIn,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,15 +134,12 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
_BudgetProgress(spent: monthExpense, budget: budget, currencyInfo: currencyInfo),
|
_BudgetProgress(spent: monthExpense, budget: budget, currencyInfo: currencyInfo),
|
||||||
],
|
],
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
GestureDetector(
|
_SearchBar(
|
||||||
onTap: _scrollToSearch,
|
|
||||||
behavior: HitTestBehavior.translucent,
|
|
||||||
child: _SearchBar(
|
|
||||||
controller: _searchController,
|
controller: _searchController,
|
||||||
focusNode: _searchFocusNode,
|
focusNode: _searchFocusNode,
|
||||||
|
onTap: _scrollToSearch,
|
||||||
ref: ref,
|
ref: ref,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
_FilterChips(selected: filter, ref: ref),
|
_FilterChips(selected: filter, ref: ref),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
@@ -192,10 +184,12 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
class _SearchBar extends StatelessWidget {
|
class _SearchBar extends StatelessWidget {
|
||||||
final TextEditingController controller;
|
final TextEditingController controller;
|
||||||
final FocusNode focusNode;
|
final FocusNode focusNode;
|
||||||
|
final VoidCallback onTap;
|
||||||
final WidgetRef ref;
|
final WidgetRef ref;
|
||||||
const _SearchBar({
|
const _SearchBar({
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.focusNode,
|
required this.focusNode,
|
||||||
|
required this.onTap,
|
||||||
required this.ref,
|
required this.ref,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -204,6 +198,7 @@ class _SearchBar extends StatelessWidget {
|
|||||||
return TextField(
|
return TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
|
onTap: onTap,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'Search transactions...',
|
hintText: 'Search transactions...',
|
||||||
prefixIcon: Icon(Icons.search_rounded, color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6)),
|
prefixIcon: Icon(Icons.search_rounded, color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6)),
|
||||||
|
|||||||
Reference in New Issue
Block a user