Skip to content

Commit

Permalink
Merge pull request #754 from atsign-foundation/feature/add-dart-doc-f…
Browse files Browse the repository at this point in the history
…or-at-onboarding-flutter

feat: add dart doc for at_onboarding_flutter package
  • Loading branch information
sachins-geekyants authored Nov 14, 2023
2 parents 57a1fec + 43aa289 commit a9a188b
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import 'package:at_onboarding_flutter/utils/at_onboarding_dimens.dart';
import 'package:at_onboarding_flutter/widgets/at_onboarding_button.dart';
import 'package:flutter/material.dart';

/// This screen shows the list of atsigns already available for the given email
/// This screen shows the list of atSign already available for the given email
class AtOnboardingAccountsScreen extends StatefulWidget {
/// list of atsigns for the email
/// list of atSign for the email
final List<String> atsigns;

/// message to display along with the atsign list
/// message to display along with the atSign list
final String? message;

/// the new atsign selected in the free atsign generator
/// the new atSign selected in the free atSign generator
final String? newAtsign;

/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingAccountsScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ import 'package:at_sync_ui_flutter/at_sync_material.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

/// This screen is for activating an atSign during onboarding process
class AtOnboardingActivateScreen extends StatefulWidget {
///will hide webpage references.
/// If true, will hide webpage references
final bool hideReferences;

/// The atSign to be activated
final String? atSign;

/// The configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingActivateScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import 'package:at_onboarding_flutter/utils/at_onboarding_strings.dart';
import 'package:at_onboarding_flutter/widgets/at_onboarding_button.dart';
import 'package:flutter/material.dart';

/// This screen is for backing up an atKey during onboarding
class AtOnboardingBackupScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingBackupScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ import 'package:flutter/material.dart';
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
import 'package:url_launcher/url_launcher.dart';

/// This screen is for generating atKey
class AtOnboardingGenerateScreen extends StatefulWidget {
/// Callback function to be called when atKey generation is successful
/// It receives the generated atSign and its corresponding secret
final Function({
required String atSign,
required String secret,
})? onGenerateSuccess;

/// Configuration for the onboarding process
final AtOnboardingConfig config;

/// Indicates whether the screen is navigated from the intro screen
final bool isFromIntroScreen;

const AtOnboardingGenerateScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,25 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:zxing2/qrcode.dart';
import 'package:image/image.dart' as img;

/// Home screen provides multiple options like upload atKey, generate new atSign, activatte existing atSign
class AtOnboardingHomeScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

/// If true, shows the custom dialog to get an atsign
/// If true, shows the custom dialog to get an atSign
final bool getAtSign;

/// If true, hides references
final bool hideReferences;

/// If true, hides QR code scanning
final bool hideQrScan;

/// Set status for onboarding process
/// Set the [onboardStatus] to OnboardingStatus.ACTIVATE by default
final onboardStatus = OnboardingStatus.ACTIVATE;

/// Specifies if the screen is being navigated from the intro screen
final bool isFromIntroScreen;

const AtOnboardingHomeScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import 'package:at_onboarding_flutter/widgets/at_onboarding_button.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

/// [AtOnboardingInputAtSignScreen] allows to enter atSign for activation process
class AtOnboardingInputAtSignScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingInputAtSignScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

/// The introductory screen for the at onboarding process
/// [AtOnboardingIntroScreen] gives two options
/// 1. Already have an atSign - proceeds to home screen to upload atKey
/// 2. Get a free atSign - proceeds to generate free atSign
class AtOnboardingIntroScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingIntroScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ import 'package:flutter/services.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:url_launcher/url_launcher.dart';

/// Represent the result of OTP-based onboarding for an atSign
class AtOnboardingOTPResult {
/// The atSign associated with the OTP result
String atSign;

/// The secret value, if available
String? secret;

AtOnboardingOTPResult({
Expand All @@ -26,7 +30,9 @@ class AtOnboardingOTPResult {
});
}

/// This screen is to perform OTP-based verification
class AtOnboardingOTPScreen extends StatefulWidget {
/// Static method to navigate to this screen
static Future<AtOnboardingOTPResult?> push({
required BuildContext context,
required String atSign,
Expand All @@ -47,12 +53,16 @@ class AtOnboardingOTPScreen extends StatefulWidget {
);
}

/// The atSign to be displayed on the OTP screen
final String atSign;

/// The email address, if provided
final String? email;

///will hide webpage references.
/// If true, will hide webpage references
final bool hideReferences;

/// The configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingOTPScreen({
Expand Down Expand Up @@ -620,4 +630,4 @@ class _AtOnboardingOTPScreenState extends State<AtOnboardingOTPScreen> {
},
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';

/// This screen is for pairing an atSign during onboarding process
class AtOnboardingPairScreen extends StatefulWidget {
/// The atSign to be paired
final String atSign;

///will hide webpage references.
/// If true, will hide webpage references.
final bool hideReferences;

/// A function to be called when the pairing is successful
/// It takes [atSign] and [secret] as required parameters
final Function({
required String atSign,
required String secret,
})? onGenerateSuccess;

/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingPairScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';

/// Represents the result of scanning a QR code during the onboarding process
class AtOnboardingQRCodeResult {
/// The atSign associated with the QR result
final String atSign;

/// The secret associated with the QR result
final String secret;

AtOnboardingQRCodeResult({
Expand All @@ -17,7 +21,9 @@ class AtOnboardingQRCodeResult {
});
}

/// The QR code screen used during the onboarding process.
class AtOnboardingQRCodeScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingQRCodeScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

/// Displays onboarding reference screens
/// It uses weview to display the [url]
class AtOnboardingReferenceScreen extends StatefulWidget {
/// Static method to navigate to this screen
static push({
required BuildContext context,
required String? url,
Expand All @@ -24,8 +27,13 @@ class AtOnboardingReferenceScreen extends StatefulWidget {
);
}

/// The URL to display on the screen
final String? url;

/// The title for the screen
final String? title;

/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingReferenceScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import 'package:at_onboarding_flutter/widgets/at_onboarding_dialog.dart';
import 'package:flutter/material.dart';
import 'package:at_onboarding_flutter/at_onboarding_result.dart';



/// The screen is used for resetting the paired atSign
class AtOnboardingResetScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingResetScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import 'package:at_onboarding_flutter/widgets/at_onboarding_dialog.dart';
import 'package:at_sync_ui_flutter/at_sync_material.dart';
import 'package:flutter/material.dart';

/// The starting screen for the onboarding process
class AtOnboardingStartScreen extends StatefulWidget {
/// Configuration for the onboarding process
final AtOnboardingConfig config;

const AtOnboardingStartScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import 'package:at_onboarding_flutter/localizations/generated/l10n.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

/// This screen is for showing WebView during the onboarding process
class AtOnboardingWebviewScreen extends StatefulWidget {
/// The URL to be displayed
final String? url;

/// The title of the screen
final String? title;

const AtOnboardingWebviewScreen({
Expand Down

0 comments on commit a9a188b

Please sign in to comment.