Preparing new style (theme & colors)
parent
6ef281d604
commit
3b3de831f0
@ -0,0 +1,38 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
class AppColor {
|
||||||
|
AppColor._();
|
||||||
|
//primary
|
||||||
|
static const Color primary30 = Color(0xffA2E2F8);
|
||||||
|
static const Color primary40 = Color(0xff75BDE0);
|
||||||
|
static const Color primary50 = Color(0xff4A8DB7);
|
||||||
|
static const Color primary60 = Color(0xff3B7097);
|
||||||
|
static const Color primary70 = Color(0xff163A51);
|
||||||
|
|
||||||
|
//texts
|
||||||
|
static const Color neutral20 = Color(0xff767676);
|
||||||
|
static const Color neutral30 = Color(0xffEAF1F4);
|
||||||
|
static const Color neutral40 = Color(0xffE4E5E6);
|
||||||
|
static const Color neutral50 = Color(0xff3B3D4A);
|
||||||
|
static const Color neutral60 = Color(0xff2C2C31);
|
||||||
|
static const Color neutral70 = Color(0xff111427);
|
||||||
|
|
||||||
|
//background
|
||||||
|
static const Color backgroundLight = Color(0xffF7F9FB);
|
||||||
|
static const Color backgroundDark = neutral50;
|
||||||
|
|
||||||
|
//red
|
||||||
|
static const Color red40 = Color(0xffFFDBDC);
|
||||||
|
static const Color red50 = Color(0xffD02127);
|
||||||
|
static const Color red60 = Color(0xff8C050A);
|
||||||
|
|
||||||
|
//green
|
||||||
|
static const Color green40 = Color(0xffBAFFE1);
|
||||||
|
static const Color green50 = Color(0xff62BE96);
|
||||||
|
static const Color green60 = Color(0xff065E38);
|
||||||
|
|
||||||
|
//orange
|
||||||
|
static const Color orange40 = Color(0xffFFEDBC);
|
||||||
|
static const Color orange50 = Color(0xffCC9B14);
|
||||||
|
static const Color orange60 = Color(0xff886400);
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||||
|
|
||||||
|
class AppThemes {
|
||||||
|
AppThemes._();
|
||||||
|
static final ThemeData _data = ThemeData(
|
||||||
|
fontFamily: "Poppins",
|
||||||
|
primaryColor: AppColor.primary50,
|
||||||
|
indicatorColor: AppColor.primary50,
|
||||||
|
);
|
||||||
|
|
||||||
|
static ThemeData lightTheme = _data.copyWith(
|
||||||
|
brightness: Brightness.light,
|
||||||
|
scaffoldBackgroundColor: AppColor.backgroundLight,
|
||||||
|
colorScheme: const ColorScheme.light(primary: AppColor.primary50, onPrimary: Colors.white, secondary: Colors.white, onSecondary: AppColor.neutral70),
|
||||||
|
);
|
||||||
|
|
||||||
|
static ThemeData darkTheme = _data.copyWith(
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
scaffoldBackgroundColor: AppColor.backgroundDark,
|
||||||
|
colorScheme: const ColorScheme.light(primary: AppColor.primary50, onPrimary: AppColor.neutral60, secondary: AppColor.neutral60, onSecondary: Colors.white),
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||||
|
|
||||||
|
class LoginPage extends StatelessWidget {
|
||||||
|
static const String routeName = "/login_page";
|
||||||
|
const LoginPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
body: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Image.asset("assets/images/logo.png", height: 60),
|
||||||
|
Text(
|
||||||
|
"Login",
|
||||||
|
style: Theme.of(context).textTheme.displayMedium?.copyWith(color: AppColor.neutral50),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Enter you credential to login",
|
||||||
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: AppColor.neutral20),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:flare_flutter/flare_actor.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:test_sa/controllers/notification/notification_manger.dart';
|
||||||
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
||||||
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
||||||
|
import 'package:test_sa/models/app_notification.dart';
|
||||||
|
import 'package:test_sa/new_views/pages/login_page.dart';
|
||||||
|
|
||||||
|
class SplashPage extends StatefulWidget {
|
||||||
|
static const String routeName = '/splash_page';
|
||||||
|
const SplashPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SplashPage> createState() => _SplashPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SplashPageState extends State<SplashPage> {
|
||||||
|
SettingProvider _settingProvider;
|
||||||
|
UserProvider _userProvider;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
Firebase.initializeApp();
|
||||||
|
NotificationManger.initialisation((notificationDetails) {
|
||||||
|
AppNotification notification = AppNotification.fromJson(json.decode(notificationDetails.payload));
|
||||||
|
if (notification.path == null || notification.path.isEmpty) return;
|
||||||
|
Navigator.pushNamed(context, notification.path, arguments: notification.requestId);
|
||||||
|
}, (id, title, body, payload) async {});
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
_settingProvider = Provider.of<SettingProvider>(context, listen: false);
|
||||||
|
_userProvider = Provider.of<UserProvider>(context, listen: false);
|
||||||
|
return Scaffold(
|
||||||
|
body: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width / 1.1,
|
||||||
|
child: FlareActor(
|
||||||
|
"assets/rives/atoms_splash.flr",
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
animation: "splash",
|
||||||
|
callback: (animation) async {
|
||||||
|
Navigator.of(context).pushNamed(LoginPage.routeName);
|
||||||
|
if (_settingProvider.isLoaded && (_settingProvider.user?.isLiveToken ?? false)) {
|
||||||
|
_userProvider.user = _settingProvider.user;
|
||||||
|
// TODO [zaid] : push to home page
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue