Merge pull request #260 from ente-io/on-bording-screen-fixes

Progress bar
This commit is contained in:
Neeraj Gupta 2022-06-02 18:32:47 +05:30 committed by GitHub
commit da26dd717e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 74 additions and 21 deletions

View file

@ -52,7 +52,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
type: MaterialType.transparency, type: MaterialType.transparency,
child: StepProgressIndicator( child: StepProgressIndicator(
totalSteps: 4, totalSteps: 4,
currentStep: 1, currentStep: 2,
selectedColor: Theme.of(context).buttonColor, selectedColor: Theme.of(context).buttonColor,
roundedEdges: Radius.circular(10), roundedEdges: Radius.circular(10),
unselectedColor: Theme.of(context).bottomAppBarColor, unselectedColor: Theme.of(context).bottomAppBarColor,

View file

@ -1,5 +1,3 @@
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
@ -478,6 +476,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
showAppBar: false, showAppBar: false,
isDismissible: false, isDismissible: false,
onDone: onDone, onDone: onDone,
showProgressBar: true,
)); ));
} catch (e) { } catch (e) {
_logger.severe(e); _logger.severe(e);

View file

@ -19,6 +19,7 @@ import 'package:photos/ui/progress_dialog.dart';
import 'package:photos/ui/web_page.dart'; import 'package:photos/ui/web_page.dart';
import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/dialog_util.dart';
import 'package:photos/utils/toast_util.dart'; import 'package:photos/utils/toast_util.dart';
import 'package:step_progress_indicator/step_progress_indicator.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class StripeSubscriptionPage extends StatefulWidget { class StripeSubscriptionPage extends StatefulWidget {
@ -111,9 +112,26 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appBar = AppBar( // final appBar = AppBar(
title: Text("Subscription"), // title: Text("Subscription"),
); // );
final appBar = widget.isOnboarding
? AppBar(
elevation: 0,
title: Hero(
tag: "subscription",
child: StepProgressIndicator(
totalSteps: 4,
currentStep: 4,
selectedColor: Theme.of(context).buttonColor,
roundedEdges: Radius.circular(10),
unselectedColor: Theme.of(context).bottomAppBarColor,
)),
)
: AppBar(
elevation: 0,
title: Text("Subscription"),
);
return Scaffold( return Scaffold(
appBar: appBar, appBar: appBar,
body: _getBody(), body: _getBody(),

View file

@ -25,9 +25,25 @@ class _SubscriptionHeaderWidgetState extends State<SubscriptionHeaderWidget> {
if (widget.isOnboarding) { if (widget.isOnboarding) {
return Padding( return Padding(
padding: const EdgeInsets.fromLTRB(20, 20, 20, 24), padding: const EdgeInsets.fromLTRB(20, 20, 20, 24),
child: Text( child: Column(
"Ente preserves your memories, so they're always available to you, even if you lose your device", crossAxisAlignment: CrossAxisAlignment.start,
style: Theme.of(context).textTheme.caption, children: [
Row(
children: [
Text(
"Select your plan",
style: Theme.of(context).textTheme.headline4,
),
],
),
const SizedBox(
height: 10,
),
Text(
"Ente preserves your memories, so they're always available to you, even if you lose your device ",
style: Theme.of(context).textTheme.caption,
),
],
), ),
); );
} else { } else {

View file

@ -1,6 +1,4 @@
import 'dart:io' as io; import 'dart:io' as io;
import 'dart:ui';
import 'package:bip39/bip39.dart' as bip39; import 'package:bip39/bip39.dart' as bip39;
import 'package:dotted_border/dotted_border.dart'; import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -11,6 +9,7 @@ import 'package:photos/ente_theme_data.dart';
import 'package:photos/ui/common/gradientButton.dart'; import 'package:photos/ui/common/gradientButton.dart';
import 'package:photos/utils/toast_util.dart'; import 'package:photos/utils/toast_util.dart';
import 'package:share_plus/share_plus.dart'; import 'package:share_plus/share_plus.dart';
import 'package:step_progress_indicator/step_progress_indicator.dart';
class RecoveryKeyPage extends StatefulWidget { class RecoveryKeyPage extends StatefulWidget {
final bool showAppBar; final bool showAppBar;
@ -21,6 +20,7 @@ class RecoveryKeyPage extends StatefulWidget {
final String title; final String title;
final String text; final String text;
final String subText; final String subText;
final bool showProgressBar;
const RecoveryKeyPage(this.recoveryKey, this.doneText, const RecoveryKeyPage(this.recoveryKey, this.doneText,
{Key key, {Key key,
@ -29,7 +29,8 @@ class RecoveryKeyPage extends StatefulWidget {
this.isDismissible, this.isDismissible,
this.title, this.title,
this.text, this.text,
this.subText}) this.subText,
this.showProgressBar = false})
: super(key: key); : super(key: key);
@override @override
@ -40,7 +41,6 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
bool _hasTriedToSave = false; bool _hasTriedToSave = false;
final _recoveryKeyFile = io.File( final _recoveryKeyFile = io.File(
Configuration.instance.getTempDirectory() + "ente-recovery-key.txt"); Configuration.instance.getTempDirectory() + "ente-recovery-key.txt");
final _recoveryKey = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -51,22 +51,42 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
} }
return Scaffold( return Scaffold(
appBar: widget.showAppBar appBar: widget.showProgressBar
? AppBar( ? AppBar(
title: Text(widget.title ?? "Recovery Key"), elevation: 0,
title: Hero(
tag: "recovery_key",
child: StepProgressIndicator(
totalSteps: 4,
currentStep: 3,
selectedColor: Theme.of(context).buttonColor,
roundedEdges: Radius.circular(10),
unselectedColor: Theme.of(context).bottomAppBarColor,
),
),
) )
: null, : widget.showAppBar
? AppBar(
title: Text(widget.title ?? "Recovery key"),
)
: null,
body: Padding( body: Padding(
padding: EdgeInsets.fromLTRB(20, widget.showAppBar ? 40 : 120, 20, 20), padding: EdgeInsets.fromLTRB(
20,
widget.showAppBar
? 40
: widget.showProgressBar
? 32
: 120,
20,
20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
// mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
widget.showAppBar widget.showAppBar
? Container() ? const SizedBox.shrink()
: Text(widget.title ?? "Recovery Key", : Text(widget.title ?? "Recovery key",
style: Theme.of(context).textTheme.headline4), style: Theme.of(context).textTheme.headline4),
Padding(padding: EdgeInsets.all(widget.showAppBar ? 0 : 12)), Padding(padding: EdgeInsets.all(widget.showAppBar ? 0 : 12)),
Text( Text(