diff --git a/packages/simplex_app/lib/constants.dart b/packages/simplex_app/lib/constants.dart index 8a7234fe4a..bf0a3d4826 100644 --- a/packages/simplex_app/lib/constants.dart +++ b/packages/simplex_app/lib/constants.dart @@ -9,11 +9,13 @@ const TextStyle kHeadingStyle = TextStyle( fontSize: 28.0, fontWeight: FontWeight.bold, letterSpacing: 1.3, + color: kPrimaryColor, ); const TextStyle kMediumHeadingStyle = TextStyle( fontSize: 20.0, fontWeight: FontWeight.w500, + color: kPrimaryColor, ); const TextStyle kSmallHeadingStyle = TextStyle( diff --git a/packages/simplex_app/lib/main.dart b/packages/simplex_app/lib/main.dart index c5dae2b77b..c587ff42a7 100644 --- a/packages/simplex_app/lib/main.dart +++ b/packages/simplex_app/lib/main.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:simplex_chat/app_routes.dart'; import 'package:simplex_chat/constants.dart'; import 'package:simplex_chat/custom_scroll_behavior.dart'; +import 'package:simplex_chat/providers/drawer_providers.dart'; import 'package:simplex_chat/views/contacts/add_contact_view.dart'; import 'package:simplex_chat/views/group/add_group_view.dart'; import 'package:simplex_chat/views/onboarding/intro_view.dart'; @@ -22,26 +24,33 @@ class MyApp extends StatelessWidget { primarySwatch: Colors.teal, primaryColor: kPrimaryColor, ); - return MaterialApp( - debugShowCheckedModeBanner: false, - title: 'SimpleX Chat', - theme: theme.copyWith( - colorScheme: theme.colorScheme.copyWith(secondary: kPrimaryColor), + return MultiProvider( + providers: [ + ChangeNotifierProvider(create: (_) => DrawerProvider()), + ], + child: Consumer( + builder: (context, drawerProvider, chidl) => MaterialApp( + debugShowCheckedModeBanner: false, + title: 'SimpleX Chat', + theme: theme.copyWith( + colorScheme: theme.colorScheme.copyWith(secondary: kPrimaryColor), + ), + builder: (context, widget) { + return ScrollConfiguration( + behavior: const ScrollBehaviorModified(), + child: widget!, + ); + }, + initialRoute: AppRoutes.intro, + routes: { + AppRoutes.intro: (_) => const IntroView(), + AppRoutes.setupProfile: (_) => const SetupProfileView(), + AppRoutes.addContact: (_) => const AddContactView(), + AppRoutes.scanInvitation: (_) => const ScanInvitationView(), + AppRoutes.addGroup: (_) => const AddGroupView(), + }, + ), ), - builder: (context, widget) { - return ScrollConfiguration( - behavior: const ScrollBehaviorModified(), - child: widget!, - ); - }, - initialRoute: AppRoutes.intro, - routes: { - AppRoutes.intro: (_) => const IntroView(), - AppRoutes.setupProfile: (_) => const SetupProfileView(), - AppRoutes.addContact: (_) => const AddContactView(), - AppRoutes.scanInvitation: (_) => const ScanInvitationView(), - AppRoutes.addGroup: (_) => const AddGroupView(), - }, ); } } diff --git a/packages/simplex_app/pubspec.lock b/packages/simplex_app/pubspec.lock index de7131a035..9aa333d169 100644 --- a/packages/simplex_app/pubspec.lock +++ b/packages/simplex_app/pubspec.lock @@ -191,6 +191,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" path: dependency: transitive description: @@ -268,6 +275,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.3" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.1" qr_code_scanner: dependency: "direct main" description: diff --git a/packages/simplex_app/pubspec.yaml b/packages/simplex_app/pubspec.yaml index 12282b1020..34209e26c5 100644 --- a/packages/simplex_app/pubspec.yaml +++ b/packages/simplex_app/pubspec.yaml @@ -38,14 +38,15 @@ dependencies: # QR Code qr_code_scanner: ^0.5.2 - # svg + # for placing svg flutter_svg: ^0.22.0 # attachments image_picker: ^0.7.5+3 file_picker: ^3.0.2+2 - # for local storage + # state management + provider: ^6.0.1 shared_preferences: ^2.0.8 # share