-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from nullhandler/search-fn
Added search txns , Play store redirect
- Loading branch information
Showing
10 changed files
with
179 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flutter build apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:vase/enums.dart'; | ||
import 'package:vase/screens/transactions/date_list_item.dart'; | ||
import 'package:vase/screens/transactions/trans_controller.dart'; | ||
import 'package:vase/screens/widgets/empty.dart'; | ||
|
||
class CustomSearchDelegate extends SearchDelegate<String> { | ||
final TransController _controller = Get.find<TransController>(); | ||
|
||
Widget results() { | ||
return Obx(() { | ||
_controller.query.value = query; | ||
_controller.searchTransactions(); | ||
if (_controller.searchTxns.isEmpty && | ||
_controller.searchTransState.value != VaseState.loading || | ||
query == '') { | ||
return const EmptyWidget( | ||
assetName: "assets/img/no_txn.svg", | ||
label: "No Transactions Found !"); | ||
} else if (_controller.searchTxns.isEmpty && | ||
_controller.transState.value == VaseState.loading) { | ||
return const Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
} | ||
return ListView.builder( | ||
physics: const BouncingScrollPhysics(), | ||
padding: const EdgeInsets.only(top: 20), | ||
shrinkWrap: true, | ||
itemCount: _controller.searchTxns.length, | ||
itemBuilder: (context, pos) { | ||
return DateListItem( | ||
isSearch: true, | ||
date: _controller.searchTxns.keys.elementAt(pos), | ||
transactions: _controller.searchTxns.values.elementAt(pos)); | ||
}); | ||
}); | ||
} | ||
|
||
@override | ||
List<Widget> buildActions(BuildContext context) { | ||
return [ | ||
IconButton( | ||
icon: const Icon(Icons.clear), | ||
onPressed: () { | ||
query = ''; | ||
_controller.query.value = ''; | ||
}, | ||
), | ||
]; | ||
} | ||
|
||
@override | ||
Widget buildLeading(BuildContext context) { | ||
return IconButton( | ||
icon: const Icon(Icons.arrow_back), | ||
onPressed: () => Get.back(), | ||
); | ||
} | ||
|
||
@override | ||
Widget buildResults(BuildContext context) { | ||
return results(); | ||
} | ||
|
||
@override | ||
Widget buildSuggestions(BuildContext context) { | ||
return results(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters