Merge remote-tracking branch 'origin/simon' into simon

# Conflicts:
#	lib/main.dart
This commit is contained in:
saphi
2023-09-28 08:27:56 +02:00
11 changed files with 207 additions and 397 deletions

View File

@@ -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"
}

View File

@@ -2,31 +2,36 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyAhEex7OfyJHETyC-uSydOFGABBn5KX16Q</string>
<key>GCM_SENDER_ID</key>
<string>164857321043</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>ch.ameti.progettoM335Flutter</string>
<key>PROJECT_ID</key>
<string>progetto-m335</string>
<key>STORAGE_BUCKET</key>
<string>progetto-m335.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:164857321043:ios:b497e5d24254d60e1ad8a6</string>
<key>DATABASE_URL</key>
<string>https://progetto-m335-default-rtdb.europe-west1.firebasedatabase.app</string>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>CLIENT_ID</key>
<string>test-do-not-use.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.test-do-not-use</string>
<key>API_KEY</key>
<string>000000000000000000000000000000000000000</string>
<key>GCM_SENDER_ID</key>
<string>999999999999</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.google.example.BannerExample</string>
<key>IS_ADS_ENABLED</key>
<true/>
<key>IS_ANALYTICS_ENABLED</key>
<false/>
<key>IS_APPINVITE_ENABLED</key>
<false/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>GOOGLE_APP_ID</key>
<string>1:999999999999:ios:0000000000000000</string>
<key>DATABASE_URL</key>
<string>https://test-do-not-use.firebaseio.com</string>
</dict>
</plist>
</plist>

View File

@@ -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<App> createState() => _AppState();
}
class _AppState extends State<App> {
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());
}

18
lib/myApp.dart Normal file
View File

@@ -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()
);
}
}

50
lib/navigation.dart Normal file
View File

@@ -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<Navigation> createState() => _NavigationState();
}
class _NavigationState extends State<Navigation> {
int _selectedIndex = 0;
static const List<Widget> _widgetOptions = <Widget>[
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>[
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,
),
);
}
}

19
lib/pages/InboxView.dart Normal file
View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class InboxView extends StatefulWidget {
const InboxView({super.key});
@override
State<InboxView> createState() => _InboxViewState();
}
class _InboxViewState extends State<InboxView> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Icon(Icons.inbox),
)
);
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class NoteDetailView extends StatefulWidget {
const NoteDetailView({super.key});
@override
State<NoteDetailView> createState() => _NoteDetailViewState();
}
class _NoteDetailViewState extends State<NoteDetailView> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Text('NoteDetailView'),
)
);
}
}

19
lib/pages/NotesView.dart Normal file
View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class NotesView extends StatefulWidget {
const NotesView({super.key});
@override
State<NotesView> createState() => _NotesViewState();
}
class _NotesViewState extends State<NotesView> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Icon(Icons.note),
)
);
}
}

19
lib/pages/TodayView.dart Normal file
View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class TodayView extends StatefulWidget {
const TodayView({super.key});
@override
State<TodayView> createState() => _TodayViewState();
}
class _TodayViewState extends State<TodayView> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Icon(Icons.calendar_today)
)
);
}
}

29
lib/pages/testUI.dart Normal file
View File

@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
class TestUI extends StatefulWidget {
const TestUI({super.key});
@override
State<TestUI> createState() => _TestUIState();
}
class _TestUIState extends State<TestUI> {
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'),
],),
),
);
}
}

View File

@@ -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"