From f5e54ebe56f5626a054caf76d280b67a6f7f1a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Fri, 3 May 2024 15:28:03 +0200 Subject: [PATCH 01/18] added something --- lib/notifications_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/notifications_page.dart b/lib/notifications_page.dart index 1c969e1..58e718a 100755 --- a/lib/notifications_page.dart +++ b/lib/notifications_page.dart @@ -5,7 +5,7 @@ class NotificationsPage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: Text('Notifications Page', style: TextStyle(fontSize: 24, color: Colors.black)), + child: Text('Notification Page', style: TextStyle(fontSize: 24, color: Colors.black)), ), ); } From 9717a290cdd5fcc2286b5d6f9adf285f9094002c Mon Sep 17 00:00:00 2001 From: domib97 Date: Sat, 4 May 2024 12:48:57 +0200 Subject: [PATCH 02/18] changed something --- lib/note_page.dart | 24 ++++++++++++------------ lib/notifications_page.dart | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/note_page.dart b/lib/note_page.dart index 27b50e2..d042de5 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -26,9 +26,9 @@ class Note { final String channel; final DateTime timestamp; final Color color; - int score; // Score attribute + int karma; - Note(this.content, this.channel, this.color, {this.score = 0}) : timestamp = DateTime.now(); + Note(this.content, this.channel, this.color, {this.karma = 0}) : timestamp = DateTime.now(); } class NotePage extends StatefulWidget { @@ -106,20 +106,20 @@ class _NotePageState extends State { if (saved == true) { setState(() { _notes.add( - Note(contentController.text, channelController.text, _colors[_random.nextInt(_colors.length)], score: 0)); + Note(contentController.text, channelController.text, _colors[_random.nextInt(_colors.length)], karma: 0)); }); } } - void incrementScore(int index) { + void incrementKarma(int index) { setState(() { - _notes[index].score++; + _notes[index].karma++; }); } - void decrementScore(int index) { + void decrementKarma(int index) { setState(() { - _notes[index].score--; + _notes[index].karma--; }); } @@ -169,19 +169,19 @@ class _NotePageState extends State { child: ListTile( leading: Text(DateFormat('kk:mm:ss\nUTC+2') .format(_notes[index].timestamp)), - title: Text(_notes[index].channel), - subtitle: Text(_notes[index].content), + title: Text("@" + _notes[index].channel), + subtitle: Text(_notes[index].content, style: TextStyle(fontSize: 21)), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ IconButton( icon: const Icon(Icons.arrow_upward), - onPressed: () => incrementScore(index), + onPressed: () => incrementKarma(index), ), - Text('${_notes[index].score}'), + Text('${_notes[index].karma}'), IconButton( icon: const Icon(Icons.arrow_downward), - onPressed: () => decrementScore(index), + onPressed: () => decrementKarma(index), ), IconButton( icon: const Icon(Icons.delete), diff --git a/lib/notifications_page.dart b/lib/notifications_page.dart index 58e718a..214201b 100755 --- a/lib/notifications_page.dart +++ b/lib/notifications_page.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class NotificationsPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( + return const Scaffold( body: Center( child: Text('Notification Page', style: TextStyle(fontSize: 24, color: Colors.black)), ), From 618985ef1bebbd07b71b6f6e10430d7410156696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Wed, 8 May 2024 10:40:03 +0200 Subject: [PATCH 03/18] added something --- lib/{search_page.dart => chat_page.dart} | 4 +++- lib/main.dart | 13 +++++++------ lib/note_page.dart | 2 +- pubspec.yaml | 4 +++- 4 files changed, 14 insertions(+), 9 deletions(-) rename lib/{search_page.dart => chat_page.dart} (54%) diff --git a/lib/search_page.dart b/lib/chat_page.dart similarity index 54% rename from lib/search_page.dart rename to lib/chat_page.dart index bb45594..6b8a5fa 100755 --- a/lib/search_page.dart +++ b/lib/chat_page.dart @@ -1,11 +1,13 @@ import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; + class SearchPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( - child: Text('Search Page', style: TextStyle(fontSize: 24, color: Colors.black)), + child: Text('Chats', style: TextStyle(fontSize: 24)).animate().fade().scale().tint(color: Colors.pink), ), ); } diff --git a/lib/main.dart b/lib/main.dart index 7d746ec..4ed77bb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'note_page.dart'; -import 'search_page.dart'; +import 'chat_page.dart'; import 'notifications_page.dart'; import 'settings_page.dart'; @@ -40,19 +41,19 @@ class _MyAppState extends State { bottomNavigationBar: BottomNavigationBar( items: const [ BottomNavigationBarItem( - icon: Icon(Icons.home), + icon: FaIcon(FontAwesomeIcons.house), label: 'Home', ), BottomNavigationBarItem( - icon: Icon(Icons.search), - label: 'Search', + icon: FaIcon(FontAwesomeIcons.solidMessage), + label: 'Chats', ), BottomNavigationBarItem( - icon: Icon(Icons.notifications), + icon: FaIcon(FontAwesomeIcons.solidBell), label: 'Notifications', ), BottomNavigationBarItem( - icon: Icon(Icons.settings), + icon: FaIcon(FontAwesomeIcons.gear), label: 'Settings', ), ], diff --git a/lib/note_page.dart b/lib/note_page.dart index d042de5..5760be8 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -167,7 +167,7 @@ class _NotePageState extends State { borderRadius: BorderRadius.circular(10.0), ), child: ListTile( - leading: Text(DateFormat('kk:mm:ss\nUTC+2') + leading: Text(DateFormat('kk:mm:ss') .format(_notes[index].timestamp)), title: Text("@" + _notes[index].channel), subtitle: Text(_notes[index].content, style: TextStyle(fontSize: 21)), diff --git a/pubspec.yaml b/pubspec.yaml index 1860d54..a9d5109 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,11 +27,13 @@ environment: # dependencies can be manually updated by changing the version numbers below to # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. + dependencies: flutter: sdk: flutter intl: ^0.19.0 - + font_awesome_flutter: 10.7.0 + flutter_animate: ^4.5.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. From cb6a5ff8b1f29c55f6d6cfa4d9b72658710718bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Wed, 8 May 2024 10:41:22 +0200 Subject: [PATCH 04/18] added something --- pubspec.lock | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pubspec.lock b/pubspec.lock index 679c1aa..c760a7e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -62,6 +62,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_animate: + dependency: "direct main" + description: + name: flutter_animate + sha256: "7c8a6594a9252dad30cc2ef16e33270b6248c4dedc3b3d06c86c4f3f4dc05ae5" + url: "https://pub.dev" + source: hosted + version: "4.5.0" flutter_lints: dependency: "direct dev" description: @@ -70,11 +78,27 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + flutter_shaders: + dependency: transitive + description: + name: flutter_shaders + sha256: "02750b545c01ff4d8e9bbe8f27a7731aa3778402506c67daa1de7f5fc3f4befe" + url: "https://pub.dev" + source: hosted + version: "0.1.2" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f" + url: "https://pub.dev" + source: hosted + version: "10.7.0" intl: dependency: "direct main" description: @@ -218,3 +242,4 @@ packages: version: "13.0.0" sdks: dart: ">=3.3.4 <4.0.0" + flutter: ">=3.7.0-0.0" From 009e9fe01a6f37a9707e00afbf90e299e6c9d8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Wed, 8 May 2024 11:45:03 +0200 Subject: [PATCH 05/18] added something --- lib/chat_page.dart | 1 - pubspec.yaml | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/chat_page.dart b/lib/chat_page.dart index 6b8a5fa..7e83f89 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; - class SearchPage extends StatelessWidget { @override Widget build(BuildContext context) { diff --git a/pubspec.yaml b/pubspec.yaml index a9d5109..ac8c78f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,11 +32,8 @@ dependencies: flutter: sdk: flutter intl: ^0.19.0 - font_awesome_flutter: 10.7.0 + font_awesome_flutter: ^10.7.0 flutter_animate: ^4.5.0 - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 dev_dependencies: From ea26c09c9f3ff026e154f50aadc734615a42a024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Wed, 8 May 2024 12:11:46 +0200 Subject: [PATCH 06/18] added something --- lib/main.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 4ed77bb..a86df84 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -59,7 +59,9 @@ class _MyAppState extends State { ], currentIndex: _selectedIndex, unselectedItemColor: Colors.black, - selectedItemColor: Colors.pink, + unselectedFontSize: 9.5, + showUnselectedLabels: true, + selectedItemColor: Colors.green, onTap: _onItemTapped, ), ), From c5fceea9ed1385eec75df618cd14dcc3e549fd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Wed, 8 May 2024 12:56:05 +0200 Subject: [PATCH 07/18] added something --- lib/{notifications_page.dart => inbox.dart} | 0 lib/main.dart | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) rename lib/{notifications_page.dart => inbox.dart} (100%) diff --git a/lib/notifications_page.dart b/lib/inbox.dart similarity index 100% rename from lib/notifications_page.dart rename to lib/inbox.dart diff --git a/lib/main.dart b/lib/main.dart index a86df84..58c7a77 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'note_page.dart'; import 'chat_page.dart'; -import 'notifications_page.dart'; +import 'inbox.dart'; import 'settings_page.dart'; void main() { @@ -50,19 +50,19 @@ class _MyAppState extends State { ), BottomNavigationBarItem( icon: FaIcon(FontAwesomeIcons.solidBell), - label: 'Notifications', + label: 'Inbox', ), BottomNavigationBarItem( icon: FaIcon(FontAwesomeIcons.gear), label: 'Settings', ), ], + onTap: _onItemTapped, currentIndex: _selectedIndex, - unselectedItemColor: Colors.black, - unselectedFontSize: 9.5, - showUnselectedLabels: true, selectedItemColor: Colors.green, - onTap: _onItemTapped, + unselectedItemColor: Colors.grey, + unselectedFontSize: 9.0, + showUnselectedLabels: true, ), ), debugShowCheckedModeBanner: false, From 01a9a4e800e1c71104fec8974c7053bbc2b74d7d Mon Sep 17 00:00:00 2001 From: domib97 Date: Mon, 13 May 2024 07:29:39 +0200 Subject: [PATCH 08/18] changed something --- lib/c.dart | 132 +++++++++++++++++++++++++++++++++++++++++ lib/chat_page.dart | 99 +++++++++++++++++++++++++++++-- lib/inbox.dart | 7 ++- lib/main.dart | 14 +++-- lib/note_page.dart | 16 ++--- lib/settings_page.dart | 4 +- 6 files changed, 251 insertions(+), 21 deletions(-) create mode 100644 lib/c.dart diff --git a/lib/c.dart b/lib/c.dart new file mode 100644 index 0000000..bec8843 --- /dev/null +++ b/lib/c.dart @@ -0,0 +1,132 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Chat App', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: ChatScreen(), + ); + } +} + +class ChatScreen extends StatefulWidget { + @override + _ChatScreenState createState() => _ChatScreenState(); +} + +class _ChatScreenState extends State { + final TextEditingController _messageController = TextEditingController(); + List<_Message> _messages = []; + + void _handleSendMessage() { + if (_messageController.text.isNotEmpty) { + setState(() { + _messages.add(_Message( + text: _messageController.text, + isMine: true, + timestamp: DateTime.now(), + )); + _messageController.clear(); + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Chat App'), + ), + body: Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: _messages.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _messages[index].isMine + ? SizedBox.shrink() + : Text( + 'Partner', + style: TextStyle(fontSize: 12, color: Colors.grey), + ), + Container( + decoration: BoxDecoration( + color: _messages[index].isMine ? Colors.blue : Colors.green, + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _messages[index].text, + style: TextStyle(color: Colors.white), + ), + Text( + '${_messages[index].timestamp.hour}:${_messages[index].timestamp.minute}', + style: TextStyle(fontSize: 12, color: Colors.grey), + ), + ], + ), + ), + _messages[index].isMine + ? Text( + 'Me', + style: TextStyle(fontSize: 12, color: Colors.grey), + ) + : SizedBox.shrink(), + ], + ), + ); + }, + ), + ), + Divider(), + Container( + padding: EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: TextField( + controller: _messageController, + decoration: InputDecoration( + border: OutlineInputBorder(), + hintText: 'Type a message...', + ), + ), + ), + SizedBox(width: 8), + FloatingActionButton( + onPressed: _handleSendMessage, + tooltip: 'Send', + child: Icon(Icons.send), + ), + ], + ), + ), + ], + ), + ); + } +} + +class _Message { + final String text; + final bool isMine; + final DateTime timestamp; + + _Message({this.text, this.isMine, this.timestamp}); +} \ No newline at end of file diff --git a/lib/chat_page.dart b/lib/chat_page.dart index 7e83f89..312ff26 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -1,13 +1,104 @@ import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; +//import 'package:flutter_animate/flutter_animate.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Chat App', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: ChatScreen(), + ); + } +} + +class ChatScreen extends StatefulWidget { + @override + _ChatScreenState createState() => _ChatScreenState(); + const ChatScreen({super.key}); +} + +class _ChatScreenState extends State { + final TextEditingController _messageController = TextEditingController(); + List _messages = []; + final _colors = [ + Colors.red, + Colors.green, + Colors.blue, + Colors.yellow, + Colors.purple, + ]; + + void _handleSendMessage() { + if (_messageController.text.isNotEmpty) { + setState(() { + _messages.add(_messageController.text); + _messageController.clear(); + }); + } + } -class SearchPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: Center( - child: Text('Chats', style: TextStyle(fontSize: 24)).animate().fade().scale().tint(color: Colors.pink), + appBar: AppBar( + title: Text('Chat App'), + ), + body: Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: _messages.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + color: _colors[index % _colors.length], + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(16), + child: Text( + _messages[index], + style: TextStyle(color: Colors.white), + ), + ), + ); + }, + ), + ), + Divider(), + Container( + padding: EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: TextField( + controller: _messageController, + decoration: InputDecoration( + border: OutlineInputBorder(), + hintText: 'Type a message...', + ), + ), + ), + SizedBox(width: 8), + FloatingActionButton( + onPressed: _handleSendMessage, + tooltip: 'Send', + child: Icon(Icons.send), + ), + ], + ), + ), + ], ), ); } } + diff --git a/lib/inbox.dart b/lib/inbox.dart index 214201b..e5b0987 100755 --- a/lib/inbox.dart +++ b/lib/inbox.dart @@ -1,11 +1,14 @@ import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; class NotificationsPage extends StatelessWidget { + const NotificationsPage({super.key}); + @override Widget build(BuildContext context) { - return const Scaffold( + return Scaffold( body: Center( - child: Text('Notification Page', style: TextStyle(fontSize: 24, color: Colors.black)), + child: const Text('Inbox', style: TextStyle(fontSize: 24)).animate().fade().scale().tint(color: Colors.pink), ), ); } diff --git a/lib/main.dart b/lib/main.dart index 58c7a77..9cf8428 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,21 +6,23 @@ import 'inbox.dart'; import 'settings_page.dart'; void main() { - runApp(MyApp()); + runApp(const MyApp()); } class MyApp extends StatefulWidget { + const MyApp({super.key}); + @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State { int _selectedIndex = 0; - static List _widgetOptions = [ - NotePage(), - SearchPage(), - NotificationsPage(), - SettingsPage(), + static final List _widgetOptions = [ + const NotePage(), + const ChatScreen(), + const NotificationsPage(), + const SettingsPage(), ]; void _onItemTapped(int index) { diff --git a/lib/note_page.dart b/lib/note_page.dart index 5760be8..6989f66 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -62,22 +62,22 @@ class _NotePageState extends State { mainAxisSize: MainAxisSize.min, // Limits the column's height expansion children: [ ConstrainedBox( - constraints: BoxConstraints(minHeight: 60), + constraints: const BoxConstraints(minHeight: 60), child: TextField( controller: channelController, - decoration: InputDecoration( + decoration: const InputDecoration( hintText: '@Channel', contentPadding: EdgeInsets.symmetric(vertical: 15.0), ), ), ), - SizedBox(height: 8), + const SizedBox(height: 8), ConstrainedBox( - constraints: BoxConstraints(minHeight: 60), + constraints: const BoxConstraints(minHeight: 60), child: TextField( controller: contentController, autofocus: true, - decoration: InputDecoration( + decoration: const InputDecoration( hintText: '#GoodVibesOnly', contentPadding: EdgeInsets.symmetric(vertical: 15.0), ), @@ -167,10 +167,10 @@ class _NotePageState extends State { borderRadius: BorderRadius.circular(10.0), ), child: ListTile( - leading: Text(DateFormat('kk:mm:ss') + leading: Text(DateFormat('kk:mm:ss\nUTC+2') .format(_notes[index].timestamp)), - title: Text("@" + _notes[index].channel), - subtitle: Text(_notes[index].content, style: TextStyle(fontSize: 21)), + title: Text("@${_notes[index].channel}"), + subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 21)), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ diff --git a/lib/settings_page.dart b/lib/settings_page.dart index 01e4429..679aff0 100755 --- a/lib/settings_page.dart +++ b/lib/settings_page.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; class SettingsPage extends StatelessWidget { + const SettingsPage({super.key}); + @override Widget build(BuildContext context) { - return Scaffold( + return const Scaffold( body: Center( child: Text('Settings Page', style: TextStyle(fontSize: 24, color: Colors.black)), ), From 02ed4f7cd884c4177447819240dd64db33b11388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 12:07:41 +0200 Subject: [PATCH 09/18] added something --- lib/c.dart | 132 --------------------------------------------- lib/chat_page.dart | 69 +++++++++++++++++------- 2 files changed, 49 insertions(+), 152 deletions(-) delete mode 100644 lib/c.dart diff --git a/lib/c.dart b/lib/c.dart deleted file mode 100644 index bec8843..0000000 --- a/lib/c.dart +++ /dev/null @@ -1,132 +0,0 @@ -import 'package:flutter/material.dart'; - -void main() { - runApp(MyApp()); -} - -class MyApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Chat App', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: ChatScreen(), - ); - } -} - -class ChatScreen extends StatefulWidget { - @override - _ChatScreenState createState() => _ChatScreenState(); -} - -class _ChatScreenState extends State { - final TextEditingController _messageController = TextEditingController(); - List<_Message> _messages = []; - - void _handleSendMessage() { - if (_messageController.text.isNotEmpty) { - setState(() { - _messages.add(_Message( - text: _messageController.text, - isMine: true, - timestamp: DateTime.now(), - )); - _messageController.clear(); - }); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Chat App'), - ), - body: Column( - children: [ - Expanded( - child: ListView.builder( - itemCount: _messages.length, - itemBuilder: (context, index) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _messages[index].isMine - ? SizedBox.shrink() - : Text( - 'Partner', - style: TextStyle(fontSize: 12, color: Colors.grey), - ), - Container( - decoration: BoxDecoration( - color: _messages[index].isMine ? Colors.blue : Colors.green, - borderRadius: BorderRadius.circular(10), - ), - padding: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - _messages[index].text, - style: TextStyle(color: Colors.white), - ), - Text( - '${_messages[index].timestamp.hour}:${_messages[index].timestamp.minute}', - style: TextStyle(fontSize: 12, color: Colors.grey), - ), - ], - ), - ), - _messages[index].isMine - ? Text( - 'Me', - style: TextStyle(fontSize: 12, color: Colors.grey), - ) - : SizedBox.shrink(), - ], - ), - ); - }, - ), - ), - Divider(), - Container( - padding: EdgeInsets.all(16), - child: Row( - children: [ - Expanded( - child: TextField( - controller: _messageController, - decoration: InputDecoration( - border: OutlineInputBorder(), - hintText: 'Type a message...', - ), - ), - ), - SizedBox(width: 8), - FloatingActionButton( - onPressed: _handleSendMessage, - tooltip: 'Send', - child: Icon(Icons.send), - ), - ], - ), - ), - ], - ), - ); - } -} - -class _Message { - final String text; - final bool isMine; - final DateTime timestamp; - - _Message({this.text, this.isMine, this.timestamp}); -} \ No newline at end of file diff --git a/lib/chat_page.dart b/lib/chat_page.dart index 312ff26..9e637f4 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -//import 'package:flutter_animate/flutter_animate.dart'; void main() { runApp(MyApp()); @@ -26,19 +25,16 @@ class ChatScreen extends StatefulWidget { class _ChatScreenState extends State { final TextEditingController _messageController = TextEditingController(); - List _messages = []; - final _colors = [ - Colors.red, - Colors.green, - Colors.blue, - Colors.yellow, - Colors.purple, - ]; + List<_Message> _messages = []; void _handleSendMessage() { if (_messageController.text.isNotEmpty) { setState(() { - _messages.add(_messageController.text); + _messages.add(_Message( + text: _messageController.text, + isMine: true, + timestamp: DateTime.now(), + )); _messageController.clear(); }); } @@ -58,17 +54,43 @@ class _ChatScreenState extends State { itemBuilder: (context, index) { return Padding( padding: const EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - color: _colors[index % _colors.length], - borderRadius: BorderRadius.circular(10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _messages[index].isMine + ? SizedBox.shrink() + : Text( + 'Partner', + style: TextStyle(fontSize: 12, color: Colors.grey), + ), + Container( + decoration: BoxDecoration( + color: _messages[index].isMine ? Colors.blue : Colors.green, + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _messages[index].text, + style: TextStyle(color: Colors.white), + ), + Text( + '${_messages[index].timestamp.hour}:${_messages[index].timestamp.minute}', + style: TextStyle(fontSize: 12, color: Colors.grey), + ), + ], + ), + ), + _messages[index].isMine + ? Text( + 'Me', + style: TextStyle(fontSize: 12, color: Colors.grey), + ) + : SizedBox.shrink(), + ], ), - padding: EdgeInsets.all(16), - child: Text( - _messages[index], - style: TextStyle(color: Colors.white), - ), - ), ); }, ), @@ -102,3 +124,10 @@ class _ChatScreenState extends State { } } +class _Message { + final String text; + final bool isMine; + final DateTime timestamp; + + _Message({required this.text, required this.isMine, required this.timestamp}); +} \ No newline at end of file From f3153bcecdb64c32fcd608198f80fbd15ef70760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 12:53:00 +0200 Subject: [PATCH 10/18] added something --- lib/chat_page.dart | 67 +++++++++++++++++++++++++--------------------- lib/note_page.dart | 3 ++- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/lib/chat_page.dart b/lib/chat_page.dart index 9e637f4..ccd1e0e 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -10,7 +10,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Chat App', theme: ThemeData( - primarySwatch: Colors.blue, + primarySwatch: Colors.green, ), home: ChatScreen(), ); @@ -52,43 +52,50 @@ class _ChatScreenState extends State { child: ListView.builder( itemCount: _messages.length, itemBuilder: (context, index) { + final isMine = _messages[index].isMine; return Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 4.0), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: isMine ? MainAxisAlignment.end : MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - _messages[index].isMine - ? SizedBox.shrink() - : Text( - 'Partner', - style: TextStyle(fontSize: 12, color: Colors.grey), - ), - Container( - decoration: BoxDecoration( - color: _messages[index].isMine ? Colors.blue : Colors.green, - borderRadius: BorderRadius.circular(10), + if (!isMine) + Padding( + padding: EdgeInsets.only(right: 8), + child: Text( + 'Partner:', + style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold), + ), ), - padding: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( + Column( + crossAxisAlignment: isMine ? CrossAxisAlignment.end : CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: isMine ? Colors.blue : Colors.green, + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12), + child: Text( _messages[index].text, style: TextStyle(color: Colors.white), ), - Text( - '${_messages[index].timestamp.hour}:${_messages[index].timestamp.minute}', - style: TextStyle(fontSize: 12, color: Colors.grey), - ), - ], - ), + ), + SizedBox(height: 5), + Text( + '${_messages[index].timestamp.hour.toString().padLeft(2, '0')}:${_messages[index].timestamp.minute.toString().padLeft(2, '0')}', + style: TextStyle(fontSize: 10, color: Colors.black), + ), + ], ), - _messages[index].isMine - ? Text( - 'Me', - style: TextStyle(fontSize: 12, color: Colors.grey), - ) - : SizedBox.shrink(), + if (isMine) + Padding( + padding: EdgeInsets.only(left: 8), + child: Text( + 'Me', + style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold), + ), + ), ], ), ); diff --git a/lib/note_page.dart b/lib/note_page.dart index 6989f66..94f24a7 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:intl/intl.dart'; import 'dart:math'; @@ -200,7 +201,7 @@ class _NotePageState extends State { hoverColor: Colors.pink, onPressed: _showAddNoteDialog, tooltip: 'Neuer Jodel', - child: const Icon(Icons.add), + child: FaIcon(FontAwesomeIcons.plus), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, ); From e42410b165e2d764ff7416b4495da9b1a87d9614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 15:04:15 +0200 Subject: [PATCH 11/18] added something --- lib/chat_page.dart | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/chat_page.dart b/lib/chat_page.dart index ccd1e0e..b58bacd 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -10,6 +10,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Chat App', theme: ThemeData( + primarySwatch: Colors.green, ), home: ChatScreen(), @@ -23,6 +24,14 @@ class ChatScreen extends StatefulWidget { const ChatScreen({super.key}); } +class _Message { + final String text; + final bool isMine; + final DateTime timestamp; + + _Message({required this.text, required this.isMine, required this.timestamp}); +} + class _ChatScreenState extends State { final TextEditingController _messageController = TextEditingController(); List<_Message> _messages = []; @@ -45,6 +54,7 @@ class _ChatScreenState extends State { return Scaffold( appBar: AppBar( title: Text('Chat App'), + centerTitle: true, ), body: Column( children: [ @@ -120,7 +130,10 @@ class _ChatScreenState extends State { FloatingActionButton( onPressed: _handleSendMessage, tooltip: 'Send', - child: Icon(Icons.send), + splashColor: Colors.green, + backgroundColor: Colors.green, + hoverColor: Colors.pink, + child: Icon(Icons.send_rounded), ), ], ), @@ -129,12 +142,4 @@ class _ChatScreenState extends State { ), ); } -} - -class _Message { - final String text; - final bool isMine; - final DateTime timestamp; - - _Message({required this.text, required this.isMine, required this.timestamp}); } \ No newline at end of file From 632bff14267ef98595cd49c4c3a621fed34b62cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 15:08:07 +0200 Subject: [PATCH 12/18] added something --- lib/note_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/note_page.dart b/lib/note_page.dart index 94f24a7..602f374 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -168,7 +168,7 @@ class _NotePageState extends State { borderRadius: BorderRadius.circular(10.0), ), child: ListTile( - leading: Text(DateFormat('kk:mm:ss\nUTC+2') + leading: Text(DateFormat('kk:mm:ss') .format(_notes[index].timestamp)), title: Text("@${_notes[index].channel}"), subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 21)), From f3bfc55c9af192ed115de0b52be883c49581f4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 15:33:14 +0200 Subject: [PATCH 13/18] added something --- lib/chat_page.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/chat_page.dart b/lib/chat_page.dart index b58bacd..b322360 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -8,9 +8,8 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: 'Chat App', + title: 'Chats', theme: ThemeData( - primarySwatch: Colors.green, ), home: ChatScreen(), @@ -53,7 +52,7 @@ class _ChatScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Chat App'), + title: Text('Chats'), centerTitle: true, ), body: Column( From 0f1ccc807b1b0dad40c22d5dfc2804e35070acd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 16:18:46 +0200 Subject: [PATCH 14/18] added something --- lib/chat_page.dart | 2 +- lib/note_page.dart | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/chat_page.dart b/lib/chat_page.dart index b322360..7d66ec2 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -132,7 +132,7 @@ class _ChatScreenState extends State { splashColor: Colors.green, backgroundColor: Colors.green, hoverColor: Colors.pink, - child: Icon(Icons.send_rounded), + child: const Icon(Icons.send_rounded), ), ], ), diff --git a/lib/note_page.dart b/lib/note_page.dart index 602f374..efd52b2 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -169,24 +169,27 @@ class _NotePageState extends State { ), child: ListTile( leading: Text(DateFormat('kk:mm:ss') - .format(_notes[index].timestamp)), - title: Text("@${_notes[index].channel}"), - subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 21)), + .format(_notes[index].timestamp), style: const TextStyle(fontSize: 10, color: Colors.black)), + title: Text("@${_notes[index].channel}", style: const TextStyle(fontSize: 13, color: Colors.black)), + subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 22, color: Colors.white)), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ IconButton( - icon: const Icon(Icons.arrow_upward), + icon: const FaIcon(FontAwesomeIcons.angleUp), onPressed: () => incrementKarma(index), + color: Colors.black, ), - Text('${_notes[index].karma}'), + Text('${_notes[index].karma}', style: const TextStyle(fontSize: 12, color: Colors.black)), IconButton( - icon: const Icon(Icons.arrow_downward), + icon: const FaIcon(FontAwesomeIcons.angleDown), onPressed: () => decrementKarma(index), + color: Colors.black, ), IconButton( icon: const Icon(Icons.delete), onPressed: () => _removeNote(index), + color: Colors.red, ), ], ), @@ -201,7 +204,7 @@ class _NotePageState extends State { hoverColor: Colors.pink, onPressed: _showAddNoteDialog, tooltip: 'Neuer Jodel', - child: FaIcon(FontAwesomeIcons.plus), + child: const FaIcon(FontAwesomeIcons.plus), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, ); From e9f0dc76712133ad913f6db47b32db939dcc76ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 16:50:00 +0200 Subject: [PATCH 15/18] added something --- lib/note_page.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/note_page.dart b/lib/note_page.dart index efd52b2..ca1ef95 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -168,17 +168,22 @@ class _NotePageState extends State { borderRadius: BorderRadius.circular(10.0), ), child: ListTile( - leading: Text(DateFormat('kk:mm:ss') - .format(_notes[index].timestamp), style: const TextStyle(fontSize: 10, color: Colors.black)), - title: Text("@${_notes[index].channel}", style: const TextStyle(fontSize: 13, color: Colors.black)), - subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 22, color: Colors.white)), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("@${_notes[index].channel}", style: const TextStyle(fontSize: 13, color: Colors.black)), + SizedBox(width: 8), + Text(DateFormat('kk:mm:ss').format(_notes[index].timestamp), style: const TextStyle(fontSize: 10, color: Colors.black)), + ], + ), + subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 20, color: Colors.white)), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ IconButton( icon: const FaIcon(FontAwesomeIcons.angleUp), onPressed: () => incrementKarma(index), - color: Colors.black, + color: Colors.black, ), Text('${_notes[index].karma}', style: const TextStyle(fontSize: 12, color: Colors.black)), IconButton( From c006af1813f92401ac5d921ce841150bfcf72d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 16:56:17 +0200 Subject: [PATCH 16/18] added something --- lib/note_page.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/note_page.dart b/lib/note_page.dart index ca1ef95..206abe8 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -89,7 +89,7 @@ class _NotePageState extends State { actions: [ TextButton( onPressed: () => Navigator.pop(context, false), - child: const Text('Abbrechen'), + child: const Text('Cancel'), ), TextButton( onPressed: () { @@ -97,7 +97,7 @@ class _NotePageState extends State { Navigator.pop(context, true); } }, - child: const Text('Speichern'), + child: const Text('Save'), ), ], ); @@ -129,16 +129,16 @@ class _NotePageState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: const Text('Löschen bestätigen'), - content: const Text('Sicher, dass Sie "ihren" Jodel löschen möchten?'), + title: const Text('Confirm deletion'), + content: const Text('Are you sure you want to delete ‘your’ Jodel?'), actions: [ TextButton( onPressed: () => Navigator.pop(context, false), - child: const Text('Abbruch'), + child: const Text('Cancel'), ), TextButton( onPressed: () => Navigator.pop(context, true), - child: const Text('Löschen'), + child: const Text('Confirm'), ), ], ); @@ -208,7 +208,7 @@ class _NotePageState extends State { backgroundColor: Colors.green, hoverColor: Colors.pink, onPressed: _showAddNoteDialog, - tooltip: 'Neuer Jodel', + tooltip: 'New Jodel', child: const FaIcon(FontAwesomeIcons.plus), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, From 3b53f63c346bc9067b7b43478862a3eb0474828d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20B=C3=B6hm?= Date: Mon, 13 May 2024 16:59:22 +0200 Subject: [PATCH 17/18] added something --- lib/chat_page.dart | 30 ++++++++++++++++-------------- lib/note_page.dart | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/chat_page.dart b/lib/chat_page.dart index 7d66ec2..fde38f7 100755 --- a/lib/chat_page.dart +++ b/lib/chat_page.dart @@ -1,10 +1,12 @@ import 'package:flutter/material.dart'; void main() { - runApp(MyApp()); + runApp(const MyApp()); } class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -12,7 +14,7 @@ class MyApp extends StatelessWidget { theme: ThemeData( primarySwatch: Colors.green, ), - home: ChatScreen(), + home: const ChatScreen(), ); } } @@ -33,7 +35,7 @@ class _Message { class _ChatScreenState extends State { final TextEditingController _messageController = TextEditingController(); - List<_Message> _messages = []; + final List<_Message> _messages = []; void _handleSendMessage() { if (_messageController.text.isNotEmpty) { @@ -52,7 +54,7 @@ class _ChatScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Chats'), + title: const Text('Chats'), centerTitle: true, ), body: Column( @@ -69,7 +71,7 @@ class _ChatScreenState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ if (!isMine) - Padding( + const Padding( padding: EdgeInsets.only(right: 8), child: Text( 'Partner:', @@ -84,21 +86,21 @@ class _ChatScreenState extends State { color: isMine ? Colors.blue : Colors.green, borderRadius: BorderRadius.circular(10), ), - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12), + padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12), child: Text( _messages[index].text, - style: TextStyle(color: Colors.white), + style: const TextStyle(color: Colors.white), ), ), - SizedBox(height: 5), + const SizedBox(height: 5), Text( '${_messages[index].timestamp.hour.toString().padLeft(2, '0')}:${_messages[index].timestamp.minute.toString().padLeft(2, '0')}', - style: TextStyle(fontSize: 10, color: Colors.black), + style: const TextStyle(fontSize: 10, color: Colors.black), ), ], ), if (isMine) - Padding( + const Padding( padding: EdgeInsets.only(left: 8), child: Text( 'Me', @@ -111,21 +113,21 @@ class _ChatScreenState extends State { }, ), ), - Divider(), + const Divider(), Container( - padding: EdgeInsets.all(16), + padding: const EdgeInsets.all(16), child: Row( children: [ Expanded( child: TextField( controller: _messageController, - decoration: InputDecoration( + decoration: const InputDecoration( border: OutlineInputBorder(), hintText: 'Type a message...', ), ), ), - SizedBox(width: 8), + const SizedBox(width: 8), FloatingActionButton( onPressed: _handleSendMessage, tooltip: 'Send', diff --git a/lib/note_page.dart b/lib/note_page.dart index 206abe8..1b79247 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -172,7 +172,7 @@ class _NotePageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text("@${_notes[index].channel}", style: const TextStyle(fontSize: 13, color: Colors.black)), - SizedBox(width: 8), + const SizedBox(width: 8), Text(DateFormat('kk:mm:ss').format(_notes[index].timestamp), style: const TextStyle(fontSize: 10, color: Colors.black)), ], ), From 68bc2a6f072bcd568e2586b5d20e6bb0aa7b309e Mon Sep 17 00:00:00 2001 From: domib97 Date: Mon, 13 May 2024 20:36:28 +0200 Subject: [PATCH 18/18] changed something --- lib/note_page.dart | 6 ++--- lib/settings_page.dart | 57 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/lib/note_page.dart b/lib/note_page.dart index 1b79247..b4a6d14 100755 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -171,9 +171,9 @@ class _NotePageState extends State { title: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Text("@${_notes[index].channel}", style: const TextStyle(fontSize: 13, color: Colors.black)), - const SizedBox(width: 8), - Text(DateFormat('kk:mm:ss').format(_notes[index].timestamp), style: const TextStyle(fontSize: 10, color: Colors.black)), + Text("@${_notes[index].channel}", style: const TextStyle(fontSize: 15, color: Colors.black)), + const SizedBox(width: 10), + Text(DateFormat('kk:mm:ss').format(_notes[index].timestamp), style: const TextStyle(fontSize: 13, color: Colors.black)), ], ), subtitle: Text(_notes[index].content, style: const TextStyle(fontSize: 20, color: Colors.white)), diff --git a/lib/settings_page.dart b/lib/settings_page.dart index 679aff0..25ecc03 100755 --- a/lib/settings_page.dart +++ b/lib/settings_page.dart @@ -1,13 +1,62 @@ import 'package:flutter/material.dart'; -class SettingsPage extends StatelessWidget { +class SettingsPage extends StatefulWidget { + @override + _SettingsPageState createState() => _SettingsPageState(); const SettingsPage({super.key}); +} + +class _SettingsPageState extends State { + bool _darkMode = false; + bool _notificationsEnabled = true; @override Widget build(BuildContext context) { - return const Scaffold( - body: Center( - child: Text('Settings Page', style: TextStyle(fontSize: 24, color: Colors.black)), + return Scaffold( + appBar: AppBar( + title: Text('Settings'), + ), + body: ListView( + children: [ + ListTile( + title: Text('Dark Mode'), + trailing: Switch( + value: _darkMode, + onChanged: (value) { + setState(() { + _darkMode = value; + }); + }, + ), + ), + ListTile( + title: Text('Notifications'), + trailing: Switch( + value: _notificationsEnabled, + onChanged: (value) { + setState(() { + _notificationsEnabled = value; + }); + }, + ), + ), + ListTile( + title: Text('Language'), + subtitle: Text('English'), + trailing: Icon(Icons.arrow_forward_ios), + onTap: () { + // Navigate to language selection page + }, + ), + ListTile( + title: Text('About'), + subtitle: Text('Version 1.0'), + trailing: Icon(Icons.info), + onTap: () { + // Show about dialog + }, + ), + ], ), ); }