increase min sdk and apply new formatter

This commit is contained in:
Fabian Freund
2025-02-18 15:37:03 +01:00
parent f7885fc829
commit a1ee8bef35
266 changed files with 11329 additions and 10058 deletions
@@ -45,38 +45,43 @@ class BangCategoriesScreen extends HookConsumerWidget {
expanded.value = {...expanded.value}..remove(key);
}
},
children: categories.entries
.map(
(category) => ExpansionPanel(
canTapOnHeader: true,
isExpanded: expanded.value.contains(category.key),
headerBuilder: (context, isExpanded) => ListTile(
title: Text(category.key),
),
body: Padding(
padding: const EdgeInsets.only(left: 16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: category.value
.map(
(subCategory) => ListTile(
title: Text(subCategory),
onTap: () async {
await context.push(
BangSubCategoryRoute(
category: category.key,
subCategory: subCategory,
).location,
);
},
),
)
.toList(),
children:
categories.entries
.map(
(category) => ExpansionPanel(
canTapOnHeader: true,
isExpanded: expanded.value.contains(
category.key,
),
headerBuilder:
(context, isExpanded) =>
ListTile(title: Text(category.key)),
body: Padding(
padding: const EdgeInsets.only(left: 16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children:
category.value
.map(
(subCategory) => ListTile(
title: Text(subCategory),
onTap: () async {
await context.push(
BangSubCategoryRoute(
category: category.key,
subCategory:
subCategory,
).location,
);
},
),
)
.toList(),
),
),
),
),
),
)
.toList(),
)
.toList(),
);
},
),
@@ -84,12 +89,13 @@ class BangCategoriesScreen extends HookConsumerWidget {
},
);
},
error: (error, stackTrace) => Center(
child: FailureWidget(
title: 'Failed to load Bang Categories',
exception: error,
),
),
error:
(error, stackTrace) => Center(
child: FailureWidget(
title: 'Failed to load Bang Categories',
exception: error,
),
),
loading: () => const Center(child: CircularProgressIndicator()),
),
);
@@ -35,9 +35,7 @@ class BangListScreen extends HookConsumerWidget {
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar.medium(
title: Text('$category: $subCategory'),
),
SliverAppBar.medium(title: Text('$category: $subCategory')),
bangsAsync.when(
data: (bangs) {
return SliverList.builder(
@@ -53,10 +51,10 @@ class BangListScreen extends HookConsumerWidget {
if (ref.read(bottomSheetControllerProvider)
is! CreateTabSheet) {
ref.read(bottomSheetControllerProvider.notifier).show(
CreateTabSheet(
preferredTool: KagiTool.search,
),
ref
.read(bottomSheetControllerProvider.notifier)
.show(
CreateTabSheet(preferredTool: KagiTool.search),
);
}
@@ -66,17 +64,19 @@ class BangListScreen extends HookConsumerWidget {
},
);
},
error: (error, stackTrace) => SliverToBoxAdapter(
child: Center(
child: FailureWidget(
title: 'Failed to load Bangs',
exception: error,
error:
(error, stackTrace) => SliverToBoxAdapter(
child: Center(
child: FailureWidget(
title: 'Failed to load Bangs',
exception: error,
),
),
),
loading:
() => const SliverToBoxAdapter(
child: Center(child: CircularProgressIndicator()),
),
),
),
loading: () => const SliverToBoxAdapter(
child: Center(child: CircularProgressIndicator()),
),
),
],
),
@@ -22,8 +22,9 @@ class BangSearchScreen extends HookConsumerWidget {
final resultsAsync = ref.watch(bangSearchProvider);
final incognitoEnabled = ref.watch(incognitoModeEnabledProvider);
final textEditingController =
useTextEditingController(text: initialSearchText);
final textEditingController = useTextEditingController(
text: initialSearchText,
);
useListenableCallback(textEditingController, () async {
unawaited(
@@ -57,42 +58,44 @@ class BangSearchScreen extends HookConsumerWidget {
),
body: resultsAsync.when(
skipLoadingOnReload: true,
data: (bangs) => FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView.builder(
controller: controller,
itemCount: bangs.length,
itemBuilder: (context, index) {
final bang = bangs[index];
return BangDetails(
bang,
onTap: () {
ref
.read(selectedBangTriggerProvider().notifier)
.setTrigger(bang.trigger);
data:
(bangs) => FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView.builder(
controller: controller,
itemCount: bangs.length,
itemBuilder: (context, index) {
final bang = bangs[index];
return BangDetails(
bang,
onTap: () {
ref
.read(selectedBangTriggerProvider().notifier)
.setTrigger(bang.trigger);
// if (ref.read(bottomSheetControllerProvider)
// is! CreateTabSheet) {
// ref.read(bottomSheetControllerProvider.notifier).show(
// CreateTabSheet(preferredTool: KagiTool.search),
// );
// }
// if (ref.read(bottomSheetControllerProvider)
// is! CreateTabSheet) {
// ref.read(bottomSheetControllerProvider.notifier).show(
// CreateTabSheet(preferredTool: KagiTool.search),
// );
// }
// context.go(BrowserRoute().location);
context.pop();
// context.go(BrowserRoute().location);
context.pop();
},
);
},
);
},
);
},
),
error: (error, stackTrace) => Center(
child: FailureWidget(
title: 'Bang Search failed',
exception: error,
),
),
),
error:
(error, stackTrace) => Center(
child: FailureWidget(
title: 'Bang Search failed',
exception: error,
),
),
loading: () => const SizedBox.shrink(),
),
);
@@ -63,8 +63,9 @@ class BangDetails extends HookConsumerWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FilledButton.tonalIcon(
style:
const ButtonStyle(visualDensity: VisualDensity.compact),
style: const ButtonStyle(
visualDensity: VisualDensity.compact,
),
onPressed: () async {
final url = Uri.parse(bangData.getUrl('').origin);
@@ -79,9 +80,7 @@ class BangDetails extends HookConsumerWidget {
label: Text(bangData.domain),
icon: const Icon(Icons.open_in_new),
),
const SizedBox(
width: 8,
),
const SizedBox(width: 8),
Expanded(
child: Text(
'!${bangData.trigger}',
@@ -30,14 +30,11 @@ class SiteSearch extends HookConsumerWidget {
final searchTextController = useTextEditingController();
useListenableCallback(
searchTextController,
() async {
ref
.read(searchSuggestionsProvider().notifier)
.addQuery(searchTextController.text);
},
);
useListenableCallback(searchTextController, () async {
ref
.read(searchSuggestionsProvider().notifier)
.addQuery(searchTextController.text);
});
final selectedBang = ref.watch(selectedBangDataProvider(domain: domain));
@@ -73,15 +70,11 @@ class SiteSearch extends HookConsumerWidget {
selectedItem: selectedBang,
onSelected: (bang) {
ref
.read(
selectedBangTriggerProvider(domain: domain).notifier,
)
.read(selectedBangTriggerProvider(domain: domain).notifier)
.setTrigger(bang.trigger);
},
onDeleted: (bang) {
if (ref.read(
selectedBangTriggerProvider(domain: domain),
) ==
if (ref.read(selectedBangTriggerProvider(domain: domain)) ==
bang.trigger) {
ref
.read(