Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
feat: added about, license, imprint pages
Browse files Browse the repository at this point in the history
  • Loading branch information
oppahansi committed Dec 27, 2023
1 parent d0c2c82 commit 7f69fa6
Show file tree
Hide file tree
Showing 8 changed files with 382 additions and 42 deletions.
6 changes: 5 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
// Project Imports
import 'package:fis_app/src/app/themes.dart';
import 'package:fis_app/src/features/about/about_screen.dart';
import 'package:fis_app/src/features/impressum/imprint_screen.dart';
import 'package:fis_app/src/features/license/license_screen.dart';
import 'package:fis_app/src/features/search/presentation/photos/photo_search_screen.dart';
import 'package:fis_app/src/utils/theme_provider.dart';

Expand All @@ -21,14 +23,16 @@ class MyApp extends ConsumerWidget {

return MaterialApp(
initialRoute: SearchScreen.route,
title: 'Flutter Demo',
title: 'Free Image Search',
debugShowCheckedModeBanner: false,
theme: lightTheme,
darkTheme: darkTheme,
themeMode: themeMode,
routes: {
SearchScreen.route: (context) => const SearchScreen(),
AboutScreen.route: (context) => const AboutScreen(),
LicenseScreen.route: (context) => const LicenseScreen(),
ImprintScreen.route: (context) => const ImprintScreen(),
},
);
}
Expand Down
27 changes: 22 additions & 5 deletions lib/src/features/about/about_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class AboutScreen extends StatelessWidget {
),
TextSpan(
text: "Centralized Search",
style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
),
TextSpan(
text:
Expand All @@ -104,7 +106,9 @@ class AboutScreen extends StatelessWidget {
),
TextSpan(
text: "\n\nShuffeled Results",
style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
),
TextSpan(
text:
Expand All @@ -114,8 +118,10 @@ class AboutScreen extends StatelessWidget {
style: Theme.of(context).textTheme.bodyLarge,
),
TextSpan(
text: "\n\nSeamless Redirect",
style: Theme.of(context).textTheme.titleMedium,
text: "\n\nDirect Linking",
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
),
TextSpan(
text:
Expand Down Expand Up @@ -143,7 +149,9 @@ class AboutScreen extends StatelessWidget {
),
TextSpan(
text: "\n\nLicense Information",
style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: "\nEnsuring transparency, we redirect you to the "
Expand All @@ -170,6 +178,15 @@ class AboutScreen extends StatelessWidget {
),
],
),
TextSpan(
text:
"\n\n\nFree Image Search is designed to enhance your creative"
" process, offering a simple and efficient way to discover "
"license-free photos."
"\n\nExplore. Search. Get Inspired.\n\n"
"Free Image Search - Where Creative Minds Unite!",
style: Theme.of(context).textTheme.bodyLarge,
),
],
),
],
Expand Down
100 changes: 100 additions & 0 deletions lib/src/features/impressum/imprint_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Flutter Imports
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

// Package Imports
import 'package:url_launcher/url_launcher.dart';

// Project Imports
import 'package:fis_app/src/features/shared/nav_items.dart';
import 'package:fis_app/src/features/shared/theme_toggle.dart';
import 'package:fis_app/src/utils/ui_helpers.dart';

class ImprintScreen extends StatelessWidget {
const ImprintScreen({super.key});

static const String route = '/imprint';

static const pageSize = 30;

@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const NavItems(),
actions: const [
ThemeToggle(),
],
),
body: Center(
child: SizedBox(
width: halfScreenWidth(context),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
verticalSpaceMedium,
_licenseContent(context),
],
),
),
),
),
);
}

RichText _licenseContent(BuildContext context) {
return RichText(
text: TextSpan(
text: "Imprint\n\n",
style: Theme.of(context).textTheme.titleLarge,
children: [
TextSpan(
text: "\nAlexander Schellenberg",
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
children: [
TextSpan(
text: "\n\n"
"Am Blaufuß 40\n"
"46485 Wesel\n"
"Germany",
style: Theme.of(context).textTheme.bodyLarge,
),
],
),
TextSpan(
text: "\n\nContact",
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: "\n\nEmail: ",
style: Theme.of(context).textTheme.bodyLarge,
children: [
_linkTextSpan(context, "[email protected]",
"mailto:[email protected]"),
]),
],
),
);
}

TextSpan _linkTextSpan(BuildContext context, String text, String url) {
return TextSpan(
text: text,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(Uri.parse(url));
},
);
}
}
Loading

0 comments on commit 7f69fa6

Please sign in to comment.