Auto SMS, Themes, Voice Command

merge-requests/251/head
Sultan Khan 4 years ago
parent 3e947dda37
commit e61c26b853

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi';
const PACKAGES_CATEGORIES = '/api/categories';
const PACKAGES_PRODUCTS = '/api/products';
//const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/';
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
@ -23,18 +24,33 @@ import 'pages/pharmacies/compare-list.dart';
void main() async {
setupLocator();
runApp(ChangeNotifierProvider<ThemeNotifier>(create: (context) => ThemeNotifier(defaultTheme), child: MyApp()));
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyApp createState() => new _MyApp();
}
class _MyApp extends State<MyApp> {
@override
void initState() {
// ProjectViewModel projectProvider;
// projectProvider = Provider.of(context);
// var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans';
ThemeNotifier(defaultTheme());
super.initState();
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
PlatformBridge.init(context);
LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload);
LocalNotification.getInstance()
.showNow(title: "Payload", subtitle: payload, payload: payload);
});
final themeNotifier = Provider.of<ThemeNotifier>(context);
// final themeNotifier = Provider.of<ThemeNotifier>(context);
precacheImage(AssetImage('assets/images/powerd-by.jpg'), context);
return LayoutBuilder(
builder: (context, constraints) {
@ -46,11 +62,15 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),
ChangeNotifierProvider<ToDoCountProviderModel>(create: (context) => ToDoCountProviderModel()),
ChangeNotifierProvider<SearchProvider>(create: (context) => SearchProvider()),
ChangeNotifierProvider<ToDoCountProviderModel>(
create: (context) => ToDoCountProviderModel()),
ChangeNotifierProvider<SearchProvider>(
create: (context) => SearchProvider()),
ChangeNotifierProvider.value(
value: SearchProvider(),
),
ChangeNotifierProvider<ThemeNotifier>(
create: (context) => ThemeNotifier(defaultTheme())),
StreamProvider.value(
value: RobotProvider().intStream(),
initialData: RobotProvider().setValue({}),
@ -60,7 +80,6 @@ class MyApp extends StatelessWidget {
],
child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp(
showSemanticsDebugger: false,
title: 'Diplomatic Quarter App',
locale: projectProvider.appLocal,
@ -74,47 +93,50 @@ class MyApp extends StatelessWidget {
const Locale('ar', ''), // Arabic
const Locale('en', ''), // English
],
theme: ThemeData(
fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
textTheme: TextTheme(
headline1: TextStyle(
color: Color(0xffB8382C),
),
),
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Color(0xff515A5D),
brightness: Brightness.light,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],
),
),
),
theme: Provider.of<ThemeNotifier>(context).getTheme(),
// theme: ThemeData(
// fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// textTheme: TextTheme(
// headline1: TextStyle(
// color: Color(0xffB8382C),
// ),
// ),
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor:
// Color(0xffE9E9E9), // Colors.grey[100],
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Color.fromRGBO(255, 255, 255, 1),
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff515A5D),
// toggleableActiveColor: secondaryColor,
// indicatorColor: secondaryColor,
// bottomSheetTheme: BottomSheetThemeData(
// backgroundColor: HexColor('#E0E0E0')),
// cursorColor: Colors.grey,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff515A5D),
// brightness: Brightness.light,
// elevation: 0.0,
// actionsIconTheme: IconThemeData(
// color: Colors.grey[800],
// ),
// ),
// ),
initialRoute: SPLASH,
routes: routes,
debugShowCheckedModeBanner: false,

@ -21,7 +21,7 @@ class SendActivationRequest {
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String sMSSignature;
SendActivationRequest(
{this.patientMobileNumber,
this.mobileNo,
@ -44,7 +44,8 @@ class SendActivationRequest {
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID});
this.deviceTypeID,
this.sMSSignature});
SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber'];
@ -69,6 +70,7 @@ class SendActivationRequest {
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
sMSSignature = json['SMSSignature'];
}
Map<String, dynamic> toJson() {
@ -95,6 +97,7 @@ class SendActivationRequest {
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['SMSSignature'] = sMSSignature;
return data;
}
}

@ -339,47 +339,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return permissionResults;
}
setTheme() async {
//
// defaultTheme =
// ThemeData(
// fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor: Color(0xffEEEEEE),
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Colors.white,
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff40ACC9),
// bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
// cursorColor: Colors.grey,
// cardColor: Colors.white,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff40ACC9),
// brightness: Brightness.dark,
// elevation: 10.0,
// actionsIconTheme: IconThemeData(
// color: Color(0xff40ACC9),
// ),
// ),
// );
// themeNotifier.setTheme(defaultTheme);
}
static Future<dynamic> myBackgroundMessageHandler(
Map<String, dynamic> message) async {
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
@ -494,14 +453,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
headline6: TextStyle(
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
),
title: Text(
getText(currentTab).toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
// bold: true,
// color: Colors.white,
@ -513,12 +473,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
currentTab == 0
? IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
icon: Icon(Icons.arrow_back),
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
onPressed: () {
setState(() {
currentTab = 0;
@ -561,7 +521,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
//iconSize: 70,
icon: Icon(
projectViewModel.isLogin ? Icons.settings : Icons.login,
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
),
onPressed: () {
if (projectViewModel.isLogin)

@ -353,6 +353,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sendActivationCode(type) async {
var request = this.getCommonRequest(type: type);
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
@ -39,15 +40,15 @@ class _GeneralSettings extends State<GeneralSettings>
return Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context).modes,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -67,7 +68,7 @@ class _GeneralSettings extends State<GeneralSettings>
],
)),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -87,15 +88,15 @@ class _GeneralSettings extends State<GeneralSettings>
],
)),
Container(
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context).blindMode,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
new Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(8.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -178,15 +179,15 @@ class _GeneralSettings extends State<GeneralSettings>
)
])),
Container(
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context).permissions,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -205,7 +206,7 @@ class _GeneralSettings extends State<GeneralSettings>
],
)),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -236,46 +237,9 @@ class _GeneralSettings extends State<GeneralSettings>
break;
case 1:
{
themeNotifier.setTheme(ThemeData(
//fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
));
Screen.setBrightness(1.0);
themeNotifier.setTheme(await getTheme(value));
}
break;
case 2:
themeNotifier.setTheme(await getTheme(value));
@ -294,7 +258,7 @@ class _GeneralSettings extends State<GeneralSettings>
}
break;
}
//permission.setTheme(value);
permission.setTheme(value);
}
setVibration(value) {
@ -307,130 +271,28 @@ class _GeneralSettings extends State<GeneralSettings>
}
getValues() async {
if (permission.isThemeEnabled() != null) {
blindValue =
permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled();
vibration = permission.isVibrationEnabled() == null
? false
: permission.isVibrationEnabled();
accsibility = mediaQueryData.accessibleNavigation;
setTheme(blindValue);
}
}
getTheme(value) async {
if (value == 1) {
return ThemeData(
// fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
);
return invertThemes();
} else if (value == 3) {
return ThemeData(
// fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.black45,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
);
return bwThemes();
} else {
return ThemeData(
//fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.white,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9),
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
cardColor: Colors.white,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Color(0xff40ACC9),
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Color(0xff40ACC9),
),
),
);
return defaultTheme(
fontName:
Provider.of<ProjectViewModel>(context, listen: false).isArabic
? 'Cairo'
: 'WorkSans');
}
}
}

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart';
class ProfileSettings extends StatefulWidget {
@override
_ProfileSettings createState() => _ProfileSettings();
}
@ -45,6 +44,7 @@ class _ProfileSettings extends State<ProfileSettings>
child: model.user != null
? ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -74,7 +74,7 @@ class _ProfileSettings extends State<ProfileSettings>
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
@ -93,7 +93,7 @@ class _ProfileSettings extends State<ProfileSettings>
],
)),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
@ -116,7 +116,7 @@ class _ProfileSettings extends State<ProfileSettings>
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
@ -136,7 +136,7 @@ class _ProfileSettings extends State<ProfileSettings>
],
)),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
@ -160,7 +160,7 @@ class _ProfileSettings extends State<ProfileSettings>
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
@ -175,7 +175,7 @@ class _ProfileSettings extends State<ProfileSettings>
],
)),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
@ -190,7 +190,7 @@ class _ProfileSettings extends State<ProfileSettings>
],
)),
Container(
color: Colors.white,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(

@ -51,7 +51,8 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
controller: _tabController,
),
title: Text(TranslationBase.of(context).settings,
style: TextStyle(color: Colors.white)),
style:
TextStyle(color: Theme.of(context).textTheme.bodyText2.color)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();

@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
class CustomColors {
static const Color lightPurple = Color(0xFFBB86FA);
static const Color purple = Color(0xFF6002EE);
static const Color deepPurple = Color(0xFF3900B1);
static const Color grey = Color(0xFF848484);
static const Color darkGrey = Color(0xFF222222);
static const Color black = Color(0xFF141414);
static const Color white = Color(0xFFFFFFFF);
}

@ -0,0 +1,3 @@
// import 'package:diplomaticquarterapp/theme/custom_theme.dart';
// CustomTheme currentTheme = CustomTheme();

@ -0,0 +1,89 @@
// import 'package:diplomaticquarterapp/Constants.dart';
// import 'package:flutter/material.dart';
// import 'package:hexcolor/hexcolor.dart';
// import 'colors.dart';
// class CustomTheme with ChangeNotifier {
// static bool _isDarkTheme = true;
// ThemeMode get currentTheme =>
// _isDarkTheme ? ThemeMode.dark : ThemeMode.system;
// void toggleTheme() {
// _isDarkTheme = !_isDarkTheme;
// notifyListeners();
// }
// static ThemeData get lightTheme {
// //1
// return ThemeData(
// //2
// primaryColor: CustomColors.purple,
// scaffoldBackgroundColor: Colors.white,
// fontFamily: 'Montserrat', //3
// buttonTheme: ButtonThemeData(
// // 4
// shape:
// RoundedRectangleBorder(borderRadius: BorderRadius.circular(18.0)),
// buttonColor: CustomColors.lightPurple,
// ));
// }
// static ThemeData get darkTheme {
// return ThemeData(
// primaryColor: CustomColors.darkGrey,
// scaffoldBackgroundColor: Colors.black,
// fontFamily: 'Montserrat',
// textTheme: ThemeData.dark().textTheme,
// buttonTheme: ButtonThemeData(
// shape:
// RoundedRectangleBorder(borderRadius: BorderRadius.circular(18.0)),
// buttonColor: CustomColors.lightPurple,
// ));
// }
// static ThemeData get defaultTheme {
// return ThemeData(
// // fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// textTheme: TextTheme(
// headline1: TextStyle(
// color: Color(0xffB8382C),
// ),
// ),
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Color.fromRGBO(255, 255, 255, 1),
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff515A5D),
// toggleableActiveColor: secondaryColor,
// indicatorColor: secondaryColor,
// bottomSheetTheme:
// BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
// cursorColor: Colors.grey,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff515A5D),
// brightness: Brightness.light,
// elevation: 0.0,
// actionsIconTheme: IconThemeData(
// color: Colors.grey[800],
// ),
// ),
// );
// }
// }

@ -1,15 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
class ThemeNotifier with ChangeNotifier {
ThemeData _themeData = defaultTheme;
ThemeData _themeData;
ThemeNotifier(this._themeData);
getTheme() => _themeData;
setTheme(ThemeData themeData) async {
_themeData = themeData;
notifyListeners();
}
}

@ -1,9 +1,8 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
/// ---- Default Theme ----
@ -13,11 +12,11 @@ import 'package:provider/provider.dart';
final bluePrimary = Color(0xFF3F51B5);
final blueAccent = Color(0xFFFF9800);
final blueBackground = Color(0xFFFFFFFF);
defaultTheme({fontName}) {
return ThemeData(
fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans',
// ProjectViewModel projectProvider = Provider.of(AppGlobal.context);
final bwTheme = ThemeData(
//fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
@ -27,37 +26,92 @@ final blueBackground = Color(0xFFFFFFFF);
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
primaryColor: Color(0xffffffff),
toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey,
primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)),
iconTheme: IconThemeData(),
textTheme: TextTheme(
bodyText1: TextStyle(color: Colors.black),
headline1: TextStyle(color: Colors.white),
),
appBarTheme: AppBarTheme(
color: Color(0xff515A5D),
brightness: Brightness.light,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],
),
),
);
}
invertThemes({fontName}) {
return ThemeData(
fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.dark,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
textTheme: TextTheme(
bodyText1: TextStyle(color: Colors.white),
headline1: TextStyle(color: Colors.white),
),
disabledColor: Colors.grey[800],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xff000000), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.black,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.black,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.black45,
color: Color(0xff000000),
brightness: Brightness.dark,
elevation: 10.0,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
color: Colors.grey[800],
),
),
);
}
final defaultTheme = ThemeData(
//fontFamily: ProjectViewModel().isArabic? 'Cairo' : 'WorkSans',
bwThemes({fontName}) {
return ThemeData(
fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
brightness: Brightness.dark,
unselectedWidgetColor: Colors.red,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
@ -65,35 +119,50 @@ final blueBackground = Color(0xFFFFFFFF);
},
),
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
textTheme: TextTheme(
bodyText1: TextStyle(color: Colors.red[900]),
headline1: TextStyle(color: Colors.red[900]),
bodyText2: TextStyle(color: Colors.red[900]),
subtitle1: TextStyle(color: Colors.red[900]),
),
tabBarTheme: TabBarTheme(labelColor: Colors.red[900]),
disabledColor: Colors.grey[800],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),
scaffoldBackgroundColor: Color(0xffffffe4), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.white,
canvasColor: Colors.black,
backgroundColor: Color(0xffffffe4),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
cardColor: Colors.white,
primaryColor: Color(0xfffffff4),
toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme:
BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.black,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Color(0xff40ACC9),
color: Color(0xffffffe4),
brightness: Brightness.dark,
elevation: 10.0,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Color(0xff40ACC9),
color: Colors.grey[800],
),
),
);
}
final invertTheme = ThemeData(
//fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
dimTheme({fontName}) {
return ThemeData(
fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
brightness: Brightness.dark,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
@ -101,29 +170,26 @@ final blueBackground = Color(0xFFFFFFFF);
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
scaffoldBackgroundColor: Color(0xffEEEEEE),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey,
color: Color(0xff40ACC9),
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
color: Color(0xff40ACC9),
),
),
);
}

@ -230,7 +230,8 @@ class _TextsState extends State<Texts> {
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.variant == "overline" ? 1 : null,
fontWeight: widget.fontWeight ?? _getFontWeight(),
),
fontFamily:
projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
),
if (widget.readMore && text.length > widget.maxLength && hidden)
Positioned(

@ -344,6 +344,16 @@ class _AppDrawerState extends State<AppDrawer> {
login();
},
),
// InkWell(
// child: DrawerItem(
// TranslationBase.of(context).appsetting,
// Icons.settings_input_composite),
// onTap: () {
// Navigator.of(context).pushNamed(
// SETTINGS,
// );
// },
// )
],
)
],

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart';
///
@ -15,8 +16,8 @@ class DrawerItem extends StatefulWidget {
final bool sideArrow;
final Widget count;
DrawerItem(this.title, this.icon,
{this.textColor = Colors.black,
this.iconColor = Colors.black87,
{this.textColor,
this.iconColor,
this.subTitle = '',
this.bottomLine = true,
this.count,
@ -48,7 +49,9 @@ class _DrawerItemState extends State<DrawerItem> {
flex: 1,
child: Icon(
widget.icon,
color: widget.iconColor,
color: widget.iconColor == null
? Theme.of(context).textTheme.bodyText1.color
: widget.iconColor,
size: SizeConfig.imageSizeMultiplier * 5,
)),
Expanded(
@ -59,18 +62,16 @@ class _DrawerItemState extends State<DrawerItem> {
children: <Widget>[
Row(
children: [
Texts(
AppText(
widget.title,
color: widget.textColor,
fontSize: SizeConfig.textMultiplier * 2.3,
),
widget.count ?? SizedBox(),
],
),
widget.subTitle != ''
? Texts(
? AppText(
widget.subTitle,
color: widget.textColor,
fontSize: SizeConfig.textMultiplier * 2.5,
)
: SizedBox(),

@ -148,7 +148,9 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
backgroundColor:
isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
headline6: TextStyle(
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
),
title: Text(
authenticatedUserObject.isLogin || !isShowDecPage
@ -156,7 +158,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
: TranslationBase.of(context).serviceInformationTitle,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder(
builder: (BuildContext context) {
@ -168,14 +170,14 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/'));
})
: Container(),
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
color: Theme.of(context).textTheme.headline1.color,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,

@ -16,7 +16,8 @@ class ArrowBack extends StatelessWidget {
onTap: Feedback.wrapForTap(() {
onTap != null ? onTap() : Navigator.pop(context);
}, context),
child: Icon(Icons.arrow_back_ios, color: Colors.white),
child: Icon(Icons.arrow_back_ios,
color: Theme.of(context).textTheme.headline1.color),
);
}
}

@ -1017,13 +1017,20 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
Expanded(
flex: 1,
child: Center(
child: Text(searchText != null && searchText != 'null'
child: Image.asset(
'assets/images/soundWaveAnimation.gif',
height: 75,
))),
Expanded(
flex: 1,
child: Center(
child: AppText(searchText != null && searchText != 'null'
? searchText
: TranslationBase.of(context).trySaying))),
searchText == 'null'
? Center(
child: RaisedButton(
child: Text('Retry'),
child: AppText('Retry'),
onPressed: () {
RoboSearch.closeAlertDialog(context);
event.setValue({'startPopUp': 'true'});

@ -9,6 +9,8 @@ import 'dart:math';
import 'package:provider/provider.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
class SMSOTP {
final type;
final mobileNo;
@ -52,9 +54,10 @@ class SMSOTP {
String errorMsg;
ProjectViewModel projectProvider;
String displayTime = '';
String _code;
dynamic setState;
static String signature;
displayDialog(BuildContext context) async {
return showDialog(
context: context,
builder: (context) {
@ -78,10 +81,11 @@ class SMSOTP {
if (displayTime == '') {
startTimer(setState);
}
return Container(
color: Colors.white,
height: SizeConfig.realScreenHeight * 0.5,
width: SizeConfig.realScreenWidth * 0.8,
width: SizeConfig.realScreenWidth,
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -99,121 +103,151 @@ class SMSOTP {
.substring(mobileNo.toString().length - 3),
textAlign: TextAlign.center,
)),
Form(
key: verifyAccountForm,
child: Padding(
padding: EdgeInsets.only(top: 20),
child: Directionality(
Directionality(
textDirection: TextDirection.ltr,
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
textInputAction: TextInputAction.next,
style: buildTextStyle(),
autofocus: true,
maxLength: 1,
controller: digit1,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
validator: validateCodeDigit,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusD2);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD2);
verifyAccountFormValue['digit1'] =
val.trim();
checkValue();
}
},
),
child: TextFieldPin(
filled: true,
filledColor: Colors.grey[100],
codeLength: 4,
filledAfterTextChange: true,
boxSize: 50,
margin: 10,
borderStyeAfterTextChange: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD2,
textInputAction: TextInputAction.next,
maxLength: 1,
controller: digit2,
textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD3);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD3);
verifyAccountFormValue['digit2'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit),
borderStyle: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD3,
textInputAction: TextInputAction.next,
maxLength: 1,
controller: digit3,
textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD4);
verifyAccountFormValue['digit3'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit)),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD4,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
controller: digit4,
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
verifyAccountFormValue['digit4'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit)),
],
onOtpCallback: (code, isAutofill) =>
_onOtpCallBack(code, isAutofill),
)),
),
),
// Form(
// key: verifyAccountForm,
// child: Padding(
// padding: EdgeInsets.only(top: 20),
// child: Directionality(
// textDirection: TextDirection.ltr,
// child:
// // Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: <Widget>[
// Container(
// child: ,
// )
// Container(
// width: SizeConfig.realScreenWidth * 0.15,
// child: TextFormField(
// textInputAction: TextInputAction.next,
// style: buildTextStyle(),
// autofocus: true,
// maxLength: 1,
// controller: digit1,
// textAlign: TextAlign.center,
// keyboardType: TextInputType.number,
// decoration: buildInputDecoration(context),
// onSaved: (val) {},
// validator: validateCodeDigit,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(focusD2);
// },
// onChanged: (val) {
// if (val.length == 1) {
// FocusScope.of(context)
// .requestFocus(focusD2);
// verifyAccountFormValue['digit1'] =
// val.trim();
// checkValue();
// }
// },
// ),
// ),
// Container(
// width: SizeConfig.realScreenWidth * 0.15,
// child: TextFormField(
// focusNode: focusD2,
// textInputAction: TextInputAction.next,
// maxLength: 1,
// controller: digit2,
// textAlign: TextAlign.center,
// style: buildTextStyle(),
// keyboardType: TextInputType.number,
// decoration: buildInputDecoration(context),
// onSaved: (val) {},
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(focusD3);
// },
// onChanged: (val) {
// if (val.length == 1) {
// FocusScope.of(context)
// .requestFocus(focusD3);
// verifyAccountFormValue['digit2'] =
// val.trim();
// checkValue();
// }
// },
// validator: validateCodeDigit),
// ),
// Container(
// width: SizeConfig.realScreenWidth * 0.15,
// child: TextFormField(
// focusNode: focusD3,
// textInputAction: TextInputAction.next,
// maxLength: 1,
// controller: digit3,
// textAlign: TextAlign.center,
// style: buildTextStyle(),
// keyboardType: TextInputType.number,
// decoration:
// buildInputDecoration(context),
// onSaved: (val) {},
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(focusD4);
// },
// onChanged: (val) {
// if (val.length == 1) {
// FocusScope.of(context)
// .requestFocus(focusD4);
// verifyAccountFormValue['digit3'] =
// val.trim();
// checkValue();
// }
// },
// validator: validateCodeDigit)),
// Container(
// width: SizeConfig.realScreenWidth * 0.15,
// child: TextFormField(
// focusNode: focusD4,
// maxLength: 1,
// textAlign: TextAlign.center,
// style: buildTextStyle(),
// controller: digit4,
// keyboardType: TextInputType.number,
// decoration:
// buildInputDecoration(context),
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(focusD4);
// },
// onChanged: (val) {
// if (val.length == 1) {
// verifyAccountFormValue['digit4'] =
// val.trim();
// checkValue();
// }
// },
// validator: validateCodeDigit)),
// ],
//)),
//),
//),
SizedBox(height: 20),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
@ -274,9 +308,11 @@ class SMSOTP {
checkValue() {
//print(verifyAccountFormValue);
if (verifyAccountForm.currentState.validate()) {
onSuccess(digit1.text.toString()+digit2.text.toString()+digit3.text.toString()+digit4.text.toString());
onSuccess(digit1.text.toString() +
digit2.text.toString() +
digit3.text.toString() +
digit4.text.toString());
}
}
getSecondsAsDigitalClock(int inputSeconds) {
@ -311,7 +347,7 @@ class SMSOTP {
static void showLoadingDialog(BuildContext context, bool _loading) async {
_context = context;
//setSignature();
if (_loading == false) {
Navigator.of(context).pop();
return;
@ -338,4 +374,14 @@ class SMSOTP {
static void hideSMSBox(context) {
Navigator.pop(context);
}
_onOtpCallBack(String otpCode, bool isAutofill) {
if (otpCode.length == 4) {
onSuccess(otpCode);
}
}
static getSignature() async {
return await SmsRetrieved.getAppSignature();
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// OWNER : Ibrahim albitar
// DATE : 12-04-2020
@ -22,7 +24,7 @@ class AppText extends StatefulWidget {
final Color backGroundcolor;
final bool underline;
AppText(this.data,
{this.color = Colors.black,
{this.color,
this.fontWeight = FontWeight.normal,
this.fontSize,
// this.fontFamily = 'WorkSans',
@ -44,6 +46,7 @@ class AppText extends StatefulWidget {
class _AppTextState extends State<AppText> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Visibility(
visible: widget.visibility,
child: Container(
@ -59,10 +62,16 @@ class _AppTextState extends State<AppText> {
textAlign: widget.textAlign,
overflow: TextOverflow.clip,
style: TextStyle(
color: widget.color,
color: widget.color == null
? Theme.of(context).textTheme.bodyText1.color
: widget.color,
fontWeight: widget.fontWeight,
fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2),
fontFamily: widget.fontFamily,
fontFamily: widget.fontFamily == null
? projectViewModel.isArabic
? 'Cairo'
: 'WorkSans'
: widget.fontFamily,
decoration: widget.underline == true
? TextDecoration.underline
: TextDecoration.none

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart';
class TyperAnimatedTextKit extends StatefulWidget {
@ -64,9 +65,9 @@ class _TyperState extends State<TyperAnimatedTextKit>
animation: _characterCount,
builder: (BuildContext context, Widget child) {
String text = widget.text.substring(0, _characterCount.value);
return Text(
return AppText(
text,
style: TextStyle(color: Colors.black, fontSize: 12),
fontSize: 12,
textAlign: TextAlign.start,
);
},

@ -87,7 +87,7 @@ dependencies:
# Qr code Scanner TODO fix it
# barcode_scanner: ^1.0.1
barcode_scan: any
barcode_scan: ^2.0.0
flutter_polyline_points: ^0.1.0
location: ^2.3.5
# Qr code Scanner
@ -169,7 +169,7 @@ dependencies:
flutter_tts:
path: flutter_tts-voice_enhancement
# flutter_tts: ^1.2.6
sms_otp_auto_verify: ^1.2.2
wifi: ^0.1.5
vibration: ^1.7.3

Loading…
Cancel
Save