diff --git a/bu_passport/android/app/build.gradle b/bu_passport/android/app/build.gradle index 3c01355..50b3699 100644 --- a/bu_passport/android/app/build.gradle +++ b/bu_passport/android/app/build.gradle @@ -49,6 +49,7 @@ android { targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + multiDexEnabled true } buildTypes { @@ -64,4 +65,6 @@ flutter { source '../..' } -dependencies {} +dependencies { + implementation 'androidx.multidex:multidex:2.0.1' +} diff --git a/bu_passport/assets/images/onboarding/BU art logo.png b/bu_passport/assets/images/onboarding/BU art logo.png new file mode 100644 index 0000000..5fa9811 Binary files /dev/null and b/bu_passport/assets/images/onboarding/BU art logo.png differ diff --git a/bu_passport/assets/images/onboarding/carousel1.svg b/bu_passport/assets/images/onboarding/carousel1.svg new file mode 100644 index 0000000..424b0cb --- /dev/null +++ b/bu_passport/assets/images/onboarding/carousel1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/bu_passport/assets/images/onboarding/onboarding1.png b/bu_passport/assets/images/onboarding/onboarding1.png new file mode 100644 index 0000000..6d67cbc Binary files /dev/null and b/bu_passport/assets/images/onboarding/onboarding1.png differ diff --git a/bu_passport/assets/images/onboarding/onboarding2.png b/bu_passport/assets/images/onboarding/onboarding2.png new file mode 100644 index 0000000..2a6180b Binary files /dev/null and b/bu_passport/assets/images/onboarding/onboarding2.png differ diff --git a/bu_passport/assets/images/onboarding/onboarding3.png b/bu_passport/assets/images/onboarding/onboarding3.png new file mode 100644 index 0000000..d989746 Binary files /dev/null and b/bu_passport/assets/images/onboarding/onboarding3.png differ diff --git a/bu_passport/assets/images/onboarding/onboarding4.png b/bu_passport/assets/images/onboarding/onboarding4.png new file mode 100644 index 0000000..b962402 Binary files /dev/null and b/bu_passport/assets/images/onboarding/onboarding4.png differ diff --git a/bu_passport/assets/images/onboarding/onboarding5.png b/bu_passport/assets/images/onboarding/onboarding5.png new file mode 100644 index 0000000..9811e3b Binary files /dev/null and b/bu_passport/assets/images/onboarding/onboarding5.png differ diff --git a/bu_passport/lib/auth/auth_gate.dart b/bu_passport/lib/auth/auth_gate.dart index 1c5b3cc..57ce9df 100644 --- a/bu_passport/lib/auth/auth_gate.dart +++ b/bu_passport/lib/auth/auth_gate.dart @@ -1,8 +1,9 @@ +import 'package:bu_passport/pages/onboarding_page.dart'; import 'package:bu_passport/main.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; - import '../pages/navigation_page.dart'; +import '../pages/home_page.dart'; import '../pages/login_page.dart'; class AuthGate extends StatelessWidget { @@ -10,16 +11,16 @@ class AuthGate extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: StreamBuilder( - stream: FirebaseAuth.instance.authStateChanges(), - builder: (context, snapshot) { - if (snapshot.hasData) { - return const NavigationPage(); - } else { - return const LoginPage(); - } - }, - ), - ); + body: StreamBuilder( + stream: FirebaseAuth.instance.authStateChanges(), + builder: (context, snapshot) { + if (snapshot.hasData) { + return const NavigationPage(); + } else { + return const OnboardingPage(); + } + }, + )); + } } diff --git a/bu_passport/lib/main.dart b/bu_passport/lib/main.dart index e3aa2fc..72c3612 100644 --- a/bu_passport/lib/main.dart +++ b/bu_passport/lib/main.dart @@ -4,6 +4,7 @@ import 'package:bu_passport/pages/login_page.dart'; import 'package:bu_passport/pages/calendar_page.dart'; import 'package:bu_passport/pages/profile_page.dart'; import 'package:bu_passport/pages/signup_page.dart'; +import 'package:bu_passport/pages/onboarding_page.dart'; import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; import 'auth/auth_gate.dart'; @@ -28,6 +29,7 @@ class MyApp extends StatelessWidget { ), home: const AuthGate(), routes: { + '/onboarding' : (context) => const OnboardingPage(), '/login': (context) => const LoginPage(), '/signup': (context) => const SignUpPage(), }, diff --git a/bu_passport/lib/pages/onboarding_page.dart b/bu_passport/lib/pages/onboarding_page.dart new file mode 100644 index 0000000..63c8bae --- /dev/null +++ b/bu_passport/lib/pages/onboarding_page.dart @@ -0,0 +1,157 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +class OnboardingPage extends StatefulWidget { + const OnboardingPage({Key? key}) : super(key: key); + @override + State createState() => _OnboardingPageState(); +} + +class _OnboardingPageState extends State { + final PageController _pageController = PageController(initialPage: 0); + int _currentPage = 0; + + List _pages = [ + OnboardingPageWidget( + image: Image.asset("assets/images/onboarding/onboarding1.png", fit: BoxFit.contain), + title: "Attend events", + description: "When you attend an event, make sure to check in with our app! A pop-up will appear with the options to check-in with a photo for 25 points, check-in without a photo for 20 points, or to let us know you are not attending.", + color: Colors.white, + ), + OnboardingPageWidget( + image: Image.asset("assets/images/onboarding/onboarding2.png", fit: BoxFit.contain), + title: "Collect Stickers", + description: "Every event you attend can give you up to 2 stickers. Different events mean more chances for new stickers. Try to collect all 9 stickers and complete your collection! A completed collection earns you 5 points.", + color: Colors.white, + ), + OnboardingPageWidget( + image: Image.asset("assets/images/onboarding/onboarding3.png", fit: BoxFit.contain), + title: "Make new friends", + description: "Friends can add you with your unique QR code, or you can add them by scanning theirs! You can check out their public reviews, and they can check yours. ", + color: Colors.white, + ), + OnboardingPageWidget( + image: Image.asset("assets/images/onboarding/onboarding4.png", fit: BoxFit.contain), + title: "Leave Feedback", + description: "After attending an event, leave a review for 5 points! Tell us about how you felt about it, any feedback, or anything at all! Reviews can be private or can be made public on your profile page.", + color: Colors.white, + ), + OnboardingPageWidget( + image: Image.asset("assets/images/onboarding/onboarding5.png", fit: BoxFit.contain), + title: "Your Passport", + description: "Your passport is your personal catalog of every event that you have attended with us. Look back on your past attendances, all of your reviews, and your sticker collection.", + color: Colors.white, + ), + ]; + + void _nextPage() { + if (_currentPage < _pages.length - 1) { + _pageController.nextPage( + duration: Duration(milliseconds: 400), + curve: Curves.easeInOut, + ); + } else { + // Navigate to your main application screen or perform another action here + Navigator.pushNamed(context, '/login'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Center( + child: Image.asset( + "assets/images/onboarding/BU art logo.png", + width: 281, + fit: BoxFit.contain, + ), + ), + ), + body: Stack( + children: [ + PageView( + controller: _pageController, + onPageChanged: (int page) { + setState(() { + _currentPage = page; + }); + }, + children: _pages, + ), + Positioned( + bottom: 10, + left: 0, + right: 0, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate( + 5, // Number of pages + (int index) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + height: 10, + width: _currentPage == index ? 30 : 10, + margin: EdgeInsets.symmetric(horizontal: 5, vertical: 30), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: _currentPage == index ? Colors.blue : Colors.grey.withOpacity(0.5), + ), + ); + } + ) + ) + ) + ], + ), + bottomNavigationBar: BottomAppBar( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // This aligns the children to both ends + children: [ + TextButton( + onPressed: () { + Navigator.pushNamed(context, '/login'); + }, + child: Text("Skip", style: TextStyle(fontSize: 20),), + ), + TextButton( + onPressed: _nextPage, + child: Text("Next", style: TextStyle(fontSize: 20),), + ) + ], + ), + ), + ); + } +} + + +class OnboardingPageWidget extends StatelessWidget { + final Image image; + final String title; + final String description; + final Color color; + + const OnboardingPageWidget({ + required this.image, + required this.title, + required this.description, + required this.color, + }); + + @override + Widget build(BuildContext context) { + return Container( + color: color, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image(image: image.image), + Text(title, style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold)), + SizedBox(height: 20), + Text(description, textAlign: TextAlign.center), + ], + ), + ); + } +} \ No newline at end of file diff --git a/bu_passport/pubspec.yaml b/bu_passport/pubspec.yaml index 4464cc4..0b8b619 100644 --- a/bu_passport/pubspec.yaml +++ b/bu_passport/pubspec.yaml @@ -66,7 +66,8 @@ flutter: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg - + assets: + - assets/images/onboarding/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware