48 lines
1.4 KiB
Dart
48 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tasktracker/Settings/AppearanceSettings.dart';
|
|
import 'package:tasktracker/Settings/NotificationSettings.dart';
|
|
import 'package:tasktracker/main.dart';
|
|
|
|
class SettingsPage extends StatefulWidget {
|
|
const SettingsPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
_SettingsPageState createState() => _SettingsPageState();
|
|
}
|
|
|
|
class _SettingsPageState extends State<SettingsPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(title: Text('Settings')),
|
|
body: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
SettingItem('Appearance', ()=>Navigator.of(context).push(MaterialPageRoute(builder: (context)=> const AppearanceSettings()))),
|
|
Divider(),
|
|
SettingItem('Notifications', ()=>Navigator.of(context).push(MaterialPageRoute(builder: (context)=> const NotificationSettings()))),
|
|
],
|
|
)
|
|
);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Widget SettingItem(String name, Function onTap){
|
|
return InkWell(
|
|
onTap: ()=>onTap(),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(15.0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Text(name, style: TextStyle(fontSize: 18)),
|
|
Icon(Icons.arrow_forward,size: 20,)
|
|
],
|
|
),
|
|
)
|
|
);
|
|
} |