-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from shuence/Screen-Responsive-and-BottomBar
Added Share Food Cards Feature
- Loading branch information
Showing
41 changed files
with
2,380 additions
and
782 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:spoonshare/screens/main_bottom_nav/bloc/main_bottom_nav_bloc.dart'; | ||
|
||
class CommonBloc { | ||
/// Bloc | ||
static final bottomNavBloc = MainBottomNavBloc(); | ||
|
||
static final List<BlocProvider> blocProviders = [ | ||
BlocProvider<MainBottomNavBloc>( | ||
create: (context) => bottomNavBloc, | ||
), | ||
]; | ||
|
||
/// Dispose | ||
static void dispose() { | ||
bottomNavBloc.close(); | ||
} | ||
|
||
static void resetBlocs() { | ||
// bottomNavBloc.add(ResetAuthentication()); | ||
} | ||
|
||
/// Singleton factory | ||
static final CommonBloc _instance = CommonBloc._internal(); | ||
|
||
factory CommonBloc() { | ||
return _instance; | ||
} | ||
|
||
CommonBloc._internal(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AppColors { | ||
static Color basePrimaryColor = const Color(0xffFF9F1C); | ||
static Color kWhiteColor = const Color(0xffFFFFFF); | ||
static Color kBlackColor = const Color(0xff000000); | ||
static Color kGreenColor = const Color(0xff32B046); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'app_colors.dart'; | ||
export 'app_images.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class AppImages { | ||
static String spoonShareLogo = "assets/images/spoonshare.png"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,67 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:firebase_core/firebase_core.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:spoonshare/firebase_options.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
import 'package:spoonshare/services/notifications_services.dart'; | ||
import 'package:spoonshare/splash_screen.dart'; | ||
import 'package:device_preview/device_preview.dart'; | ||
import 'common_blocs/common_blocs.dart'; | ||
|
||
final navigatorKey = GlobalKey<NavigatorState>(); | ||
|
||
void main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
await Firebase.initializeApp( | ||
options: DefaultFirebaseOptions.currentPlatform, | ||
); | ||
NotificationServices().firebaseInit(); | ||
await SharedPreferences.getInstance(); | ||
|
||
runApp( | ||
DevicePreview( | ||
enabled: !kReleaseMode, | ||
enabled: !kReleaseMode, | ||
builder: (context) => const MyApp(), | ||
), | ||
); | ||
} | ||
|
||
class MyApp extends StatelessWidget { | ||
class MyApp extends StatefulWidget { | ||
const MyApp({Key? key}) : super(key: key); | ||
|
||
@override | ||
State<MyApp> createState() => _MyAppState(); | ||
} | ||
|
||
NavigatorState? get _navigator => navigatorKey.currentState; | ||
|
||
onNavigateSplash() { | ||
_navigator!.pushAndRemoveUntil(MaterialPageRoute(builder: (context) { | ||
return const SplashScreen(); | ||
}), (route) => false); | ||
} | ||
|
||
class _MyAppState extends State<MyApp> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return ScreenUtilInit( | ||
designSize: const Size(360, 700), | ||
minTextAdapt: true, | ||
splitScreenMode: true, | ||
builder: (_, child) { | ||
return MaterialApp( | ||
return MultiBlocProvider( | ||
providers: CommonBloc.blocProviders, | ||
child: ScreenUtilInit( | ||
designSize: const Size(360, 800), | ||
minTextAdapt: true, | ||
splitScreenMode: true, | ||
child: MaterialApp( | ||
navigatorKey: navigatorKey, | ||
debugShowCheckedModeBanner: false, | ||
title: 'Spoon Share', | ||
theme: ThemeData( | ||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.orange), | ||
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xffFF9F1C)), | ||
useMaterial3: true, | ||
), | ||
home: child, | ||
); | ||
}, | ||
child: const SplashScreen(), | ||
home: const SplashScreen(), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,4 +92,6 @@ class UserProfile { | |
String getOrganisation() { | ||
return organisation; | ||
} | ||
|
||
void cancelStreams() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.