Add Supa account and search changes
This commit is contained in:
@@ -34,6 +34,7 @@ final filesystem = _Filesystem();
|
||||
|
||||
class _Filesystem {
|
||||
late final Directory dataDir;
|
||||
late final Directory tempDir;
|
||||
late final Directory profilesDir;
|
||||
|
||||
late final UuidValue selectedProfile;
|
||||
@@ -312,7 +313,8 @@ class _Filesystem {
|
||||
Future<void> _setupSqliteCache() async {
|
||||
// Make sqlite3 pick a more suitable location for temporary files - the
|
||||
// one from the system may be inaccessible due to sandboxing.
|
||||
final cachebase = (await path_provider.getTemporaryDirectory()).path;
|
||||
tempDir = await path_provider.getTemporaryDirectory();
|
||||
final cachebase = tempDir.path;
|
||||
// We can't access /tmp on Android, which sqlite3 would try by default.
|
||||
// Explicitly tell it about the correct temporary directory.
|
||||
sqlite3.tempDirectory = cachebase;
|
||||
|
||||
@@ -33,12 +33,24 @@ class AndroidDeviceInfo extends _$AndroidDeviceInfo {
|
||||
final deviceInfo = DeviceInfoPlugin();
|
||||
final androidInfo = await deviceInfo.androidInfo;
|
||||
|
||||
return AndroidDeviceInfoData(sdkInt: androidInfo.version.sdkInt);
|
||||
return AndroidDeviceInfoData(
|
||||
sdkInt: androidInfo.version.sdkInt,
|
||||
manufacturer: androidInfo.manufacturer,
|
||||
model: androidInfo.model,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AndroidDeviceInfoData {
|
||||
final int sdkInt;
|
||||
final String manufacturer;
|
||||
final String model;
|
||||
|
||||
const AndroidDeviceInfoData({required this.sdkInt});
|
||||
const AndroidDeviceInfoData({
|
||||
required this.sdkInt,
|
||||
required this.manufacturer,
|
||||
required this.model,
|
||||
});
|
||||
|
||||
String get deviceName => '$manufacturer $model';
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ final class AndroidDeviceInfoProvider
|
||||
AndroidDeviceInfo create() => AndroidDeviceInfo();
|
||||
}
|
||||
|
||||
String _$androidDeviceInfoHash() => r'05c6cc63a6ee34f137aef538d65e8ab94b9cca89';
|
||||
String _$androidDeviceInfoHash() => r'54a5ceafce6ed9260b18baaec18d131f3c7d3833';
|
||||
|
||||
abstract class _$AndroidDeviceInfo
|
||||
extends $AsyncNotifier<AndroidDeviceInfoData?> {
|
||||
|
||||
@@ -28,6 +28,7 @@ import 'package:weblibre/core/routing/widgets/bottom_sheet_page.dart';
|
||||
import 'package:weblibre/core/routing/widgets/dialog_page.dart';
|
||||
import 'package:weblibre/domain/entities/profile.dart';
|
||||
import 'package:weblibre/features/about/presentation/screens/about.dart';
|
||||
import 'package:weblibre/features/account/presentation/screens/account_settings.dart';
|
||||
import 'package:weblibre/features/addons/presentation/screens/addon_details.dart';
|
||||
import 'package:weblibre/features/addons/presentation/screens/addon_internal_settings.dart';
|
||||
import 'package:weblibre/features/addons/presentation/screens/addon_listing_details.dart';
|
||||
|
||||
@@ -1635,6 +1635,11 @@ RouteBase get $settingsRoute => GoRouteData.$route(
|
||||
name: 'ErrorLogsRoute',
|
||||
factory: $ErrorLogsRoute._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'account',
|
||||
name: 'AccountSettingsRoute',
|
||||
factory: $AccountSettingsRoute._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'sync',
|
||||
name: 'SyncSettingsRoute',
|
||||
@@ -2103,6 +2108,27 @@ mixin $ErrorLogsRoute on GoRouteData {
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
mixin $AccountSettingsRoute on GoRouteData {
|
||||
static AccountSettingsRoute _fromState(GoRouterState state) =>
|
||||
AccountSettingsRoute();
|
||||
|
||||
@override
|
||||
String get location => GoRouteData.$location('/settings/account');
|
||||
|
||||
@override
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@override
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
@override
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
@override
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
mixin $SyncSettingsRoute on GoRouteData {
|
||||
static SyncSettingsRoute _fromState(GoRouterState state) =>
|
||||
SyncSettingsRoute();
|
||||
|
||||
@@ -96,6 +96,10 @@ part of 'routes.dart';
|
||||
path: 'custom_tracking_protection',
|
||||
),
|
||||
TypedGoRoute<ErrorLogsRoute>(name: 'ErrorLogsRoute', path: 'error_logs'),
|
||||
TypedGoRoute<AccountSettingsRoute>(
|
||||
name: 'AccountSettingsRoute',
|
||||
path: 'account',
|
||||
),
|
||||
TypedGoRoute<SyncSettingsRoute>(name: 'SyncSettingsRoute', path: 'sync'),
|
||||
TypedGoRoute<UrlCleanerSettingsRoute>(
|
||||
name: 'UrlCleanerSettingsRoute',
|
||||
@@ -272,6 +276,13 @@ class CustomTrackingProtectionRoute extends GoRouteData
|
||||
}
|
||||
}
|
||||
|
||||
class AccountSettingsRoute extends GoRouteData with $AccountSettingsRoute {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const AccountSettingsScreen();
|
||||
}
|
||||
}
|
||||
|
||||
class SyncSettingsRoute extends GoRouteData with $SyncSettingsRoute {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
|
||||
Reference in New Issue
Block a user