Settings Screen + Button in home
This commit is contained in:
14
lib/app_settings.dart
Normal file
14
lib/app_settings.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Settings extends StatelessWidget {
|
||||
const Settings({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Settings Screen"),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:witl/fetcher.dart';
|
||||
import 'package:witl/input_data.dart';
|
||||
import 'package:witl/app_settings.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({super.key});
|
||||
@@ -16,8 +17,19 @@ class HomeScreen extends StatelessWidget {
|
||||
fit: BoxFit.contain,
|
||||
height: 64,
|
||||
),
|
||||
|
||||
const SizedBox(width: 10,),
|
||||
|
||||
const Text("WITL"),
|
||||
|
||||
const Expanded(child: SizedBox(),),
|
||||
|
||||
IconButton(
|
||||
onPressed: () {Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const Settings())
|
||||
);},
|
||||
icon: const Icon(Icons.settings))
|
||||
]
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:witl/app_settings.dart';
|
||||
import 'package:witl/fetcher.dart';
|
||||
import 'package:witl/home_screen.dart';
|
||||
import 'package:witl/input_data.dart';
|
||||
@@ -30,6 +31,9 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
// User Input
|
||||
'/input': (context) => const InputData(),
|
||||
|
||||
// Settings
|
||||
'/settings': (context) => const Settings(),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user