diff --git a/lib/Component/theme.dart b/lib/Component/theme.dart index e4557619fc044402fa4fff446b2b6845e47b113f..f0615bd2f516f68f9c3ed45e9dc6b5d556b7ec87 100644 --- a/lib/Component/theme.dart +++ b/lib/Component/theme.dart @@ -4,31 +4,32 @@ import 'package:google_fonts/google_fonts.dart'; class AppTheme { static ThemeData custom(ThemeData base) { return base.copyWith( - appBarTheme: base.appBarTheme.copyWith( - color: Colors.white, - iconTheme: IconThemeData(color: Colors.black87), - elevation: 0.5, - textTheme: GoogleFonts.montserratTextTheme(base.textTheme)), - textTheme: GoogleFonts.montserratTextTheme(base.textTheme).apply( - bodyColor: Colors.black, - displayColor: Colors.black, + appBarTheme: base.appBarTheme.copyWith( + color: Colors.white, + iconTheme: IconThemeData(color: Colors.black87), + elevation: 0.5, + textTheme: GoogleFonts.montserratTextTheme(base.textTheme)), + textTheme: GoogleFonts.montserratTextTheme(base.textTheme).apply( + bodyColor: Colors.black, + displayColor: Colors.black, + ), + primaryColor: const Color(0xff3C8DBC), + iconTheme: IconThemeData(color: Colors.grey), + scaffoldBackgroundColor: Colors.white, + backgroundColor: Colors.white, + inputDecorationTheme: const InputDecorationTheme( + contentPadding: EdgeInsets.symmetric(horizontal: 2), + labelStyle: TextStyle(color: Color(0xff4E7890)), + fillColor: Color(0xffF1F1F1), + filled: true, + border: OutlineInputBorder(), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xff4E7890)), ), - primaryColor: const Color(0xff3C8DBC), - iconTheme: IconThemeData(color: Colors.grey), - scaffoldBackgroundColor: Colors.white, - backgroundColor: Colors.white, - inputDecorationTheme: const InputDecorationTheme( - contentPadding: EdgeInsets.symmetric(horizontal: 2), - labelStyle: TextStyle(color: Color(0xff4E7890)), - fillColor: Color(0xffF1F1F1), - filled: true, - border: OutlineInputBorder(), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xff4E7890)), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xff4E7890), width: 2.4), - ), - )); + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xff4E7890), width: 2.4), + ), + ), + ); } } diff --git a/lib/Pages/Login/otp_page.dart b/lib/Pages/Login/otp_page.dart index c3778b146ea6d1a3f0d081e20b25eba2d749a88c..9d580e6155c673cdf54388ca9f3f2fdcc3bbbda2 100644 --- a/lib/Pages/Login/otp_page.dart +++ b/lib/Pages/Login/otp_page.dart @@ -22,6 +22,13 @@ class OTPPage extends StatelessWidget { BlocProvider.of(context).add(ResubmitOTP(tokenBearer)); } + BoxDecoration get _pinPutDecoration { + return BoxDecoration( + border: Border.all(color: const Color(0xff4E7890)), + borderRadius: BorderRadius.circular(15), + ); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -32,7 +39,7 @@ class OTPPage extends StatelessWidget { ), iconTheme: const IconThemeData(color: Colors.white), centerTitle: true, - backgroundColor: Theme.of(context).primaryColor, + backgroundColor: const Color(0xff4E7890), ), body: BlocListener( listener: (context, state) { @@ -54,14 +61,32 @@ class OTPPage extends StatelessWidget { children: [ const Text('Mohon masukkan OTP yang dikirim ke nomor anda', softWrap: true), - PinPut( - onSubmit: (String pin) { - _otpSubmitted(pin, context); - }, - fieldsCount: 6, + Divider( + height: 20, + thickness: null, + ), + Theme( + data: Theme.of(context) + .copyWith(inputDecorationTheme: InputDecorationTheme()), + child: PinPut( + onSubmit: (String pin) { + _otpSubmitted(pin, context); + }, + submittedFieldDecoration: _pinPutDecoration.copyWith( + borderRadius: BorderRadius.circular(20)), + selectedFieldDecoration: _pinPutDecoration, + followingFieldDecoration: _pinPutDecoration.copyWith( + borderRadius: BorderRadius.circular(5), + border: Border.all( + color: const Color(0xff3C8DBC), + ), + ), + fieldsCount: 6, + ), ), Container( - height: MediaQuery.of(context).size.height / 17, + margin: EdgeInsets.only(top: 10), + height: MediaQuery.of(context).size.height / 18, child: ButtonResendOTP( label: 'Kirim Ulang OTP', onClick: _otpResend, diff --git a/lib/main.dart b/lib/main.dart index b4874db4dfcb7c71ca9809efffaf64bd595fd5eb..d73f0a40bea08004bab8b991fdecb1c48d3b4223 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,3 @@ -import 'package:bloc/bloc.dart'; import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -16,26 +15,6 @@ import 'package:intl/intl.dart'; import 'home_industry_app.dart'; -class SimpleBlocDelegate extends BlocDelegate { - @override - void onEvent(Bloc bloc, Object event) { - super.onEvent(bloc, event); - print(event); - } - - @override - void onTransition(Bloc bloc, Transition transition) { - super.onTransition(bloc, transition); - print(transition); - } - - @override - void onError(Bloc bloc, Object error, StackTrace stackTrace) { - super.onError(bloc, error, stackTrace); - print(error); - } -} - Future main() async { WidgetsFlutterBinding.ensureInitialized(); await GlobalConfiguration().loadFromAsset('app_settings'); @@ -47,7 +26,6 @@ Future main() async { }); final options = BaseOptions(baseUrl: GlobalConfiguration().getString('url')); final dio = Dio(options); - BlocSupervisor.delegate = SimpleBlocDelegate(); const secureStorage = FlutterSecureStorage(); final authRepository = AuthRepository(storage: secureStorage, dio: dio); runApp(BlocProvider( diff --git a/pubspec.lock b/pubspec.lock index d423dfcb03e34ccb945060d33cb95628e648521e..8d976055584e8387856272419ceff4fd660b3a1d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -189,7 +189,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "0.13.9" + version: "0.13.10" crypto: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 28be848ba8483cb3ee108a7c03e439a806ea02ae..049b0d8a866ce6f1a8728f9cf3a24387f49f15d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,7 +29,7 @@ dependencies: dio: ^3.0.9 flutter_secure_storage: ^3.3.3 json_annotation: ^3.0.1 - pinput: ^0.2.3 + pinput: ^0.2.4 flutter_easyloading: ^1.1.4 intl: ^0.16.1 stream_transform: ^1.2.0