dart format
This commit is contained in:
@@ -82,10 +82,11 @@ class AiConfigurationPage extends HookConsumerWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'Things to keep in mind\n\n',
|
||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onError,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
style: Theme.of(context).textTheme.headlineSmall
|
||||
?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onError,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const TextSpan(text: '• '),
|
||||
const TextSpan(
|
||||
|
||||
@@ -65,115 +65,117 @@ class DefaultSearchPage extends HookConsumerWidget {
|
||||
return BrowserPage(
|
||||
child: BrowserPageContent(
|
||||
child: bangs.when(
|
||||
skipLoadingOnReload: true,
|
||||
data: (availableBangs) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
Center(
|
||||
child: Text('Search', style: theme.textTheme.headlineMedium),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const ListTile(
|
||||
title: Text('Default Search Provider'),
|
||||
leading: Icon(MdiIcons.cloudSearch),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
if (activeBang != null)
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FilterChip(
|
||||
showCheckmark: false,
|
||||
label: Text(activeBang.websiteName),
|
||||
avatar: UrlIcon([activeBang.getDefaultUrl()], iconSize: 20),
|
||||
selected: true,
|
||||
onSelected: (value) {},
|
||||
),
|
||||
skipLoadingOnReload: true,
|
||||
data: (availableBangs) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
Center(
|
||||
child: Text('Search', style: theme.textTheme.headlineMedium),
|
||||
),
|
||||
const Divider(),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
children: [
|
||||
...availableBangs.map(
|
||||
(bang) => FilterChip(
|
||||
const SizedBox(height: 24),
|
||||
const ListTile(
|
||||
title: Text('Default Search Provider'),
|
||||
leading: Icon(MdiIcons.cloudSearch),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
if (activeBang != null)
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FilterChip(
|
||||
showCheckmark: false,
|
||||
label: Text(bang.websiteName),
|
||||
avatar: UrlIcon([bang.getDefaultUrl()], iconSize: 20),
|
||||
selected: activeBang?.trigger == bang.trigger,
|
||||
onSelected: (selected) async {
|
||||
if (selected) {
|
||||
await updateSearchProvider(bang.toKey());
|
||||
label: Text(activeBang.websiteName),
|
||||
avatar: UrlIcon([
|
||||
activeBang.getDefaultUrl(),
|
||||
], iconSize: 20),
|
||||
selected: true,
|
||||
onSelected: (value) {},
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
children: [
|
||||
...availableBangs.map(
|
||||
(bang) => FilterChip(
|
||||
showCheckmark: false,
|
||||
label: Text(bang.websiteName),
|
||||
avatar: UrlIcon([bang.getDefaultUrl()], iconSize: 20),
|
||||
selected: activeBang?.trigger == bang.trigger,
|
||||
onSelected: (selected) async {
|
||||
if (selected) {
|
||||
await updateSearchProvider(bang.toKey());
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
ActionChip(
|
||||
label: const Text('Search more'),
|
||||
avatar: const Icon(Icons.search),
|
||||
onPressed: () async {
|
||||
final trigger = await const BangSearchRoute()
|
||||
.push<BangKey?>(context);
|
||||
|
||||
if (trigger != null) {
|
||||
await updateSearchProvider(trigger);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
ActionChip(
|
||||
label: const Text('Search more'),
|
||||
avatar: const Icon(Icons.search),
|
||||
onPressed: () async {
|
||||
final trigger = await const BangSearchRoute()
|
||||
.push<BangKey?>(context);
|
||||
|
||||
if (trigger != null) {
|
||||
await updateSearchProvider(trigger);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const ListTile(
|
||||
title: Text('Default Autocomplete Provider'),
|
||||
leading: Icon(MdiIcons.weatherCloudyArrowRight),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
DropdownMenu<SearchSuggestionProviders>(
|
||||
initialSelection: activeAutosuggest,
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
prefixIconConstraints: BoxConstraints.tight(
|
||||
const Size.square(24),
|
||||
),
|
||||
],
|
||||
),
|
||||
width: double.infinity,
|
||||
leadingIcon: activeAutosuggest.relatedBang.mapNotNull(
|
||||
(trigger) => BangIcon(trigger: trigger),
|
||||
const SizedBox(height: 24),
|
||||
const ListTile(
|
||||
title: Text('Default Autocomplete Provider'),
|
||||
leading: Icon(MdiIcons.weatherCloudyArrowRight),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
dropdownMenuEntries: SearchSuggestionProviders.values.map((
|
||||
provider,
|
||||
) {
|
||||
return DropdownMenuEntry(
|
||||
value: provider,
|
||||
label: provider.label,
|
||||
leadingIcon: provider.relatedBang.mapNotNull(
|
||||
(trigger) => BangIcon(trigger: trigger),
|
||||
DropdownMenu<SearchSuggestionProviders>(
|
||||
initialSelection: activeAutosuggest,
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
prefixIconConstraints: BoxConstraints.tight(
|
||||
const Size.square(24),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onSelected: (value) async {
|
||||
if (value != null) {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) => currentSettings.copyWith
|
||||
.defaultSearchSuggestionsProvider(value),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
error: (error, stackTrace) => Center(
|
||||
child: FailureWidget(
|
||||
title: 'Could not load search engines',
|
||||
exception: error,
|
||||
onRetry: () =>
|
||||
ref.refresh(bangListProvider(triggers: defaultBangs)),
|
||||
),
|
||||
width: double.infinity,
|
||||
leadingIcon: activeAutosuggest.relatedBang.mapNotNull(
|
||||
(trigger) => BangIcon(trigger: trigger),
|
||||
),
|
||||
dropdownMenuEntries: SearchSuggestionProviders.values.map((
|
||||
provider,
|
||||
) {
|
||||
return DropdownMenuEntry(
|
||||
value: provider,
|
||||
label: provider.label,
|
||||
leadingIcon: provider.relatedBang.mapNotNull(
|
||||
(trigger) => BangIcon(trigger: trigger),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onSelected: (value) async {
|
||||
if (value != null) {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) => currentSettings.copyWith
|
||||
.defaultSearchSuggestionsProvider(value),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
error: (error, stackTrace) => Center(
|
||||
child: FailureWidget(
|
||||
title: 'Could not load search engines',
|
||||
exception: error,
|
||||
onRetry: () =>
|
||||
ref.refresh(bangListProvider(triggers: defaultBangs)),
|
||||
),
|
||||
),
|
||||
loading: () => const SizedBox(height: 48, width: double.infinity),
|
||||
),
|
||||
loading: () => const SizedBox(height: 48, width: double.infinity),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,22 +32,22 @@ class DohSettingsPage extends HookConsumerWidget {
|
||||
return BrowserPage(
|
||||
child: BrowserPageContent(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
Center(
|
||||
child: Text(
|
||||
'DNS over HTTPS',
|
||||
style: theme.textTheme.headlineMedium,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
Center(
|
||||
child: Text(
|
||||
'DNS over HTTPS',
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const ListTileTheme(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
child: DohSettingsContent(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const ListTileTheme(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
child: DohSettingsContent(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,10 @@ class ToolbarLayoutPage extends HookConsumerWidget {
|
||||
settings: settings,
|
||||
backgroundColor: Colors.transparent,
|
||||
compact: true,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12.0,
|
||||
vertical: 8.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
|
||||
@@ -47,7 +47,10 @@ class UBlockOptInPage extends HookConsumerWidget implements IFormPage {
|
||||
SvgPicture.asset('assets/images/ublock.svg'),
|
||||
const SizedBox(height: 8),
|
||||
Center(
|
||||
child: Text('uBlock Origin', style: theme.textTheme.headlineMedium),
|
||||
child: Text(
|
||||
'uBlock Origin',
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const MarkdownBody(
|
||||
|
||||
Reference in New Issue
Block a user