add onboarding slides

This commit is contained in:
otsmr 2025-01-24 00:21:28 +01:00
parent facdea6185
commit 6502859cc1
15 changed files with 210 additions and 10 deletions

5
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"cSpell.words": [
"thounthends"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View file

@ -1,4 +1,5 @@
import 'package:twonly/main.dart'; import 'package:twonly/main.dart';
import 'package:twonly/src/views/onboarding_view.dart';
import 'views/home_view.dart'; import 'views/home_view.dart';
import 'views/register_view.dart'; import 'views/register_view.dart';
import 'utils.dart'; import 'utils.dart';
@ -20,6 +21,7 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
Future<bool> _isUserCreated = isUserCreated(); Future<bool> _isUserCreated = isUserCreated();
bool _showOnboarding = true;
bool _isConnected = false; bool _isConnected = false;
int redColorOpacity = 0; // Start with dark red int redColorOpacity = 0; // Start with dark red
bool redColorGoUp = true; bool redColorGoUp = true;
@ -104,12 +106,18 @@ class _MyAppState extends State<MyApp> {
return snapshot.data! return snapshot.data!
? HomeView( ? HomeView(
settingsController: widget.settingsController) settingsController: widget.settingsController)
: RegisterView( : _showOnboarding
? OnboardingView(
callbackOnSuccess: () { callbackOnSuccess: () {
setState(() {
_showOnboarding = false;
});
},
)
: RegisterView(callbackOnSuccess: () {
_isUserCreated = isUserCreated(); _isUserCreated = isUserCreated();
setState(() {}); setState(() {});
}, });
); // Show the red line if not connected
} else { } else {
return Container(); return Container();
} }

View file

@ -64,9 +64,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Column( child: Column(
children: [ children: [
AwesomeZoomSelector(state: cameraState AwesomeZoomSelector(state: cameraState),
// controller: _controller,
),
const SizedBox(height: 30), const SizedBox(height: 30),
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {

View file

@ -0,0 +1,118 @@
import 'package:introduction_screen/introduction_screen.dart';
import 'package:flutter/material.dart';
class OnboardingView extends StatelessWidget {
const OnboardingView({super.key, required this.callbackOnSuccess});
final Function callbackOnSuccess;
@override
Widget build(BuildContext context) {
return Scaffold(
body: IntroductionScreen(
bodyPadding: EdgeInsets.only(top: 75, left: 10, right: 10),
pages: [
PageViewModel(
title: "Welcome to twonly!",
body:
"With twonly you can share pictures with friends that only you and the receiver can see!",
image: Center(
child: Padding(
padding: const EdgeInsets.only(top: 100),
child: Image.asset("assets/images/onboarding/01.png"),
),
),
),
PageViewModel(
title: "No ads, no tracking",
body:
"twonly is complete add free and does not collect any personal data. The server does not save any data of you.",
image: Center(
child: Padding(
padding: const EdgeInsets.only(top: 100),
child: Image.asset("assets/images/onboarding/02.png"),
),
),
),
PageViewModel(
title: "End-to-End protection",
body:
"twonly encrypts every message you send. For this it uses the Signal protocol which is currently the best way to encrypt messages with a minimum of metadata.",
image: Center(
child: Padding(
padding: const EdgeInsets.only(top: 100),
child: Image.asset("assets/images/onboarding/03.png"),
),
),
),
PageViewModel(
title: "Hard work",
body:
"We try everything to give you the best experience but developing and maintaining is hard work and requires thousand of hours.",
image: Center(
child: Padding(
padding: const EdgeInsets.only(top: 100),
child: Image.asset("assets/images/onboarding/04.png"),
),
),
),
PageViewModel(
title: "You are not the product!",
body:
"Nothing is free. Either you pay with your personal informations or with money. Twonly gives you the chance to use an sustainable social media product without exploiting you by collection you personal data.",
image: Center(
child: Padding(
padding: const EdgeInsets.only(top: 100),
child: Image.asset("assets/images/onboarding/05.png"),
),
),
),
PageViewModel(
title: "Try for free!",
bodyWidget: Column(
children: [
Text(
"You can test twonly free for 14 days and then decide it is worth for you.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18),
),
Padding(
padding:
const EdgeInsets.only(left: 50, right: 50, top: 20),
child: FilledButton(
onPressed: () {
callbackOnSuccess();
// On button pressed
},
child: const Text("Try for free"),
)),
],
),
image: Center(
child: Padding(
padding: const EdgeInsets.only(top: 100),
child: Image.asset("assets/images/onboarding/06.png"),
),
),
),
],
showNextButton: true,
done: const Text("Our plans"),
next: const Text("Next"),
// done: RegisterView(callbackOnSuccess: callbackOnSuccess),
onDone: () {
callbackOnSuccess();
// On button pressed
},
dotsDecorator: DotsDecorator(
size: const Size.square(10.0),
activeSize: const Size(20.0, 10.0),
activeColor: Theme.of(context).colorScheme.primary,
color: Theme.of(context).colorScheme.secondary,
spacing: const EdgeInsets.symmetric(horizontal: 3.0),
activeShape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(25.0)),
),
),
);
}
}

View file

@ -28,7 +28,7 @@ class _ProfileViewState extends State<ProfileView> {
if (snap.hasData) { if (snap.hasData) {
return Text("Hello ${snap.data!.username}!"); return Text("Hello ${snap.data!.username}!");
} else { } else {
return CircularProgressIndicator(); return Container();
} }
}), }),
actions: [ actions: [

View file

@ -254,6 +254,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.0.2" version: "7.0.2"
dots_indicator:
dependency: transitive
description:
name: dots_indicator
sha256: f1599baa429936ba87f06ae5f2adc920a367b16d08f74db58c3d0f6e93bcdb5c
url: "https://pub.dev"
source: hosted
version: "2.1.2"
ed25519_edwards: ed25519_edwards:
dependency: transitive dependency: transitive
description: description:
@ -307,6 +315,54 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_keyboard_visibility:
dependency: transitive
description:
name: flutter_keyboard_visibility
sha256: "98664be7be0e3ffca00de50f7f6a287ab62c763fc8c762e0a21584584a3ff4f8"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
flutter_keyboard_visibility_linux:
dependency: transitive
description:
name: flutter_keyboard_visibility_linux
sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
flutter_keyboard_visibility_macos:
dependency: transitive
description:
name: flutter_keyboard_visibility_macos
sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086
url: "https://pub.dev"
source: hosted
version: "1.0.0"
flutter_keyboard_visibility_platform_interface:
dependency: transitive
description:
name: flutter_keyboard_visibility_platform_interface
sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_keyboard_visibility_web:
dependency: transitive
description:
name: flutter_keyboard_visibility_web
sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_keyboard_visibility_windows:
dependency: transitive
description:
name: flutter_keyboard_visibility_windows
sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73
url: "https://pub.dev"
source: hosted
version: "1.0.0"
flutter_launcher_icons: flutter_launcher_icons:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -458,6 +514,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.19.0" version: "0.19.0"
introduction_screen:
dependency: "direct main"
description:
name: introduction_screen
sha256: "325f26e86fa3c3e86e6ab2bbc1fda860c9e6eae5ff29166fc2a3cab8f710d5b5"
url: "https://pub.dev"
source: hosted
version: "3.1.14"
io: io:
dependency: transitive dependency: transitive
description: description:

View file

@ -22,6 +22,7 @@ dependencies:
google_fonts: ^6.2.1 google_fonts: ^6.2.1
image: ^4.3.0 image: ^4.3.0
intl: any intl: any
introduction_screen: ^3.1.14
json_annotation: ^4.9.0 json_annotation: ^4.9.0
libsignal_protocol_dart: ^0.7.1 libsignal_protocol_dart: ^0.7.1
logging: ^1.3.0 logging: ^1.3.0
@ -61,3 +62,9 @@ flutter:
assets: assets:
# Add assets from the images directory to the application. # Add assets from the images directory to the application.
- assets/images/ - assets/images/
- assets/images/onboarding/01.png
- assets/images/onboarding/02.png
- assets/images/onboarding/03.png
- assets/images/onboarding/04.png
- assets/images/onboarding/05.png
- assets/images/onboarding/06.png