diff --git a/frontend/where_child_bus/lib/app.dart b/frontend/where_child_bus/lib/app.dart index 76b28426..adb472d9 100644 --- a/frontend/where_child_bus/lib/app.dart +++ b/frontend/where_child_bus/lib/app.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:where_child_bus/pages/auth_page/auth_page.dart'; import 'package:where_child_bus/pages/bus_list_page/bus_list_page.dart'; import 'package:where_child_bus/pages/camera_page/camera_bus_select_page.dart'; import 'package:where_child_bus/pages/notification_page/notification_page.dart'; @@ -21,6 +22,16 @@ class _AppState extends State { return Scaffold( appBar: AppBar( title: Text(['園児一覧', '送迎バスコース一覧', '連絡情報設定', 'カメラ'][_selectedIndex]), + actions: [ + IconButton( + icon: const Icon(Icons.logout), + onPressed: () => { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => const AuthPage())) + }), + ], ), body: [ const ChildListPage(), diff --git a/frontend/where_child_bus/lib/pages/auth_page/auth_page.dart b/frontend/where_child_bus/lib/pages/auth_page/auth_page.dart index ddb0b381..f70a4155 100644 --- a/frontend/where_child_bus/lib/pages/auth_page/auth_page.dart +++ b/frontend/where_child_bus/lib/pages/auth_page/auth_page.dart @@ -2,10 +2,13 @@ import 'dart:developer' as developer; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:where_child_bus/app.dart'; +import 'package:where_child_bus/pages/register_page/register_page.dart'; import 'package:where_child_bus/util/api/nursery_login.dart'; import 'package:where_child_bus/models/nursery_data.dart'; import 'package:where_child_bus_api/proto-gen/where_child_bus/v1/nursery.pb.dart'; +import 'widget/register_button.dart'; + enum NurseryLoginError { unknown, invalidCredentials, @@ -48,6 +51,7 @@ class _AuthPageState extends State { _loginError == NurseryLoginError.invalidCredentials) emailOrPasswordNotFound(), loginButton(), + RegisterButton(context: context), ]; return Center( diff --git a/frontend/where_child_bus/lib/pages/auth_page/widget/register_button.dart b/frontend/where_child_bus/lib/pages/auth_page/widget/register_button.dart new file mode 100644 index 00000000..228a743c --- /dev/null +++ b/frontend/where_child_bus/lib/pages/auth_page/widget/register_button.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:where_child_bus/pages/register_page/register_page.dart'; + +class RegisterButton extends StatelessWidget { + const RegisterButton({ + super.key, + required this.context, + }); + + final BuildContext context; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(15), + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.6, + child: ElevatedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const RegisterPage(), + ), + ); + }, + child: const Text('新規登録はこちら'), + ), + ), + ); + } +} diff --git a/frontend/where_child_bus/lib/pages/register_page/register_page.dart b/frontend/where_child_bus/lib/pages/register_page/register_page.dart index f9847a2c..5726e821 100644 --- a/frontend/where_child_bus/lib/pages/register_page/register_page.dart +++ b/frontend/where_child_bus/lib/pages/register_page/register_page.dart @@ -29,6 +29,9 @@ class _RegisterPageState extends State { return GestureDetector( onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( + appBar: AppBar( + title: const Text('新規登録'), + ), resizeToAvoidBottomInset: true, body: pageBody(), ), @@ -116,7 +119,7 @@ class _RegisterPageState extends State { Widget titleText() => const Padding( padding: EdgeInsets.only(bottom: 32), - child: Text('WhereChildBus', + child: Text('ほいくるーず', style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold)), );