diff --git a/android/app/google-services.json b/android/app/google-services.json deleted file mode 100644 index 7e97117..0000000 --- a/android/app/google-services.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "project_info": { - "project_number": "164857321043", - "firebase_url": "https://progetto-m335-default-rtdb.europe-west1.firebasedatabase.app", - "project_id": "progetto-m335", - "storage_bucket": "progetto-m335.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:164857321043:android:0a67e4973f9208721ad8a6", - "android_client_info": { - "package_name": "ch.ameti.progetto_m335_flutter" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyCh2cA5AHNIS3e1Wnf48dfoCUKvmEM9J34" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist index a4275eb..0632985 100644 --- a/ios/Runner/GoogleService-Info.plist +++ b/ios/Runner/GoogleService-Info.plist @@ -2,31 +2,36 @@ - API_KEY - AIzaSyAhEex7OfyJHETyC-uSydOFGABBn5KX16Q - GCM_SENDER_ID - 164857321043 - PLIST_VERSION - 1 - BUNDLE_ID - ch.ameti.progettoM335Flutter - PROJECT_ID - progetto-m335 - STORAGE_BUCKET - progetto-m335.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:164857321043:ios:b497e5d24254d60e1ad8a6 - DATABASE_URL - https://progetto-m335-default-rtdb.europe-west1.firebasedatabase.app + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + test-do-not-use.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.test-do-not-use + API_KEY + 000000000000000000000000000000000000000 + GCM_SENDER_ID + 999999999999 + PLIST_VERSION + 1 + BUNDLE_ID + com.google.example.BannerExample + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:999999999999:ios:0000000000000000 + DATABASE_URL + https://test-do-not-use.firebaseio.com - \ No newline at end of file + + diff --git a/lib/main.dart b/lib/main.dart index 5a0ec56..cbaaa02 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,110 +1,6 @@ -// Copyright 2021 The Flutter team. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - import 'package:flutter/material.dart'; - -import 'constants.dart'; -import 'home.dart'; +import 'myApp.dart'; void main() { - runApp( - const App(), - ); -} - -class App extends StatefulWidget { - const App({super.key}); - - @override - State createState() => _AppState(); -} - -class _AppState extends State { - bool useMaterial3 = true; - ThemeMode themeMode = ThemeMode.system; - ColorSeed colorSelected = ColorSeed.baseColor; - ColorImageProvider imageSelected = ColorImageProvider.leaves; - ColorScheme? imageColorScheme = const ColorScheme.light(); - ColorSelectionMethod colorSelectionMethod = ColorSelectionMethod.colorSeed; - - bool get useLightMode { - switch (themeMode) { - case ThemeMode.system: - return View.of(context).platformDispatcher.platformBrightness == - Brightness.light; - case ThemeMode.light: - return true; - case ThemeMode.dark: - return false; - } - } - - void handleBrightnessChange(bool useLightMode) { - setState(() { - themeMode = useLightMode ? ThemeMode.light : ThemeMode.dark; - }); - } - - void handleMaterialVersionChange() { - setState(() { - useMaterial3 = !useMaterial3; - }); - } - - void handleColorSelect(int value) { - setState(() { - colorSelectionMethod = ColorSelectionMethod.colorSeed; - colorSelected = ColorSeed.values[value]; - }); - } - - void handleImageSelect(int value) { - final String url = ColorImageProvider.values[value].url; - ColorScheme.fromImageProvider(provider: NetworkImage(url)) - .then((newScheme) { - setState(() { - colorSelectionMethod = ColorSelectionMethod.image; - imageSelected = ColorImageProvider.values[value]; - imageColorScheme = newScheme; - }); - }); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - debugShowCheckedModeBanner: false, - title: 'Material 3', - themeMode: themeMode, - theme: ThemeData( - colorSchemeSeed: colorSelectionMethod == ColorSelectionMethod.colorSeed - ? colorSelected.color - : null, - colorScheme: colorSelectionMethod == ColorSelectionMethod.image - ? imageColorScheme - : null, - useMaterial3: useMaterial3, - brightness: Brightness.light, - ), - darkTheme: ThemeData( - colorSchemeSeed: colorSelectionMethod == ColorSelectionMethod.colorSeed - ? colorSelected.color - : imageColorScheme!.primary, - useMaterial3: useMaterial3, - brightness: Brightness.dark, - ), - home: Home( - useLightMode: useLightMode, - useMaterial3: useMaterial3, - colorSelected: colorSelected, - imageSelected: imageSelected, - handleBrightnessChange: handleBrightnessChange, - handleMaterialVersionChange: handleMaterialVersionChange, - handleColorSelect: handleColorSelect, - handleImageSelect: handleImageSelect, - colorSelectionMethod: colorSelectionMethod, - ), - ); - } + runApp(MyApp()); } diff --git a/lib/myApp.dart b/lib/myApp.dart new file mode 100644 index 0000000..2f9d223 --- /dev/null +++ b/lib/myApp.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; +import 'navigation.dart'; + +class MyApp extends StatelessWidget { + const MyApp({ Key? key }) : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'My App', + theme: ThemeData( + useMaterial3: true, + primaryColor: Colors.red, + ), + home: Navigation() + ); + } +} \ No newline at end of file diff --git a/lib/navigation.dart b/lib/navigation.dart new file mode 100644 index 0000000..180a383 --- /dev/null +++ b/lib/navigation.dart @@ -0,0 +1,50 @@ +import 'dart:ffi'; + +import 'package:flutter/material.dart'; +import 'pages/testUI.dart'; +import 'pages/TodayView.dart'; +import 'pages/InboxView.dart'; +import 'pages/NotesView.dart'; + +class Navigation extends StatefulWidget { + const Navigation({super.key}); + + @override + State createState() => _NavigationState(); +} + +class _NavigationState extends State { + + int _selectedIndex = 0; + static const List _widgetOptions = [ + TodayView(), + InboxView(), + NotesView(), + ]; + + void _onItemTapped(int index) { + setState(() { + _selectedIndex = index; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("BottomNavBar"), + ), + body: Center(child: _widgetOptions.elementAt(_selectedIndex)), + bottomNavigationBar: BottomNavigationBar( + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.calendar_today), label: "today"), + BottomNavigationBarItem(icon: Icon(Icons.inbox), label: "Inbox"), + BottomNavigationBarItem(icon: Icon(Icons.note), label: "Notes"), + ], + currentIndex: _selectedIndex, + onTap: _onItemTapped, + ), + ); + } +} diff --git a/lib/pages/InboxView.dart b/lib/pages/InboxView.dart new file mode 100644 index 0000000..4d40bd7 --- /dev/null +++ b/lib/pages/InboxView.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class InboxView extends StatefulWidget { + const InboxView({super.key}); + + @override + State createState() => _InboxViewState(); +} + +class _InboxViewState extends State { + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Center( + child: Icon(Icons.inbox), + ) + ); + } +} diff --git a/lib/pages/NoteDetailView.dart b/lib/pages/NoteDetailView.dart new file mode 100644 index 0000000..a9802da --- /dev/null +++ b/lib/pages/NoteDetailView.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class NoteDetailView extends StatefulWidget { + const NoteDetailView({super.key}); + + @override + State createState() => _NoteDetailViewState(); +} + +class _NoteDetailViewState extends State { + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Center( + child: Text('NoteDetailView'), + ) + ); + } +} diff --git a/lib/pages/NotesView.dart b/lib/pages/NotesView.dart new file mode 100644 index 0000000..b0d7c4b --- /dev/null +++ b/lib/pages/NotesView.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class NotesView extends StatefulWidget { + const NotesView({super.key}); + + @override + State createState() => _NotesViewState(); +} + +class _NotesViewState extends State { + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Center( + child: Icon(Icons.note), + ) + ); + } +} diff --git a/lib/pages/TodayView.dart b/lib/pages/TodayView.dart new file mode 100644 index 0000000..cad5346 --- /dev/null +++ b/lib/pages/TodayView.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class TodayView extends StatefulWidget { + const TodayView({super.key}); + + @override + State createState() => _TodayViewState(); +} + +class _TodayViewState extends State { + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Center( + child: Icon(Icons.calendar_today) + ) + ); + } +} diff --git a/lib/pages/testUI.dart b/lib/pages/testUI.dart new file mode 100644 index 0000000..0605f55 --- /dev/null +++ b/lib/pages/testUI.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; + +class TestUI extends StatefulWidget { + const TestUI({super.key}); + + @override + State createState() => _TestUIState(); +} + +class _TestUIState extends State { + int _test = 0; + + void _onPressed() { + setState(() { + _test = 1; + }); + } + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Column(children: [ + FloatingActionButton(onPressed: _onPressed), + Text('$_test'), + ],), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index b5eb553..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,234 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 - url: "https://pub.dev" - source: hosted - version: "1.17.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d - url: "https://pub.dev" - source: hosted - version: "1.0.6" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - sha256: "675c209c94a1817649137cbd113fc4c9ae85e48d03dd578629abbec6d8a4d93d" - url: "https://pub.dev" - source: hosted - version: "2.16.0" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 - url: "https://pub.dev" - source: hosted - version: "4.8.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - sha256: e8c408923cd3a25bd342c576a114f2126769cd1a57106a4edeaa67ea4a84e962 - url: "https://pub.dev" - source: hosted - version: "2.8.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" - source: hosted - version: "2.0.3" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" - url: "https://pub.dev" - source: hosted - version: "0.12.16" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" - url: "https://pub.dev" - source: hosted - version: "0.5.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d - url: "https://pub.dev" - source: hosted - version: "2.1.6" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" - url: "https://pub.dev" - source: hosted - version: "0.6.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" -sdks: - dart: ">=3.1.2 <4.0.0" - flutter: ">=3.3.0"