mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 04:47:54 +00:00
initialized Application theme
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/auth/models/user_model.dart';
|
||||
|
||||
class AuthProvider extends ChangeNotifier {
|
||||
// todo remove temp user
|
||||
UserModel user = UserModel(
|
||||
id: '1',
|
||||
name: 'John Doe',
|
||||
email: '',
|
||||
photoUrl: '',
|
||||
isAgreementAccepted: false,
|
||||
isAnonymous: false,
|
||||
isEmailVerified: false,
|
||||
phoneNumber: '',
|
||||
);
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:syncrow_app/features/home/widgets/syncrow_logo.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_text_button.dart';
|
||||
import 'package:syncrow_app/navigation/route_manager.dart';
|
||||
|
||||
import '../../navigation/routing_constants.dart';
|
||||
import 'auth_provider.dart';
|
||||
|
||||
class AuthPage extends StatelessWidget {
|
||||
const AuthPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (BuildContext context) => AuthProvider(),
|
||||
builder: (context, child) => Scaffold(
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const Expanded(child: SizedBox()),
|
||||
const SyncrowLogo(),
|
||||
const Expanded(flex: 2, child: SizedBox()),
|
||||
DefaultTextButton(
|
||||
text: 'Login',
|
||||
onPressed: () {
|
||||
RouteManager().routerManagerPopAndPushNamed(
|
||||
routeName: Routes.homeRoute,
|
||||
context: context,
|
||||
);
|
||||
},
|
||||
isPrimary: true,
|
||||
),
|
||||
const Gap(15),
|
||||
const DefaultTextButton(text: 'Sign Up'),
|
||||
const Gap(20),
|
||||
Center(
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
child: const Text(
|
||||
'Try as a Guest',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Gap(30),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
part 'auth_state.dart';
|
||||
|
||||
class AuthCubit extends Cubit<AuthState> {
|
||||
AuthCubit() : super(AuthInitial());
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
part of 'auth_cubit.dart';
|
||||
|
||||
@immutable
|
||||
abstract class AuthState {}
|
||||
|
||||
class AuthInitial extends AuthState {}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
|
||||
import 'package:syncrow_app/features/auth/view/widgets/auth_view_body.dart';
|
||||
|
||||
class AuthView extends StatelessWidget {
|
||||
const AuthView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AuthCubit, AuthState>(
|
||||
builder: (context, state) {
|
||||
return const Scaffold(
|
||||
body: AuthViewBody(),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_text_button.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/syncrow_logo.dart';
|
||||
|
||||
import '../../../../navigation/routing_constants.dart';
|
||||
|
||||
class AuthViewBody extends StatelessWidget {
|
||||
const AuthViewBody({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const Expanded(child: SizedBox()),
|
||||
const SyncrowLogo(),
|
||||
const Expanded(flex: 2, child: SizedBox()),
|
||||
DefaultTextButton(
|
||||
text: 'Login',
|
||||
onPressed: () {
|
||||
Navigator.popAndPushNamed(context, Routes.homeRoute);
|
||||
},
|
||||
),
|
||||
const Gap(15),
|
||||
const DefaultTextButton(
|
||||
text: 'Sign Up',
|
||||
isSecondary: true,
|
||||
),
|
||||
const Gap(20),
|
||||
Center(
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
child: const Text(
|
||||
'Try as a Guest',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Gap(30),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user