diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..08cc6303 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "thounthends" + ] +} \ No newline at end of file diff --git a/assets/images/onboarding/01.png b/assets/images/onboarding/01.png new file mode 100644 index 00000000..16c57419 Binary files /dev/null and b/assets/images/onboarding/01.png differ diff --git a/assets/images/onboarding/02.png b/assets/images/onboarding/02.png new file mode 100644 index 00000000..ccf4a78b Binary files /dev/null and b/assets/images/onboarding/02.png differ diff --git a/assets/images/onboarding/03.png b/assets/images/onboarding/03.png new file mode 100644 index 00000000..4fe1c5cb Binary files /dev/null and b/assets/images/onboarding/03.png differ diff --git a/assets/images/onboarding/04.png b/assets/images/onboarding/04.png new file mode 100644 index 00000000..9f2b181b Binary files /dev/null and b/assets/images/onboarding/04.png differ diff --git a/assets/images/onboarding/05.png b/assets/images/onboarding/05.png new file mode 100644 index 00000000..8bd53cfe Binary files /dev/null and b/assets/images/onboarding/05.png differ diff --git a/assets/images/onboarding/06.png b/assets/images/onboarding/06.png new file mode 100644 index 00000000..602e26d1 Binary files /dev/null and b/assets/images/onboarding/06.png differ diff --git a/assets/images/onboarding/mountain-7011121_1920.png b/assets/images/onboarding/mountain-7011121_1920.png new file mode 100644 index 00000000..f3b0f8c8 Binary files /dev/null and b/assets/images/onboarding/mountain-7011121_1920.png differ diff --git a/assets/images/onboarding/mountain-7011121_640.png b/assets/images/onboarding/mountain-7011121_640.png new file mode 100644 index 00000000..acef4932 Binary files /dev/null and b/assets/images/onboarding/mountain-7011121_640.png differ diff --git a/lib/src/app.dart b/lib/src/app.dart index 1bdab9a0..940f9844 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -1,4 +1,5 @@ import 'package:twonly/main.dart'; +import 'package:twonly/src/views/onboarding_view.dart'; import 'views/home_view.dart'; import 'views/register_view.dart'; import 'utils.dart'; @@ -20,6 +21,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { Future _isUserCreated = isUserCreated(); + bool _showOnboarding = true; bool _isConnected = false; int redColorOpacity = 0; // Start with dark red bool redColorGoUp = true; @@ -104,12 +106,18 @@ class _MyAppState extends State { return snapshot.data! ? HomeView( settingsController: widget.settingsController) - : RegisterView( - callbackOnSuccess: () { - _isUserCreated = isUserCreated(); - setState(() {}); - }, - ); // Show the red line if not connected + : _showOnboarding + ? OnboardingView( + callbackOnSuccess: () { + setState(() { + _showOnboarding = false; + }); + }, + ) + : RegisterView(callbackOnSuccess: () { + _isUserCreated = isUserCreated(); + setState(() {}); + }); } else { return Container(); } diff --git a/lib/src/views/camera_preview_view.dart b/lib/src/views/camera_preview_view.dart index 4072209c..dbcdb796 100644 --- a/lib/src/views/camera_preview_view.dart +++ b/lib/src/views/camera_preview_view.dart @@ -64,9 +64,7 @@ class _CameraPreviewViewState extends State { alignment: Alignment.bottomCenter, child: Column( children: [ - AwesomeZoomSelector(state: cameraState - // controller: _controller, - ), + AwesomeZoomSelector(state: cameraState), const SizedBox(height: 30), GestureDetector( onTap: () async { diff --git a/lib/src/views/onboarding_view.dart b/lib/src/views/onboarding_view.dart new file mode 100644 index 00000000..999cd1d3 --- /dev/null +++ b/lib/src/views/onboarding_view.dart @@ -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)), + ), + ), + ); + } +} diff --git a/lib/src/views/profile_view.dart b/lib/src/views/profile_view.dart index 46c62775..a1896e86 100644 --- a/lib/src/views/profile_view.dart +++ b/lib/src/views/profile_view.dart @@ -28,7 +28,7 @@ class _ProfileViewState extends State { if (snap.hasData) { return Text("Hello ${snap.data!.username}!"); } else { - return CircularProgressIndicator(); + return Container(); } }), actions: [ diff --git a/pubspec.lock b/pubspec.lock index 612b9ad8..bb24ed65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -254,6 +254,14 @@ packages: url: "https://pub.dev" source: hosted 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: dependency: transitive description: @@ -307,6 +315,54 @@ packages: description: flutter source: sdk 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: dependency: "direct dev" description: @@ -458,6 +514,14 @@ packages: url: "https://pub.dev" source: hosted 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: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 900994e5..b7eb7c82 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,6 +22,7 @@ dependencies: google_fonts: ^6.2.1 image: ^4.3.0 intl: any + introduction_screen: ^3.1.14 json_annotation: ^4.9.0 libsignal_protocol_dart: ^0.7.1 logging: ^1.3.0 @@ -61,3 +62,9 @@ flutter: assets: # Add assets from the images directory to the application. - 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