Commits (2)
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<application
android:label="nfc_gogole_sheet"
android:name="${applicationName}"
......
......@@ -21,4 +21,4 @@ subprojects {
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
}
\ No newline at end of file
......@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NFCReaderUsageDescription</key>
<string>We need NFC access to read and write tags.</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
......
import 'package:flutter/material.dart';
import 'package:nfc_google_sheet/context/colories.dart';
class TitleCustom extends StatelessWidget{
final String content;
const TitleCustom({super.key, required this.content});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsetsGeometry.directional(top: 20),
padding: EdgeInsetsGeometry.symmetric(horizontal: 16),
alignment: Alignment.center,
color: Colories.background,
child:
Text(
content,
style: TextStyle(
fontSize: 35,
color: Colories.selected
),
),
);
}
}
\ No newline at end of file
import 'dart:ui';
class Colories {
static Color title = Color(0xff242423);
static Color title = Color(0xffddb252);
static Color subtitle = Color(0xff3C3B39);
static Color paragraphe = Color(0xff0D0D0C);
static Color background = Color(0xff3a3835);
static Color bordure = Color(0xff171601);
static Color selected = Color(0xffe8bb5a);
static Color unselected = Color(0xffece0bf);
static Color unselected = Color(0xfffffae8);
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:nfc_gogole_sheet/context/colories.dart';
import 'package:nfc_gogole_sheet/pages/home_page.dart';
import 'package:nfc_gogole_sheet/pages/sheet_page.dart';
import 'package:nfc_gogole_sheet/pages/stats_page.dart';
import 'package:nfc_google_sheet/context/colories.dart';
import 'package:nfc_google_sheet/pages/home_page.dart';
import 'package:nfc_google_sheet/pages/sheet_page.dart';
import 'package:nfc_google_sheet/pages/stats_page.dart';
void main(){
runApp(MyApp());
......
import 'package:flutter/material.dart';
import 'package:nfc_gogole_sheet/context/colories.dart';
import 'package:nfc_google_sheet/context/colories.dart';
import 'package:nfc_google_sheet/components/title.dart';
import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager_ndef/nfc_manager_ndef.dart';
import 'package:nfc_manager_felica/nfc_manager_felica.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
class HomePage extends StatelessWidget {
const HomePage({super.key});
......@@ -12,27 +17,63 @@ class HomePage extends StatelessWidget {
}
}
class MyHomePage extends StatefulWidget{
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage>{
String nfcData = "Tap an NFC tag";
Future<void> startNFC() async {
NfcAvailability isAvailable = await NfcManager.instance.checkAvailability();
if (isAvailable != NfcAvailability.enabled) {
setState(() {
nfcData = "NFC is not available on this device";
});
return;
}
NfcManager.instance.startSession(
pollingOptions: {NfcPollingOption.iso14443},
onDiscovered: (NfcTag tag) async {
print("data: ${tag.data.toString()}");
await NfcManager.instance.stopSession();
}
);
}
Future<void> readNFCTag() async {
try {
NFCTag tag = await FlutterNfcKit.poll();
print('NFC Tag Found: ${tag.id}');
} catch (e) {
print('Error reading NFC tag: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
SizedBox(height: 50),
Center(
child: Text(
'Enregistrer les étudiants dans un google Sheet',
style: TextStyle(fontWeight: FontWeight.bold, color:Colories.title),
)
)
]
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/homePageBackground.png'),
fit: BoxFit.cover,
),
),
child: Column(
children: [
SizedBox(height: 50),
Center(
child: TitleCustom(content: 'ENREGISTREZ - VOUS')
),
SizedBox(height: 50),
ElevatedButton(onPressed: readNFCTag, child: Text("Enregistrer sa carte")),
Center(child: Text(nfcData)),
]
),
),
);
}
......
import 'package:flutter/material.dart';
import 'package:nfc_gogole_sheet/context/colories.dart';
import 'package:nfc_google_sheet/context/colories.dart';
class SheetPage extends StatelessWidget {
const SheetPage({super.key});
......
import 'package:flutter/material.dart';
import 'package:nfc_gogole_sheet/context/colories.dart';
import 'package:nfc_google_sheet/context/colories.dart';
class StatsPage extends StatelessWidget {
const StatsPage({super.key});
......
......@@ -41,6 +41,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.19.1"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.dev"
source: hosted
version: "3.1.2"
crypto:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
cupertino_icons:
dependency: "direct main"
description:
......@@ -57,6 +73,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.3"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flutter:
dependency: "direct main"
description: flutter
......@@ -70,11 +94,32 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.0.0"
flutter_nfc_kit:
dependency: "direct main"
description:
name: flutter_nfc_kit
sha256: "3cc4059626fa672031261512299458dd274de4ccb57a7f0ee0951ddd70a048e5"
url: "https://pub.dev"
source: hosted
version: "3.6.0"
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"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.9.0"
leak_tracker:
dependency: transitive
description:
......@@ -107,6 +152,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.dev"
source: hosted
version: "1.3.0"
matcher:
dependency: transitive
description:
......@@ -131,6 +184,46 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.16.0"
ndef:
dependency: transitive
description:
name: ndef
sha256: "5083507cff4bb823b2a198a27ea2c70c4d6bc27a97b66097d966a250e1615d54"
url: "https://pub.dev"
source: hosted
version: "0.3.4"
ndef_record:
dependency: transitive
description:
name: ndef_record
sha256: "876e2774f18573e8afba1aa9db3998aaf4e3384c825c843c3f86d001bec8510d"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
nfc_manager:
dependency: "direct main"
description:
name: nfc_manager
sha256: "24c78b0e5702da53e7f8794d073624c0bee7cd99924f257cbd11f5d1c5866879"
url: "https://pub.dev"
source: hosted
version: "4.1.1"
nfc_manager_felica:
dependency: "direct main"
description:
name: nfc_manager_felica
sha256: "9f5506efd6bf828605e2cb4fc948c07cc3bfe51d9cf8d9b01860528c735cd8d1"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
nfc_manager_ndef:
dependency: "direct main"
description:
name: nfc_manager_ndef
sha256: "8aacee776120b4d09e3049b26cf4a7397fee3abafc207c0640342ada05c5df7d"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
path:
dependency: "direct main"
description:
......@@ -168,6 +261,7 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.10.1"
<<<<<<< HEAD
sqflite:
dependency: "direct main"
description:
......@@ -208,6 +302,16 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.4.0"
=======
sprintf:
dependency: transitive
description:
name: sprintf
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
>>>>>>> c12632c (feature: Nfc)
stack_trace:
dependency: transitive
description:
......@@ -256,6 +360,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.6"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.4.0"
uuid:
dependency: transitive
description:
name: uuid
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
url: "https://pub.dev"
source: hosted
version: "4.5.1"
vector_math:
dependency: transitive
description:
......
name: nfc_gogole_sheet
name: nfc_google_sheet
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
......@@ -30,12 +30,19 @@ environment:
dependencies:
flutter:
sdk: flutter
<<<<<<< HEAD
sqflite: ^2.4.2
path: ^1.9.0
=======
nfc_manager: ^4.1.1
nfc_manager_felica: ^1.0.0
nfc_manager_ndef: ^1.1.0
>>>>>>> c12632c (feature: Nfc)
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
flutter_nfc_kit: ^3.6.0
dev_dependencies:
flutter_test:
......@@ -60,9 +67,8 @@ flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
assets:
- assets/homePageBackground.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
......