diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index e0204dd4..d907f658 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -58,55 +58,59 @@ class _HomePageWidgetState extends State { drawerEnableOpenDragGesture: true, drawerDragStartBehavior: DragStartBehavior.start, drawer: CustomDrawer(model: _model), - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primary, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState!.openDrawer(); - }, - ), - title: Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.asset( - 'assets/images/logo.png', - width: 15.0, - height: 15.0, - fit: BoxFit.cover, - ), - ), - Text( - 'FRE ACCESS', - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ].divide(const SizedBox(width: 8.0)), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), + appBar: buildAppBar(context), body: buildPage(context), ); } + AppBar buildAppBar(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primary, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState!.openDrawer(); + }, + ), + title: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.asset( + 'assets/images/logo.png', + width: 15.0, + height: 15.0, + fit: BoxFit.cover, + ), + ), + Text( + 'FRE ACCESS', + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ].divide(const SizedBox(width: 8.0)), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ); + } + Container buildPage(BuildContext context) { return Container( decoration: BoxDecoration( diff --git a/lib/shared/utils/storage_util.dart b/lib/shared/utils/storage_util.dart index f59af57e..72c7ac18 100644 --- a/lib/shared/utils/storage_util.dart +++ b/lib/shared/utils/storage_util.dart @@ -33,9 +33,9 @@ class StorageUtil { StorageUtil._internal(); - late final SQLiteStorageHelper _sqliteStorage; - late final SecureStorageHelper _secureStorage; - late final SharedPreferencesStorageHelper _sharedPreferences; + late SQLiteStorageHelper _sqliteStorage; + late SecureStorageHelper _secureStorage; + late SharedPreferencesStorageHelper _sharedPreferences; bool _initialized = true; static Future set(StorageData data) async { @@ -122,6 +122,9 @@ class StorageUtil { log('StorageUtil: Starting initialization'); if (!_initialized) return true; if (_initialized) await SharedPreferencesStorageHelper().initialize(); + if (_initialized) _secureStorage = SecureStorageHelper(); + if (_initialized) _sqliteStorage = SQLiteStorageHelper(); + if (_initialized) _sqliteStorage = SQLiteStorageHelper(); await initSecureStorage(); await initSharedPreferences(); await initSQLiteStorage();