rameez_animated_login_screen 0.0.1 rameez_animated_login_screen: ^0.0.1 copied to clipboard
A new Flutter package project.
// ignore_for_file: avoid_print
import 'package:flutter/material.dart';
import 'package:rameez_animated_login_screen/login_data.dart';
import 'package:rameez_animated_login_screen/rameez_animated_login_screen.dart';
import 'firstpage.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Login Screen',
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.blue),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/a.jpg"),
fit: BoxFit.cover,
),
),
child: Align(
alignment: Alignment.center,
child: RameezAnimatedLoginScreen(
//flareController: flareController,
passwordFieldCaretMovement: (Offset globalCaretPosition) {},
userFieldCaretMovement: (Offset globalCaretPosition) {},
//flareImage: 'assets/Test.flr',
routeAfterSuccessFulSignIn: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) => const Page1(),
),
);
},
validateUserNameAndPassword: validate,
defaultAnimation: true, passwordLabel: 'Enter Password',
usernameLabel: 'Enter User Name',
),
)));
}
bool validate(LoginData loginData) {
print(loginData.password);
print(loginData.name);
if (loginData.name == "ram" && loginData.password == "rame") {
return true;
}
return false;
}
}