Skip to content

Commit

Permalink
Use flutter form git (kinda jank idk but it works)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Jul 13, 2024
1 parent f6ca82c commit 905fddd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 65 deletions.
65 changes: 2 additions & 63 deletions pub_stats/lib/view/widget/sticky_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class StickyHeader extends SliverPersistentHeaderDelegate {

Widget _buildSearchBar() {
return SearchAnchor.bar(
viewShrinkWrap: true,
viewPadding: const EdgeInsets.only(bottom: 32),
barLeading: FastBuilder(() {
if (_dataController.loading.value) {
return const Center(
Expand Down Expand Up @@ -85,69 +87,6 @@ class StickyHeader extends SliverPersistentHeaderDelegate {
);
}

// Widget _buildSearchBar() {
// return Card(
// clipBehavior: Clip.antiAlias,
// child: Row(
// children: [
// Expanded(
// child: TypeAheadField<String>(
// controller: _searchController,
// builder: (context, controller, node) => TextField(
// controller: controller,
// focusNode: node,
// autofocus: true,
// autocorrect: false,
// textCapitalization: TextCapitalization.none,
// decoration: const InputDecoration(
// border: InputBorder.none,
// hintText: 'Enter a package name',
// ),
// inputFormatters: [
// FilteringTextInputFormatter.allow(RegExp(r'[a-zA-Z0-9_\-]')),
// ],
// onSubmitted: _submit,
// ),
// suggestionsCallback: (pattern) {
// if (pattern.isEmpty) return [];
// return {
// pattern,
// ..._dataController.complete(pattern),
// }.toList();
// },
// itemBuilder: (context, suggestion) => ListTile(
// title: Text(suggestion),
// trailing: _dataController.loadedStats.isEmpty
// ? null
// : TextButton(
// onPressed: () {
// _dataController.fetchStats(suggestion, clear: false);
// _searchController.clear();
// },
// child: const Text('Compare'),
// ),
// ),
// emptyBuilder: (context) => const SizedBox.shrink(),
// errorBuilder: (context, error) {
// _logger.e(error);
// return const ListTile(title: Text('Error searching packages'));
// },
// debounceDuration: Duration.zero,
// onSelected: _submit,
// ),
// ),
// const SizedBox(width: 16),
// IconButton(
// icon: const Icon(Icons.casino),
// onPressed: _dataController.feelingLucky,
// tooltip: 'Feeling lucky?',
// ),
// const SizedBox(width: 8),
// ],
// ),
// );
// }

void _submit(String value, {bool clear = true}) {
_dataController.fetchStats(value, clear: clear);
_searchController.clear();
Expand Down
8 changes: 6 additions & 2 deletions pub_stats/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,12 @@ packages:
version: "0.68.0"
flutter:
dependency: "direct main"
description: flutter
source: sdk
description:
path: "packages/flutter"
ref: b67a0d620dff622c39aec4e07163c553777598c2
resolved-ref: b67a0d620dff622c39aec4e07163c553777598c2
url: "https://github.com/Rexios80/flutter"
source: git
version: "0.0.0"
flutter_lints:
dependency: transitive
Expand Down
6 changes: 6 additions & 0 deletions pub_stats/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ dependency_overrides:
git:
url: https://github.com/Rexios80/pub_api_client
ref: 35c52ebdd9bd37d5893f721c1b9f1cde68458b15
# TODO: Remove when https://github.com/flutter/flutter/pull/148856 lands to stable
flutter:
git:
url: https://github.com/Rexios80/flutter
ref: b67a0d620dff622c39aec4e07163c553777598c2
path: packages/flutter

flutter:
uses-material-design: true
Expand Down

0 comments on commit 905fddd

Please sign in to comment.