setting to disable early access tools
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
enum KagiTool { search, assistant, summarizer }
|
enum KagiTool {
|
||||||
|
search,
|
||||||
|
summarizer,
|
||||||
|
//Sort early access features last
|
||||||
|
assistant,
|
||||||
|
}
|
||||||
|
|
||||||
enum AssistantMode {
|
enum AssistantMode {
|
||||||
research(7),
|
research(7),
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
final displayedSheet = ref.watch(bottomSheetProvider);
|
final displayedSheet = ref.watch(bottomSheetProvider);
|
||||||
final displayedOverlayDialog = ref.watch(overlayDialogProvider);
|
final displayedOverlayDialog = ref.watch(overlayDialogProvider);
|
||||||
|
|
||||||
|
final showEarlyAccessFeatures = ref.watch(
|
||||||
|
settingsRepositoryProvider.select(
|
||||||
|
(value) => value.valueOrNull?.showEarlyAccessFeatures ?? true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final lastBackButtonPress = useRef<DateTime?>(null);
|
final lastBackButtonPress = useRef<DateTime?>(null);
|
||||||
final webViewController = useRef<InAppWebViewController?>(null);
|
final webViewController = useRef<InAppWebViewController?>(null);
|
||||||
|
|
||||||
@@ -188,15 +194,6 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
leadingIcon: const Icon(MdiIcons.searchWeb),
|
leadingIcon: const Icon(MdiIcons.searchWeb),
|
||||||
child: const Text('Search'),
|
child: const Text('Search'),
|
||||||
),
|
),
|
||||||
MenuItemButton(
|
|
||||||
onPressed: () {
|
|
||||||
ref.read(createTabStreamProvider.notifier).createTab(
|
|
||||||
CreateTab(preferredTool: KagiTool.assistant),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
leadingIcon: const Icon(MdiIcons.brain),
|
|
||||||
child: const Text('Assistant'),
|
|
||||||
),
|
|
||||||
MenuItemButton(
|
MenuItemButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
ref.read(createTabStreamProvider.notifier).createTab(
|
ref.read(createTabStreamProvider.notifier).createTab(
|
||||||
@@ -206,7 +203,18 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
leadingIcon: const Icon(MdiIcons.text),
|
leadingIcon: const Icon(MdiIcons.text),
|
||||||
child: const Text('Summarizer'),
|
child: const Text('Summarizer'),
|
||||||
),
|
),
|
||||||
|
if (showEarlyAccessFeatures)
|
||||||
|
MenuItemButton(
|
||||||
|
onPressed: () {
|
||||||
|
ref.read(createTabStreamProvider.notifier).createTab(
|
||||||
|
CreateTab(preferredTool: KagiTool.assistant),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
leadingIcon: const Icon(MdiIcons.brain),
|
||||||
|
child: const Text('Assistant'),
|
||||||
|
),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
|
if (showEarlyAccessFeatures)
|
||||||
MenuItemButton(
|
MenuItemButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await context.push(ChatArchiveListRoute().location);
|
await context.push(ChatArchiveListRoute().location);
|
||||||
@@ -214,7 +222,7 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
leadingIcon: const Icon(MdiIcons.archive),
|
leadingIcon: const Icon(MdiIcons.archive),
|
||||||
child: const Text('Chat Archive'),
|
child: const Text('Chat Archive'),
|
||||||
),
|
),
|
||||||
const Divider(),
|
if (showEarlyAccessFeatures) const Divider(),
|
||||||
MenuItemButton(
|
MenuItemButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await context.push(AboutRoute().location);
|
await context.push(AboutRoute().location);
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ class LandingAction extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final showEarlyAccessFeatures = ref.watch(
|
||||||
|
settingsRepositoryProvider.select(
|
||||||
|
(value) => value.valueOrNull?.showEarlyAccessFeatures ?? true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return Visibility(
|
return Visibility(
|
||||||
visible: sessionTokenAvailable,
|
visible: sessionTokenAvailable,
|
||||||
replacement: Container(
|
replacement: Container(
|
||||||
@@ -68,15 +74,6 @@ class LandingAction extends HookConsumerWidget {
|
|||||||
icon: const Icon(MdiIcons.searchWeb),
|
icon: const Icon(MdiIcons.searchWeb),
|
||||||
label: const Text('Search'),
|
label: const Text('Search'),
|
||||||
),
|
),
|
||||||
OutlinedButton.icon(
|
|
||||||
onPressed: () {
|
|
||||||
ref.read(createTabStreamProvider.notifier).createTab(
|
|
||||||
CreateTab(preferredTool: KagiTool.assistant),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Icon(MdiIcons.brain),
|
|
||||||
label: const Text('Assistant'),
|
|
||||||
),
|
|
||||||
OutlinedButton.icon(
|
OutlinedButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
ref.read(createTabStreamProvider.notifier).createTab(
|
ref.read(createTabStreamProvider.notifier).createTab(
|
||||||
@@ -86,6 +83,16 @@ class LandingAction extends HookConsumerWidget {
|
|||||||
icon: const Icon(MdiIcons.text),
|
icon: const Icon(MdiIcons.text),
|
||||||
label: const Text('Summarizer'),
|
label: const Text('Summarizer'),
|
||||||
),
|
),
|
||||||
|
if (showEarlyAccessFeatures)
|
||||||
|
OutlinedButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
ref.read(createTabStreamProvider.notifier).createTab(
|
||||||
|
CreateTab(preferredTool: KagiTool.assistant),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
icon: const Icon(MdiIcons.brain),
|
||||||
|
label: const Text('Assistant'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
+24
-12
@@ -3,6 +3,7 @@ import 'package:bang_navigator/features/search_browser/domain/entities/sheet.dar
|
|||||||
import 'package:bang_navigator/features/search_browser/presentation/widgets/tabs/assistant_tab.dart';
|
import 'package:bang_navigator/features/search_browser/presentation/widgets/tabs/assistant_tab.dart';
|
||||||
import 'package:bang_navigator/features/search_browser/presentation/widgets/tabs/search_tab.dart';
|
import 'package:bang_navigator/features/search_browser/presentation/widgets/tabs/search_tab.dart';
|
||||||
import 'package:bang_navigator/features/search_browser/presentation/widgets/tabs/summarize_tab.dart';
|
import 'package:bang_navigator/features/search_browser/presentation/widgets/tabs/summarize_tab.dart';
|
||||||
|
import 'package:bang_navigator/features/settings/data/repositories/settings_repository.dart';
|
||||||
import 'package:bang_navigator/features/share_intent/domain/entities/shared_content.dart';
|
import 'package:bang_navigator/features/share_intent/domain/entities/shared_content.dart';
|
||||||
import 'package:bang_navigator/presentation/hooks/sync_page_tab.dart';
|
import 'package:bang_navigator/presentation/hooks/sync_page_tab.dart';
|
||||||
import 'package:expandable_page_view/expandable_page_view.dart';
|
import 'package:expandable_page_view/expandable_page_view.dart';
|
||||||
@@ -24,6 +25,12 @@ class SharedContentSheet extends HookConsumerWidget {
|
|||||||
});
|
});
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final showEarlyAccessFeatures = ref.watch(
|
||||||
|
settingsRepositoryProvider.select(
|
||||||
|
(value) => value.valueOrNull?.showEarlyAccessFeatures ?? true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final sharedContent = useMemoized(
|
final sharedContent = useMemoized(
|
||||||
() => (parameter.content != null)
|
() => (parameter.content != null)
|
||||||
? SharedContent.parse(parameter.content!)
|
? SharedContent.parse(parameter.content!)
|
||||||
@@ -31,14 +38,17 @@ class SharedContentSheet extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final tabController = useTabController(
|
final tabController = useTabController(
|
||||||
initialLength: KagiTool.values.length,
|
initialLength: KagiTool.values.length - (showEarlyAccessFeatures ? 0 : 1),
|
||||||
initialIndex: parameter.preferredTool?.index ??
|
initialIndex: parameter.preferredTool?.index ??
|
||||||
switch (sharedContent) {
|
switch (sharedContent) {
|
||||||
SharedText(text: final text) => (text.length > 25)
|
SharedText(text: final text) =>
|
||||||
|
(showEarlyAccessFeatures && text.length > 25)
|
||||||
? KagiTool.assistant.index
|
? KagiTool.assistant.index
|
||||||
: KagiTool.search.index,
|
: KagiTool.search.index,
|
||||||
SharedUrl() => KagiTool.summarizer.index,
|
SharedUrl() => KagiTool.summarizer.index,
|
||||||
null => KagiTool.assistant.index,
|
null => showEarlyAccessFeatures
|
||||||
|
? KagiTool.assistant.index
|
||||||
|
: KagiTool.search.index,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
final pageController = usePageController(initialPage: tabController.index);
|
final pageController = usePageController(initialPage: tabController.index);
|
||||||
@@ -50,19 +60,20 @@ class SharedContentSheet extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
TabBar(
|
TabBar(
|
||||||
controller: tabController,
|
controller: tabController,
|
||||||
tabs: const [
|
tabs: [
|
||||||
Tab(
|
const Tab(
|
||||||
icon: Icon(MdiIcons.searchWeb),
|
icon: Icon(MdiIcons.searchWeb),
|
||||||
text: 'Search',
|
text: 'Search',
|
||||||
),
|
),
|
||||||
Tab(
|
const Tab(
|
||||||
icon: Icon(MdiIcons.brain),
|
|
||||||
text: 'Assistant',
|
|
||||||
),
|
|
||||||
Tab(
|
|
||||||
icon: Icon(MdiIcons.text),
|
icon: Icon(MdiIcons.text),
|
||||||
text: 'Summarize',
|
text: 'Summarize',
|
||||||
),
|
),
|
||||||
|
if (showEarlyAccessFeatures)
|
||||||
|
const Tab(
|
||||||
|
icon: Icon(MdiIcons.brain),
|
||||||
|
text: 'Assistant',
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -74,11 +85,12 @@ class SharedContentSheet extends HookConsumerWidget {
|
|||||||
sharedContent: sharedContent,
|
sharedContent: sharedContent,
|
||||||
onSubmit: onSubmit,
|
onSubmit: onSubmit,
|
||||||
),
|
),
|
||||||
AssistantTab(
|
SummarizeTab(
|
||||||
sharedContent: sharedContent,
|
sharedContent: sharedContent,
|
||||||
onSubmit: onSubmit,
|
onSubmit: onSubmit,
|
||||||
),
|
),
|
||||||
SummarizeTab(
|
if (showEarlyAccessFeatures)
|
||||||
|
AssistantTab(
|
||||||
sharedContent: sharedContent,
|
sharedContent: sharedContent,
|
||||||
onSubmit: onSubmit,
|
onSubmit: onSubmit,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ part 'settings.g.dart';
|
|||||||
@CopyWith()
|
@CopyWith()
|
||||||
class Settings with FastEquatable {
|
class Settings with FastEquatable {
|
||||||
final String? kagiSession;
|
final String? kagiSession;
|
||||||
|
final bool showEarlyAccessFeatures;
|
||||||
final bool incognitoMode;
|
final bool incognitoMode;
|
||||||
final bool enableJavascript;
|
final bool enableJavascript;
|
||||||
final bool launchUrlExternal;
|
final bool launchUrlExternal;
|
||||||
|
|
||||||
Settings({
|
Settings({
|
||||||
required this.kagiSession,
|
required this.kagiSession,
|
||||||
|
required this.showEarlyAccessFeatures,
|
||||||
required this.incognitoMode,
|
required this.incognitoMode,
|
||||||
required this.enableJavascript,
|
required this.enableJavascript,
|
||||||
required this.launchUrlExternal,
|
required this.launchUrlExternal,
|
||||||
@@ -19,10 +21,12 @@ class Settings with FastEquatable {
|
|||||||
|
|
||||||
Settings.withDefaults({
|
Settings.withDefaults({
|
||||||
required this.kagiSession,
|
required this.kagiSession,
|
||||||
|
bool? showEarlyAccessFeatures,
|
||||||
bool? incognitoMode,
|
bool? incognitoMode,
|
||||||
bool? enableJavascript,
|
bool? enableJavascript,
|
||||||
bool? launchUrlExternal,
|
bool? launchUrlExternal,
|
||||||
}) : incognitoMode = incognitoMode ?? true,
|
}) : showEarlyAccessFeatures = showEarlyAccessFeatures ?? true,
|
||||||
|
incognitoMode = incognitoMode ?? true,
|
||||||
enableJavascript = enableJavascript ?? true,
|
enableJavascript = enableJavascript ?? true,
|
||||||
launchUrlExternal = launchUrlExternal ?? false;
|
launchUrlExternal = launchUrlExternal ?? false;
|
||||||
|
|
||||||
@@ -32,6 +36,7 @@ class Settings with FastEquatable {
|
|||||||
@override
|
@override
|
||||||
List<Object?> get hashParameters => [
|
List<Object?> get hashParameters => [
|
||||||
kagiSession,
|
kagiSession,
|
||||||
|
showEarlyAccessFeatures,
|
||||||
incognitoMode,
|
incognitoMode,
|
||||||
enableJavascript,
|
enableJavascript,
|
||||||
launchUrlExternal,
|
launchUrlExternal,
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ part of 'settings.dart';
|
|||||||
abstract class _$SettingsCWProxy {
|
abstract class _$SettingsCWProxy {
|
||||||
Settings kagiSession(String? kagiSession);
|
Settings kagiSession(String? kagiSession);
|
||||||
|
|
||||||
|
Settings showEarlyAccessFeatures(bool showEarlyAccessFeatures);
|
||||||
|
|
||||||
Settings incognitoMode(bool incognitoMode);
|
Settings incognitoMode(bool incognitoMode);
|
||||||
|
|
||||||
Settings enableJavascript(bool enableJavascript);
|
Settings enableJavascript(bool enableJavascript);
|
||||||
@@ -23,6 +25,7 @@ abstract class _$SettingsCWProxy {
|
|||||||
/// ````
|
/// ````
|
||||||
Settings call({
|
Settings call({
|
||||||
String? kagiSession,
|
String? kagiSession,
|
||||||
|
bool? showEarlyAccessFeatures,
|
||||||
bool? incognitoMode,
|
bool? incognitoMode,
|
||||||
bool? enableJavascript,
|
bool? enableJavascript,
|
||||||
bool? launchUrlExternal,
|
bool? launchUrlExternal,
|
||||||
@@ -38,6 +41,10 @@ class _$SettingsCWProxyImpl implements _$SettingsCWProxy {
|
|||||||
@override
|
@override
|
||||||
Settings kagiSession(String? kagiSession) => this(kagiSession: kagiSession);
|
Settings kagiSession(String? kagiSession) => this(kagiSession: kagiSession);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Settings showEarlyAccessFeatures(bool showEarlyAccessFeatures) =>
|
||||||
|
this(showEarlyAccessFeatures: showEarlyAccessFeatures);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Settings incognitoMode(bool incognitoMode) =>
|
Settings incognitoMode(bool incognitoMode) =>
|
||||||
this(incognitoMode: incognitoMode);
|
this(incognitoMode: incognitoMode);
|
||||||
@@ -60,6 +67,7 @@ class _$SettingsCWProxyImpl implements _$SettingsCWProxy {
|
|||||||
/// ````
|
/// ````
|
||||||
Settings call({
|
Settings call({
|
||||||
Object? kagiSession = const $CopyWithPlaceholder(),
|
Object? kagiSession = const $CopyWithPlaceholder(),
|
||||||
|
Object? showEarlyAccessFeatures = const $CopyWithPlaceholder(),
|
||||||
Object? incognitoMode = const $CopyWithPlaceholder(),
|
Object? incognitoMode = const $CopyWithPlaceholder(),
|
||||||
Object? enableJavascript = const $CopyWithPlaceholder(),
|
Object? enableJavascript = const $CopyWithPlaceholder(),
|
||||||
Object? launchUrlExternal = const $CopyWithPlaceholder(),
|
Object? launchUrlExternal = const $CopyWithPlaceholder(),
|
||||||
@@ -69,6 +77,12 @@ class _$SettingsCWProxyImpl implements _$SettingsCWProxy {
|
|||||||
? _value.kagiSession
|
? _value.kagiSession
|
||||||
// ignore: cast_nullable_to_non_nullable
|
// ignore: cast_nullable_to_non_nullable
|
||||||
: kagiSession as String?,
|
: kagiSession as String?,
|
||||||
|
showEarlyAccessFeatures:
|
||||||
|
showEarlyAccessFeatures == const $CopyWithPlaceholder() ||
|
||||||
|
showEarlyAccessFeatures == null
|
||||||
|
? _value.showEarlyAccessFeatures
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: showEarlyAccessFeatures as bool,
|
||||||
incognitoMode:
|
incognitoMode:
|
||||||
incognitoMode == const $CopyWithPlaceholder() || incognitoMode == null
|
incognitoMode == const $CopyWithPlaceholder() || incognitoMode == null
|
||||||
? _value.incognitoMode
|
? _value.incognitoMode
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ typedef UpdateSettingsFunc = Settings Function(Settings currentSettings);
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
class SettingsRepository extends _$SettingsRepository {
|
class SettingsRepository extends _$SettingsRepository {
|
||||||
static const _sessionStorageKey = 'b4ng_kagi_session';
|
static const _sessionStorageKey = 'b4ng_kagi_session';
|
||||||
|
static const _showEarlyAccessFeaturesKey = 'b4ng_show_early_access';
|
||||||
static const _incognitoStorageKey = 'b4ng_settings_incognito';
|
static const _incognitoStorageKey = 'b4ng_settings_incognito';
|
||||||
static const _javascriptStorageKey = 'b4ng_settings_js';
|
static const _javascriptStorageKey = 'b4ng_settings_js';
|
||||||
static const _launchExternalStorageKey = 'b4ng_settings_launch_external';
|
static const _launchExternalStorageKey = 'b4ng_settings_launch_external';
|
||||||
@@ -35,6 +36,16 @@ class SettingsRepository extends _$SettingsRepository {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newSettings.showEarlyAccessFeatures !=
|
||||||
|
oldSettings.showEarlyAccessFeatures) {
|
||||||
|
await _sharedPreferences.then(
|
||||||
|
(s) => s.setBool(
|
||||||
|
_showEarlyAccessFeaturesKey,
|
||||||
|
newSettings.showEarlyAccessFeatures,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (newSettings.incognitoMode != oldSettings.incognitoMode) {
|
if (newSettings.incognitoMode != oldSettings.incognitoMode) {
|
||||||
await _sharedPreferences.then(
|
await _sharedPreferences.then(
|
||||||
(s) => s.setBool(_incognitoStorageKey, newSettings.incognitoMode),
|
(s) => s.setBool(_incognitoStorageKey, newSettings.incognitoMode),
|
||||||
@@ -66,6 +77,8 @@ class SettingsRepository extends _$SettingsRepository {
|
|||||||
|
|
||||||
return Settings.withDefaults(
|
return Settings.withDefaults(
|
||||||
kagiSession: await _flutterSecureStorage.read(key: _sessionStorageKey),
|
kagiSession: await _flutterSecureStorage.read(key: _sessionStorageKey),
|
||||||
|
showEarlyAccessFeatures:
|
||||||
|
sharedPreferences.getBool(_showEarlyAccessFeaturesKey),
|
||||||
incognitoMode: sharedPreferences.getBool(_incognitoStorageKey),
|
incognitoMode: sharedPreferences.getBool(_incognitoStorageKey),
|
||||||
enableJavascript: sharedPreferences.getBool(_javascriptStorageKey),
|
enableJavascript: sharedPreferences.getBool(_javascriptStorageKey),
|
||||||
launchUrlExternal: sharedPreferences.getBool(_launchExternalStorageKey),
|
launchUrlExternal: sharedPreferences.getBool(_launchExternalStorageKey),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ part of 'settings_repository.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$settingsRepositoryHash() =>
|
String _$settingsRepositoryHash() =>
|
||||||
r'2b715f29915e541cec5c7c0993c8099944989f48';
|
r'0beffd6449e5488e61beb181fefefd4aa24361b0';
|
||||||
|
|
||||||
/// See also [SettingsRepository].
|
/// See also [SettingsRepository].
|
||||||
@ProviderFor(SettingsRepository)
|
@ProviderFor(SettingsRepository)
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ class SettingsScreen extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
final hideSessionText = useState(true);
|
final hideSessionText = useState(true);
|
||||||
|
|
||||||
// final isSavingSettings = ref.watch(
|
final showEarlyAccessFeatures = ref.watch(
|
||||||
// saveSettingsControllerProvider.select((value) => value.isLoading),
|
settingsRepositoryProvider.select(
|
||||||
// );
|
(value) => value.valueOrNull?.showEarlyAccessFeatures ?? true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final incognitoEnabled = ref.watch(
|
final incognitoEnabled = ref.watch(
|
||||||
settingsRepositoryProvider
|
settingsRepositoryProvider
|
||||||
@@ -114,6 +116,19 @@ class SettingsScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SwitchListTile.adaptive(
|
||||||
|
title: const Text('Show Early Access Features'),
|
||||||
|
subtitle: const Text(
|
||||||
|
"Displays Kagi's early access features in the UI. As an Ultimate subscriber, you will likely want to have this enabled.",
|
||||||
|
),
|
||||||
|
value: showEarlyAccessFeatures,
|
||||||
|
onChanged: (value) async {
|
||||||
|
await ref.read(saveSettingsControllerProvider.notifier).save(
|
||||||
|
(currentSettings) => currentSettings.copyWith
|
||||||
|
.showEarlyAccessFeatures(value),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
SwitchListTile.adaptive(
|
SwitchListTile.adaptive(
|
||||||
title: const Text('Incognito Mode'),
|
title: const Text('Incognito Mode'),
|
||||||
subtitle: const Text(
|
subtitle: const Text(
|
||||||
|
|||||||
@@ -88,6 +88,12 @@ class _WebViewState extends ConsumerState<WebView> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final showEarlyAccessFeatures = ref.watch(
|
||||||
|
settingsRepositoryProvider.select(
|
||||||
|
(value) => value.valueOrNull?.showEarlyAccessFeatures ?? true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final initialSettings = useMemoized(
|
final initialSettings = useMemoized(
|
||||||
() => InAppWebViewSettings(
|
() => InAppWebViewSettings(
|
||||||
// isInspectable: kDebugMode,
|
// isInspectable: kDebugMode,
|
||||||
@@ -162,6 +168,7 @@ class _WebViewState extends ConsumerState<WebView> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
if (showEarlyAccessFeatures)
|
||||||
ContextMenuItem(
|
ContextMenuItem(
|
||||||
id: 2,
|
id: 2,
|
||||||
title: "Assistant",
|
title: "Assistant",
|
||||||
|
|||||||
Reference in New Issue
Block a user