Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter NFC App',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
final TextEditingController _googleSheetsLinkController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter NFC App'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Bienvenue dans votre application NFC !',
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
),
const SizedBox(height: 20.0),
TextField(
controller: _googleSheetsLinkController,
decoration: InputDecoration(
labelText: 'Entrez le lien Google Sheets',
border: OutlineInputBorder(),
),
),
const SizedBox(height: 20.0),
ElevatedButton(
onPressed: () {
// Récupérer le lien Google Sheets saisi par l'utilisateur
String googleSheetsLink = _googleSheetsLinkController.text;
// Faire quelque chose avec le lien, par exemple, naviguer vers une autre page
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DataPage(googleSheetsLink: googleSheetsLink),
),
);
},
child: const Text('Continuer'),
),
],
),
),
);
}
}
class DataPage extends StatelessWidget {
final String googleSheetsLink;
const DataPage({Key? key, required this.googleSheetsLink}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Page de données'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Text(
'Voici le lien Google Sheets que vous avez saisi :',
style: TextStyle(fontSize: 18.0),
),
const SizedBox(height: 10.0),
Text(
googleSheetsLink,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
),
// Vous pouvez faire plus ici avec le lien Google Sheets, comme afficher les données, etc.
],
),
),
);
}
}