-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0607b40
commit 9fe1c43
Showing
17 changed files
with
200 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const String HOME_ROUTE = '/home'; | ||
const String INTRO_ROUTE = '/intro'; | ||
const String SEND_ROUTE = '/send'; | ||
const String DESKTOP_SEND_ROUTE = '/'; | ||
const String DESKTOP_SEND_ROUTE = '/desktop_send_route'; | ||
const String RECEIVE_ROUTE = '/receive'; | ||
const String SPLASH_ROUTE = '/'; | ||
const String SETTINGS_ROUTE = '/settings'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import 'package:dart_wormhole_gui/constants/app_constants.dart'; | ||
import 'package:dart_wormhole_gui/constants/asset_path.dart'; | ||
import 'package:dart_wormhole_gui/views/desktop/send/send.dart'; | ||
import 'package:dart_wormhole_william/client/native_client.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:intro_slider/intro_slider.dart'; | ||
import 'package:intro_slider/scrollbar_behavior_enum.dart'; | ||
import 'package:intro_slider/slide_object.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
class IntroScreen extends StatefulWidget { | ||
final Config config; | ||
IntroScreen(this.config); | ||
|
||
@override | ||
IntroScreenState createState() => new IntroScreenState(config); | ||
} | ||
|
||
// ------------------ Custom config ------------------ | ||
class IntroScreenState extends State<IntroScreen> { | ||
final Config config; | ||
IntroScreenState(this.config); | ||
|
||
List<Slide> slides = []; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
slides.add( | ||
new Slide( | ||
title: END_TO_END_ENCRYPTION, | ||
titleTextFontSize: 44.0, | ||
subTitleTextFontSize: 24.0, | ||
desktopActionButtonEnabled: true, | ||
description: | ||
SEND_AND_RECEIVE_FILES_SECURELY_WITH_SIMPLICITY_AND_SPEED, | ||
btnTitle: GET_STARTED, | ||
pathImage: INTRO_LOGO, | ||
backgroundColor: Colors.black, | ||
heightImage: 300.0), | ||
); | ||
slides.add( | ||
new Slide( | ||
title: NO_SIGN_UP, | ||
titleTextFontSize: 44.0, | ||
subTitleTextFontSize: 24.0, | ||
desktopActionButtonEnabled: true, | ||
description: SEND_AND_RECEIVE_FILES_WITH_NO_NEED_TO_SIGN_UP, | ||
pathImage: PRIVACY_IMG, | ||
backgroundColor: Colors.black, | ||
btnTitle: NEXT, | ||
heightImage: 300.0), | ||
); | ||
slides.add( | ||
new Slide( | ||
title: DEVICE_TO_DEVICE, | ||
titleTextFontSize: 44.0, | ||
subTitleTextFontSize: 24.0, | ||
desktopActionButtonEnabled: true, | ||
description: SEND_AND_RECEIVE_FROM_AND_TO_YOUR_DEVICE_WITHOUT_STORING, | ||
btnTitle: START_HERE, | ||
maxLineTextDescription: 3, | ||
pathImage: LAPTOP_TO_MOBILE, | ||
backgroundColor: Colors.black, | ||
heightImage: 300.0), | ||
); | ||
} | ||
|
||
Future setSeenToTrue() async { | ||
SharedPreferences? prefs = await SharedPreferences.getInstance(); | ||
return prefs.setBool(SEEN, true); | ||
} | ||
|
||
void onDonePress() async { | ||
await setSeenToTrue(); | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute(builder: (context) => SendScreen()), | ||
); | ||
} | ||
|
||
ButtonStyle myButtonStyle() { | ||
return ButtonStyle( | ||
shape: MaterialStateProperty.all<OutlinedBorder>(StadiumBorder()), | ||
backgroundColor: MaterialStateProperty.all<Color>(Color(0x33F3B4BA)), | ||
overlayColor: MaterialStateProperty.all<Color>(Color(0x33FFA8B0)), | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return new IntroSlider( | ||
slides: this.slides, | ||
showSkipBtn: false, | ||
showNextBtn: false, | ||
showPrevBtn: false, | ||
showDoneBtn: false, | ||
onDonePress: this.onDonePress, | ||
colorDot: Theme.of(context).scaffoldBackgroundColor, | ||
colorActiveDot: Theme.of(context).colorScheme.secondary, | ||
sizeDot: 13.0, | ||
hideStatusBar: false, | ||
backgroundColorAllSlides: Colors.grey, | ||
verticalScrollbarBehavior: scrollbarBehavior.SHOW_ALWAYS, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:dart_wormhole_gui/config/routes/routes.dart'; | ||
import 'package:dart_wormhole_gui/constants/app_constants.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
class Splash extends StatelessWidget { | ||
SharedPreferences? prefs; | ||
Future isItAppFirstLunch() async { | ||
prefs = await SharedPreferences.getInstance(); | ||
bool _seen = (prefs?.getBool(SEEN) ?? false); | ||
return _seen; | ||
} | ||
|
||
Future setSeenToTrue() async { | ||
return prefs?.setBool(SEEN, true); | ||
} | ||
|
||
Future checkFirstSeen(context) async { | ||
bool isItFirstLunch = await isItAppFirstLunch(); | ||
if (isItFirstLunch) { | ||
Navigator.pushNamed(context, DESKTOP_SEND_ROUTE); | ||
} else { | ||
Navigator.pushNamed(context, INTRO_ROUTE); | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
checkFirstSeen(context); | ||
return Scaffold( | ||
body: Center( | ||
key: Key(SPLASH_SCREEN_BODY), | ||
child: Text( | ||
LOADING, | ||
key: Key(SPLASH_SCREEN_LOADING), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.