Skip to content

Commit

Permalink
Update app imprint from Sharezone GbR to Sharezone UG (#1753)
Browse files Browse the repository at this point in the history
* Update app imprint from Sharezone GbR to Sharezone UG
* Move imprint markdown string to `legal` package to have in one central
place (shared by app and website)
* Remove possibility to stream the imprint from Firestore (is overkill)
  • Loading branch information
nilsreichardt authored Oct 10, 2024
1 parent 3082616 commit dfc29d9
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 245 deletions.
7 changes: 0 additions & 7 deletions app/lib/main/auth_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import 'package:sharezone/onboarding/group_onboarding/logic/signed_up_bloc.dart'
import 'package:sharezone/onboarding/sign_up/sign_up_page.dart';
import 'package:sharezone/onboarding/welcome_page.dart';
import 'package:sharezone/settings/src/subpages/imprint/analytics/imprint_analytics.dart';
import 'package:sharezone/settings/src/subpages/imprint/bloc/imprint_bloc_factory.dart';
import 'package:sharezone/settings/src/subpages/imprint/gateway/imprint_gateway.dart';
import 'package:sharezone/settings/src/subpages/imprint/page/imprint_page.dart';
import 'package:sharezone/support/support_page.dart';
import 'package:sharezone/legal/privacy_policy/privacy_policy_page.dart';
Expand Down Expand Up @@ -85,11 +83,6 @@ class _AuthAppState extends State<AuthApp> {
),
),
BlocProvider<RegistrationBloc>(bloc: bloc),
BlocProvider<ImprintBlocFactory>(
bloc: ImprintBlocFactory(
ImprintGateway(widget.blocDependencies.firestore),
),
),
BlocProvider<ImprintAnalytics>(
bloc: ImprintAnalytics(widget.analytics)),
],
Expand Down
7 changes: 0 additions & 7 deletions app/lib/main/sharezone_bloc_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ import 'package:sharezone/report/report_gateway.dart';
import 'package:sharezone/settings/src/bloc/user_settings_bloc.dart';
import 'package:sharezone/settings/src/bloc/user_tips_bloc.dart';
import 'package:sharezone/settings/src/subpages/imprint/analytics/imprint_analytics.dart';
import 'package:sharezone/settings/src/subpages/imprint/bloc/imprint_bloc_factory.dart';
import 'package:sharezone/settings/src/subpages/imprint/gateway/imprint_gateway.dart';
import 'package:sharezone/settings/src/subpages/my_profile/change_type_of_user/change_type_of_user_analytics.dart';
import 'package:sharezone/settings/src/subpages/my_profile/change_type_of_user/change_type_of_user_controller.dart';
import 'package:sharezone/settings/src/subpages/my_profile/change_type_of_user/change_type_of_user_service.dart';
Expand Down Expand Up @@ -604,11 +602,6 @@ class _SharezoneBlocProvidersState extends State<SharezoneBlocProviders> {
),
),
BlocProvider<UserSettingsBloc>(bloc: UserSettingsBloc(api.user)),
BlocProvider<ImprintBlocFactory>(
bloc: ImprintBlocFactory(
ImprintGateway(widget.blocDependencies.firestore),
),
),
BlocProvider<ImprintAnalytics>(bloc: ImprintAnalytics(analytics)),
BlocProvider<OnboardingNavigator>(bloc: onboardingNavigator),
BlocProvider<GroupOnboardingBloc>(
Expand Down
22 changes: 0 additions & 22 deletions app/lib/settings/src/subpages/imprint/bloc/imprint_bloc.dart

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions app/lib/settings/src/subpages/imprint/gateway/imprint_gateway.dart

This file was deleted.

65 changes: 0 additions & 65 deletions app/lib/settings/src/subpages/imprint/models/imprint.dart

This file was deleted.

36 changes: 6 additions & 30 deletions app/lib/settings/src/subpages/imprint/page/imprint_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,28 @@
//
// SPDX-License-Identifier: EUPL-1.2

import 'package:bloc_provider/bloc_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:legal/legal.dart';
import 'package:sharezone/groups/src/widgets/contact_support.dart';
import 'package:sharezone/settings/src/subpages/imprint/bloc/imprint_bloc.dart';
import 'package:sharezone/settings/src/subpages/imprint/bloc/imprint_bloc_factory.dart';
import 'package:sharezone/settings/src/subpages/imprint/models/imprint.dart';
import 'package:sharezone_utils/launch_link.dart';

class ImprintPage extends StatefulWidget {
class ImprintPage extends StatelessWidget {
static const tag = 'imprint-page';

const ImprintPage({super.key});

@override
State createState() => _ImprintPageState();
}

class _ImprintPageState extends State<ImprintPage> {
late ImprintBloc bloc;

@override
void initState() {
super.initState();
bloc = BlocProvider.of<ImprintBlocFactory>(context).create();
}

@override
Widget build(BuildContext context) {
final offlineData = Imprint.offline().asMarkdown;
return Scaffold(
appBar: AppBar(title: const Text("Impressum")),
body: SingleChildScrollView(
padding: const EdgeInsets.all(12),
child: SafeArea(
child: StreamBuilder<String>(
initialData: offlineData,
stream: bloc.markdownStream,
builder: (context, snapshot) {
final data = snapshot.data ?? offlineData;
return MarkdownBody(
data: data,
onTapLink: (link, _, __) => launchURL(link),
selectable: true,
);
},
child: MarkdownBody(
data: markdownImprint,
onTapLink: (text, href, __) => launchURL(href!),
selectable: true,
),
),
),
Expand Down
7 changes: 7 additions & 0 deletions app/pubspec.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ dependencies:
path: ../lib/key_value_store
last_online_reporting:
path: ../lib/last_online_reporting
legal:
path: ../lib/legal
logging: ^1.1.1
# Can be replaced once Flutter officially supports the new Material Symbols,
# see https://github.com/flutter/flutter/issues/102560.
Expand Down
1 change: 1 addition & 0 deletions lib/legal/lib/legal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
/// More dartdocs go here.
library;

export 'src/imprint/imprint.dart';
export 'src/privacy_policy/privacy_policy_page.dart';
export 'src/terms_of_service/terms_of_service_page.dart';
29 changes: 29 additions & 0 deletions lib/legal/lib/src/imprint/imprint.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2023 Sharezone UG (haftungsbeschränkt)
// Licensed under the EUPL-1.2-or-later.
//
// You may obtain a copy of the Licence at:
// https://joinup.ec.europa.eu/software/page/eupl
//
// SPDX-License-Identifier: EUPL-1.2

const markdownImprint = """### Adresse
Sharezone UG (haftungsbeschränkt)
Speditionstr. 15A
40221 Düsseldorf
### Geschäftsführer and redaktionell Verantwortlicher:
Nils Reichardt & Jonas Sander
### Handelsregister
Registergericht: Amtsgericht Düsseldorf
Registernummer: HRB 91086
### Kontakt:
Mobil: +49 1522 9504121
E-Mail: [email protected]
### Umsatzsteuer-ID:
Umsatzsteuer-Identifikationsnummer gemäß §27a Umsatzsteuergesetz: DE338063943
""";
64 changes: 0 additions & 64 deletions website/lib/legal/imprint.dart

This file was deleted.

6 changes: 3 additions & 3 deletions website/lib/legal/imprint_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:legal/legal.dart';
import 'package:sharezone_website/page.dart';
import 'package:sharezone_website/widgets/headline.dart';
import 'package:sharezone_website/widgets/section.dart';

import '../utils.dart';
import 'imprint.dart';

class ImprintPage extends StatelessWidget {
const ImprintPage({super.key});
Expand All @@ -40,8 +40,8 @@ class ImprintPage extends StatelessWidget {
Theme(
data: ThemeData.light(),
child: MarkdownBody(
data: Imprint.offline().asMarkdown,
onTapLink: (link, href, title) => launchUrl(link),
data: markdownImprint,
onTapLink: (link, href, title) => launchUrl(href!),
selectable: true,
softLineBreak: true,
),
Expand Down

0 comments on commit dfc29d9

Please sign in to comment.