Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How not to show the policy check box #82

Open
SmartfySolutions opened this issue Nov 4, 2024 · 1 comment
Open

How not to show the policy check box #82

SmartfySolutions opened this issue Nov 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@SmartfySolutions
Copy link

Hello.

I am adding the latest available version of this plugin in an App for Android and iOS.
I'm trying to hide the privacy policy and terms of use check, but I can't make it not appear.
How can I make it not to appear?

Thank you.

@SmartfySolutions SmartfySolutions added the bug Something isn't working label Nov 4, 2024
@bahricanyesil
Copy link
Owner

bahricanyesil commented Nov 5, 2024

@SmartfySolutions First of all, I hope you are doing well.

You can hide the privacy policy and terms of use checkbox by passing a value to the animatedComponentOrder field under loginDesktopTheme ad loginMobileTheme parameters. If you just want to use the default ordered components but only hide the checkbox. You can set the parameter as:

const <AnimatedComponent>[
      AnimatedComponent(
        component: LoginComponents.logo,
        animationType: AnimationType.left,
      ),
      AnimatedComponent(
        component: LoginComponents.title,
        animationType: AnimationType.left,
      ),
      AnimatedComponent(
        component: LoginComponents.description,
        animationType: AnimationType.left,
      ),
      AnimatedComponent(
        component: LoginComponents.formTitle,
        animationType: AnimationType.left,
      ),
      AnimatedComponent(component: LoginComponents.socialLogins),
      AnimatedComponent(component: LoginComponents.useEmail),
      AnimatedComponent(component: LoginComponents.form),
      AnimatedComponent(component: LoginComponents.notHaveAnAccount),
      AnimatedComponent(
        component: LoginComponents.forgotPassword,
        animationType: AnimationType.left,
      ),
      AnimatedComponent(
        component: LoginComponents.changeActionButton,
        animationType: AnimationType.left,
      ),
      AnimatedComponent(component: LoginComponents.policyCheckbox),
      AnimatedComponent(
        component: LoginComponents.actionButton,
        animationType: AnimationType.left,
      ),
    ]

Here's a full example code you can hide the privacy policy checkbox:

import 'package:animated_login/animated_login.dart';
import 'package:flutter/material.dart';

/// Main function.
void main() {
  runApp(const MyApp());
}

/// Example app widget.
class MyApp extends StatelessWidget {
  /// Main app widget.
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Animated Login',
      theme: ThemeData(
        primaryColor: Colors.blue,
        colorScheme: const ColorScheme.light(primary: Colors.blue),
        // useMaterial3: true,
        textTheme: Theme.of(context).textTheme.apply(
            // Note: The below line is required due to a current bug in Flutter:
            // https://github.com/flutter/flutter/issues/129553
            decorationColor: Colors.blue),
        inputDecorationTheme: const InputDecorationTheme(
          prefixIconColor: Colors.black54,
          suffixIconColor: Colors.black54,
          iconColor: Colors.black54,
          labelStyle: TextStyle(color: Colors.black54),
          hintStyle: TextStyle(color: Colors.black54),
        ),
      ),
      debugShowCheckedModeBanner: false,
      initialRoute: '/login',
      routes: {
        '/login': (BuildContext context) => const LoginScreen(),
        '/forgotPass': (BuildContext context) => const ForgotPasswordScreen(),
      },
    );
  }

  // static const Map<int, Color> color = {
  //   50: Color.fromRGBO(4, 131, 184, .1),
  //   100: Color.fromRGBO(4, 131, 184, .2),
  //   200: Color.fromRGBO(4, 131, 184, .3),
  //   300: Color.fromRGBO(4, 131, 184, .4),
  //   400: Color.fromRGBO(4, 131, 184, .5),
  //   500: Color.fromRGBO(4, 131, 184, .6),
  //   600: Color.fromRGBO(4, 131, 184, .7),
  //   700: Color.fromRGBO(4, 131, 184, .8),
  //   800: Color.fromRGBO(4, 131, 184, .9),
  //   900: Color.fromRGBO(4, 131, 184, 1),
  // };
}

/// Example login screen
class LoginScreen extends StatefulWidget {
  /// Simulates the multilanguage, you will implement your own logic.
  /// According to the current language, you can display a text message
  /// with the help of [LoginTexts] class.
  const LoginScreen({Key? key}) : super(key: key);

  @override
  State<LoginScreen> createState() => _LoginScreenState();
}

class _LoginScreenState extends State<LoginScreen> {
  LoginViewTheme get _theme => LoginViewTheme(
        animatedComponentOrder: const <AnimatedComponent>[
          AnimatedComponent(
            component: LoginComponents.logo,
            animationType: AnimationType.left,
          ),
          AnimatedComponent(
            component: LoginComponents.title,
            animationType: AnimationType.left,
          ),
          AnimatedComponent(
            component: LoginComponents.description,
            animationType: AnimationType.left,
          ),
          AnimatedComponent(
            component: LoginComponents.formTitle,
            animationType: AnimationType.left,
          ),
          AnimatedComponent(component: LoginComponents.socialLogins),
          AnimatedComponent(component: LoginComponents.useEmail),
          AnimatedComponent(component: LoginComponents.form),
          AnimatedComponent(component: LoginComponents.notHaveAnAccount),
          AnimatedComponent(
            component: LoginComponents.forgotPassword,
            animationType: AnimationType.left,
          ),
          AnimatedComponent(
            component: LoginComponents.changeActionButton,
            animationType: AnimationType.left,
          ),
          AnimatedComponent(
            component: LoginComponents.actionButton,
            animationType: AnimationType.left,
          ),
        ],
      );

  @override
  Widget build(BuildContext context) {
    return AnimatedLogin(
      loginMobileTheme: _theme,
      loginDesktopTheme: _theme,
    );
  }
}

/// Example forgot password screen
class ForgotPasswordScreen extends StatelessWidget {
  /// Example forgot password screen that user is navigated to
  /// after clicked on "Forgot Password?" text.
  const ForgotPasswordScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Center(
        child: Text('FORGOT PASSWORD'),
      ),
    );
  }
}

Please let me know if this does not work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants