Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 94 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,24 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
actions: <Widget>[
Padding(
padding: EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SettingsScreen()));
},
child: Icon(
Icons.menu,
size: 26.0,
),
)),
],
),
body: GridView.count(
primary: false,
Expand All @@ -85,10 +101,12 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisCount: 2,
children: <Widget>[
Container(
padding: const EdgeInsets.all(8),
color: Colors.teal[100],
child: const Text("He'd have you all unravel at the"),
),
padding: const EdgeInsets.all(8),
color: Colors.teal[100],
child: Text(
'He\'d have you all unravel at the',
style: TextStyle(fontSize: 20.0),
)),
Container(
padding: const EdgeInsets.all(8),
color: Colors.teal[200],
Expand Down Expand Up @@ -125,3 +143,74 @@ class _MyHomePageState extends State<MyHomePage> {
);
}
}

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Settings'),
),
body: ListView(
padding: const EdgeInsets.all(8),
children: <Widget>[
Card(
child: ListTile(
title: Text('Setting 1'),
),
),
Card(
child: ListTile(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AppearanceScreen()));
},
title: Text('Primary Color'),
leading: Icon(Icons.border_color_rounded),
subtitle: Text('Change the color of the title bar'),
),
),
Card(
child: ListTile(
title: Text('Setting 3'),
),
),
],
),
);
}
}

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Change Primary Appearance'),
),
body: ListView(
padding: const EdgeInsets.all(8),
children: <Widget>[
Card(
child: ListTile(
title: Text('Primary Color'),
leading: Icon(Icons.border_color_rounded),
subtitle: Text('Change the color of the title bar'),
),
),
Card(
child: ListTile(
title: Text('Setting 3'),
),
),
],
),
);
}
}
17 changes: 12 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
lints:
dependency: transitive
description:
Expand All @@ -87,7 +94,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
version: "0.2.0"
meta:
dependency: transitive
description:
Expand All @@ -113,7 +120,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.9.1"
stack_trace:
dependency: transitive
description:
Expand All @@ -127,7 +134,7 @@ packages:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand All @@ -148,13 +155,13 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
version: "0.4.14"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
version: "2.1.4"
sdks:
dart: ">=2.18.1 <3.0.0"