chore: removed google fonts dependency #54 (#55)

## Pull Request Description

Added the google fonts locally
Also added back saved servers for web

## Issue Being Fixed

Issue Number: #54 

## Screenshots / Recordings

<!-- This section is optional but highly recommended to show off your
changes! -->

## Checklist

- [ ] If a new package was added, did you ensure it works for all
supported platforms? Is the package also well maintained?
- [ ] Did you add localization for any text? If yes, did you sort the
.arb file using ```arb_utils sort <INPUT_FILE>```?
- [ ] Check that any changes are related to the issue at hand.

---------

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-10-20 09:42:53 +02:00 committed by GitHub
parent ff45bb8641
commit 9df13cfb34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 189 additions and 64 deletions

View file

@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:fladder/models/credentials_model.dart';
import 'package:fladder/providers/discovery_provider.dart';
import 'package:fladder/util/fladder_config.dart';
import 'package:fladder/util/list_padding.dart';
import 'package:fladder/util/localization_helper.dart';
import 'package:fladder/util/theme_extensions.dart';
@ -21,7 +22,6 @@ class DiscoverServersWidget extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
if (kIsWeb) return const SizedBox.shrink();
final existingServers = serverCredentials
.map(
(credentials) => DiscoveryInfo(
@ -58,51 +58,53 @@ class DiscoverServersWidget extends ConsumerWidget {
)
.toList()
.addInBetween(const SizedBox(height: 4)),
const Divider(),
],
Row(
children: [
Text(
context.localized.discovered,
style: context.textTheme.bodyLarge,
),
const Spacer(),
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
],
),
const SizedBox(height: 4),
discoverdServersStream.when(
data: (data) {
final servers = data.where((discoverdServer) => !existingServers.contains(discoverdServer));
return servers.isNotEmpty
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...servers.map(
(serverInfo) => _ServerInfoCard(
server: serverInfo,
onPressed: onPressed,
),
)
].toList().addInBetween(const SizedBox(height: 4)),
)
: Center(
child: Opacity(
opacity: 0.65,
child: Text(
context.localized.noServersFound,
style: context.textTheme.bodyLarge,
),
));
},
error: (error, stackTrace) => Text(context.localized.error),
loading: () => const Center(
child: SizedBox.square(
dimension: 24.0,
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
if (!kIsWeb && FladderConfig.baseUrl?.isEmpty == true) ...[
const Divider(),
Row(
children: [
Text(
context.localized.discovered,
style: context.textTheme.bodyLarge,
),
const Spacer(),
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
],
),
const SizedBox(height: 4),
discoverdServersStream.when(
data: (data) {
final servers = data.where((discoverdServer) => !existingServers.contains(discoverdServer));
return servers.isNotEmpty
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...servers.map(
(serverInfo) => _ServerInfoCard(
server: serverInfo,
onPressed: onPressed,
),
)
].toList().addInBetween(const SizedBox(height: 4)),
)
: Center(
child: Opacity(
opacity: 0.65,
child: Text(
context.localized.noServersFound,
style: context.textTheme.bodyLarge,
),
));
},
error: (error, stackTrace) => Text(context.localized.error),
loading: () => const Center(
child: SizedBox.square(
dimension: 24.0,
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
),
),
),
),
],
const SizedBox(height: 32),
],
);

View file

@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:auto_route/auto_route.dart';
@ -74,7 +75,8 @@ class SettingsScaffold extends ConsumerWidget {
),
),
SliverPadding(
padding: MediaQuery.paddingOf(context),
padding: MediaQuery.paddingOf(context)
.copyWith(top: AdaptiveLayout.of(context).isDesktop || kIsWeb ? 0 : null),
sliver: SliverList(
delegate: SliverChildListDelegate(items),
),