Skip to content

Commit

Permalink
Journey challenges navbar (#145)
Browse files Browse the repository at this point in the history
* Finished top navigation bar and added fonts

* Fixed typo

* Podfile Update

* Updated Cocoapods and fixed dependencies

* Name change and new color palette

* Fixed path causing build to fail
  • Loading branch information
cgu2020 authored Feb 7, 2024
1 parent 81c8d82 commit b81a19e
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 29 deletions.
1 change: 0 additions & 1 deletion game/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ linter:
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Binary file added game/assets/fonts/Poppins-Medium.ttf
Binary file not shown.
Binary file added game/assets/fonts/Poppins-Regular.ttf
Binary file not shown.
2 changes: 2 additions & 0 deletions game/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ target 'Runner' do
use_frameworks!
use_modular_headers!

pod 'Firebase/Analytics'

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# target 'RunnerTests' do
# inherit! :search_paths
Expand Down
116 changes: 105 additions & 11 deletions game/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,42 @@ PODS:
- Flutter
- device_info_plus (0.0.1):
- Flutter
- Firebase/Analytics (10.18.0):
- Firebase/Core
- Firebase/Core (10.18.0):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 10.18.0)
- Firebase/CoreOnly (10.18.0):
- FirebaseCore (= 10.18.0)
- FirebaseAnalytics (10.18.0):
- FirebaseAnalytics/AdIdSupport (= 10.18.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- FirebaseAnalytics/AdIdSupport (10.18.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleAppMeasurement (= 10.18.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- FirebaseCore (10.18.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.18.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.18.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- Flutter (1.0.0)
- flutter_secure_storage (6.0.0):
- Flutter
Expand All @@ -23,22 +59,66 @@ PODS:
- google_sign_in_ios (0.0.1):
- Flutter
- GoogleSignIn (~> 6.2)
- GoogleAppMeasurement (10.18.0):
- GoogleAppMeasurement/AdIdSupport (= 10.18.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- GoogleAppMeasurement/AdIdSupport (10.18.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 10.18.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- GoogleAppMeasurement/WithoutAdIdSupport (10.18.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- GoogleSignIn (6.2.4):
- AppAuth (~> 1.5)
- GTMAppAuth (~> 1.3)
- GTMSessionFetcher/Core (< 3.0, >= 1.1)
- GoogleUtilities/AppDelegateSwizzler (7.12.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.12.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.12.0):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (7.12.0):
- GoogleUtilities/Logger
- GoogleUtilities/Network (7.12.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.12.0)"
- GoogleUtilities/Reachability (7.12.0):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.12.0):
- GoogleUtilities/Logger
- GTMAppAuth (1.3.1):
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
- GTMSessionFetcher/Core (2.3.0)
- nanopb (2.30909.1):
- nanopb/decode (= 2.30909.1)
- nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.1.1):
- Flutter
- platform_device_id (0.0.1):
- Flutter
- PromisesObjC (1.2.12)
- PromisesObjC (2.3.1)
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
Expand All @@ -49,6 +129,7 @@ PODS:
DEPENDENCIES:
- device_info (from `.symlinks/plugins/device_info/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Firebase/Analytics
- Flutter (from `Flutter`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
Expand All @@ -63,10 +144,19 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- AppAuth
- Firebase
- FirebaseAnalytics
- FirebaseCore
- FirebaseCoreInternal
- FirebaseInstallations
- FMDB
- GoogleAppMeasurement
- GoogleSignIn
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- nanopb
- PromisesObjC
- Toast

EXTERNAL SOURCES:
Expand Down Expand Up @@ -94,32 +184,36 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
AppAuth: 8fca6b5563a5baef2c04bee27538025e4ceb2add

SPEC CHECKSUMS:
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
Firebase: 817b9171d0d51dccc458b94a5e8edff6b1dd323d
FirebaseAnalytics: 456f2c51599870a15ded4548d1f1f7b2cabf65a7
FirebaseCore: a6dba751680d7033b9d3831e1cfc95ead0605118
FirebaseCoreDiagnostics: 7e873baabcfaa9512f538554ae4fa0817aaafbdb
FirebaseInstallations: b69db7680870dbac17bba7a51fc0b5c4b365baa7
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
FirebaseAnalytics: 4d310b35c48eaa4a058ddc04bdca6bdb5dc0fe80
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a
FirebaseInstallations: e842042ec6ac1fd2e37d7706363ebe7f662afea4
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
google_sign_in_ios: 1256ff9d941db546373826966720b0c24804bcdd
GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e
GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
platform_device_id: 81b3e2993881f87d0c82ef151dc274df4869aef5
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86

PODFILE CHECKSUM: c37bfc8cb18efcbef5c7f6de4c2a788a4c114955
PODFILE CHECKSUM: 2cc3a9746d44df840e78b57de485ce133b368454

COCOAPODS: 1.13.0
20 changes: 20 additions & 0 deletions game/lib/color_palette.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';

class ColorPalette {
static const MaterialColor BigRed = const MaterialColor(
0xffed5656, // 0% comes in here, this will be color picked if no shade is selected when defining a Color property which doesn’t require a swatch.
const <int, Color>{
//temporarily have the same color for all gradients
50: const Color(0xffed5656), //10%
100: const Color(0xffed5656), //20%
200: const Color(0xffed5656), //30%
300: const Color(0xffed5656), //40%
400: const Color(0xffed5656), //50%
500: const Color(0xffed5656), //60%
600: const Color(0xffed5656), //70%
700: const Color(0xffed5656), //80%
800: const Color(0xffed5656), //90%
900: const Color(0xffed5656), //100%
},
);
} // you can define define int 500 as the default shade and add your lighter tints above and darker tints below.
2 changes: 1 addition & 1 deletion game/lib/details_page/details_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:game/home_page/home_page_widget.dart';
import 'package:game/main.dart';
import 'package:game/navbar.dart';
import 'package:game/navigation_page/bottom_navbar.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:game/utils/utility_functions.dart';

Expand Down
6 changes: 4 additions & 2 deletions game/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import 'package:game/model/user_model.dart';
import 'package:game/splash_page/splash_page.dart';
import 'package:game/widget/game_widget.dart';
import 'package:provider/provider.dart';
import 'navbar.dart';
import 'package:game/navigation_page/bottom_navbar.dart';
import 'package:game/color_palette.dart';

import 'dart:io' show Platform;

Expand Down Expand Up @@ -78,7 +79,8 @@ class MyApp extends StatelessWidget {
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const [Locale('en', '')],
theme: ThemeData(primarySwatch: Colors.blue),
theme: ThemeData(
fontFamily: 'Poppins', primarySwatch: ColorPalette.BigRed),
home: SplashPageWidget(),
)));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'package:game/gameplay/gameplay_page.dart';
import 'package:game/global_leaderboard/global_leaderboard_widget.dart';
import 'package:game/journeys/journeys_page.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'home_navbar.dart';

class BottomNavBar extends StatefulWidget {
const BottomNavBar({Key? key}) : super(key: key);
Expand All @@ -16,7 +15,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
static const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
static const List<Widget> _widgetOptions = <Widget>[
JourneysPage(),
HomeNavBar(),
GlobalLeaderboardWidget(),
Text(
'Profile',
Expand Down
59 changes: 59 additions & 0 deletions game/lib/navigation_page/home_navbar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:flutter/material.dart';
import 'package:game/gameplay/gameplay_page.dart';
import 'package:game/journeys/journeys_page.dart';
import 'package:google_fonts/google_fonts.dart';

class HomeNavBar extends StatefulWidget {
const HomeNavBar({super.key});

@override
State<HomeNavBar> createState() => _HomeNavbarState();
}

/// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin.
class _HomeNavbarState extends State<HomeNavBar> with TickerProviderStateMixin {
late TabController _tabController;

@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: new PreferredSize(
preferredSize: const Size.fromHeight(50.0),
child: AppBar(
backgroundColor: Color(0xFFED5656),
titleTextStyle: TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
bottom: TabBar(
dividerColor: Color.fromARGB(255, 0, 0, 0),
indicatorColor: Color(0xFFFFFFFF),
controller: _tabController,
tabs: const <Widget>[
Tab(text: 'Challenges'),
Tab(
text: 'Journeys',
),
],
),
),
),
body: TabBarView(
controller: _tabController,
children: const <Widget>[
Center(
child: GameplayPage(),
),
Center(
child: JourneysPage(),
),
],
),
);
}
}
17 changes: 6 additions & 11 deletions game/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,12 @@ flutter:
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
fonts:
- family: Poppins
fonts:
- asset: assets/fonts/Poppins-Regular.ttf
- asset: assets/fonts/Poppins-Medium.ttf
weight: 500
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

0 comments on commit b81a19e

Please sign in to comment.