Skip to content

Commit

Permalink
Inizio sviluppo interfaccia grafica #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lange99 committed Nov 8, 2020
1 parent 67c33bf commit bb8c173
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
2 changes: 1 addition & 1 deletion lib/NfcKeyManager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class NfcManager {
var attempts = new Map<String, int>();


void readable() async {
void addReadable() async {
NDEFMessage message = await NFC.readNDEF(once: true).first;
availableKey.add(message.id);
}
Expand Down
72 changes: 33 additions & 39 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,63 @@ void main() {
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
title: "Nfc",
theme: ThemeData(primarySwatch: Colors.blue),


visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
}

final String title;
class MainPage extends StatelessWidget {

@override
_MyHomePageState createState() => _MyHomePageState();
Widget build(BuildContext context) {
return Scaffold(

);
}

}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
class AddKey extends StatelessWidget {

_counter++;
});
}
AddKey(NfcManager manager);

@override
@override
Widget build(BuildContext context) {

return Scaffold(
appBar: AppBar(

title: Text(widget.title),
),
body: Center(

appBar: AppBar(title: Text('Add Key')),
body: Container(
padding: const EdgeInsets.all(16.0),
child: Column(

mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
Container(
child: Text('Add new readable key:'),
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
Flexible(
child: TextField()
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[RaisedButton(
child: Text('Login'),
onPressed: () => {}, //manager.addReadable(),
)
],
)
],
),
)

),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.

);
}

}

0 comments on commit bb8c173

Please sign in to comment.