-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53d6d69
commit 8ae77a5
Showing
9 changed files
with
171 additions
and
57 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
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
64 changes: 64 additions & 0 deletions
64
lib/app/features/dapps/views/pages/dapps_list/dapps_list.dart
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,64 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_hooks/flutter_hooks.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
import 'package:ice/app/constants/ui.dart'; | ||
import 'package:ice/app/extensions/build_context.dart'; | ||
import 'package:ice/app/extensions/theme_data.dart'; | ||
import 'package:ice/app/features/dapps/views/pages/mocks/mocked_apps.dart'; | ||
import 'package:ice/app/features/dapps/views/pages/widgets/apps_collection.dart'; | ||
import 'package:ice/app/shared/widgets/navigation_header/navigation_header.dart'; | ||
import 'package:ice/app/shared/widgets/search/search.dart'; | ||
|
||
class DAppsList extends HookConsumerWidget { | ||
const DAppsList({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final ValueNotifier<String> searchText = useState(''); | ||
|
||
final List<DAppItem> filteredApps = searchText.value.isEmpty | ||
? featured | ||
: featured.where((DAppItem app) { | ||
final String searchLower = searchText.value.toLowerCase().trim(); | ||
final String titleLower = app.title.toLowerCase(); | ||
|
||
return titleLower.contains(searchLower); | ||
}).toList(); | ||
|
||
return Scaffold( | ||
body: Container( | ||
margin: const EdgeInsets.only(top: kDefaultNavHeaderTopPadding), | ||
width: double.infinity, | ||
color: context.theme.appColors.secondaryBackground, | ||
child: Stack( | ||
children: <Widget>[ | ||
const NavigationHeader( | ||
title: 'DeFi', | ||
), | ||
Padding( | ||
padding: const EdgeInsets.only(top: navigationHeaderHeight), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
Search( | ||
onTextChanged: (String value) => searchText.value = value, | ||
onClearText: () => searchText.value = '', | ||
), | ||
Expanded( | ||
child: ListView.builder( | ||
itemCount: filteredApps.length, | ||
itemBuilder: (BuildContext context, int index) { | ||
final DAppItem app = filteredApps[index]; | ||
return DAppGridItem(item: app, showIsFavourite: true); | ||
}, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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
21 changes: 4 additions & 17 deletions
21
lib/app/features/dapps/views/pages/mocks/mocked_featured.dart
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
Oops, something went wrong.