Skip to content

Commit

Permalink
Add Settings screen
Browse files Browse the repository at this point in the history
  • Loading branch information
sukso96100 committed Jul 8, 2024
1 parent 7ad43cb commit 2fbc302
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'checkInByBarcodeScreen.dart';
import 'package:yaru/yaru.dart';
import 'kioskclient.dart';
import 'wifiScreen.dart';
import 'settings.dart';
import 'package:google_fonts/google_fonts.dart';

void main() {
Expand Down Expand Up @@ -111,11 +112,11 @@ class _KioskMainPageState extends State<KioskMainPage> {
actions: <Widget>[
IconButton(
icon: const Icon(Icons.settings),
tooltip: 'Wi-Fi',
tooltip: '설정',
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const WifiScreen()),
MaterialPageRoute(builder: (context) => const Settings()),
);
},
),
Expand Down
37 changes: 37 additions & 0 deletions lib/settings.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:yaru/widgets.dart';
import 'wifiScreen.dart';

class Settings extends StatelessWidget {
const Settings({
super.key,
});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('설정 Settings'),
),
body: YaruMasterDetailPage(
length: 2,
tileBuilder: (context, index, selected, availableWidth) {
if (index == 0) {
return YaruMasterTile(title: Text('Wi-Fi Setup'));
} else {
return YaruMasterTile(title: Text('Page 2'));
}
},
pageBuilder: (context, index) {
if (index == 0) {
return WifiScreen();
} else {
return Center(
child: Text('Hello Yaru'),
);
}
},
),
);
}
}

0 comments on commit 2fbc302

Please sign in to comment.