diff --git a/lib/app.dart b/lib/app.dart index d56f22a..409e5c6 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -68,8 +68,10 @@ class _AppState extends State { context, controller: tabController, navBarStyle: NavBarStyle.style3, - backgroundColor: Colors.white70, - screenTransitionAnimation: ScreenTransitionAnimation(animateTabTransition: true, curve: Curves.ease, duration: Duration(milliseconds: 200)), + decoration: const NavBarDecoration( + border: Border.symmetric(vertical: BorderSide.none, horizontal: BorderSide(color: Colors.grey, width: 2)) + ), + screenTransitionAnimation: const ScreenTransitionAnimation(animateTabTransition: true, curve: Curves.ease, duration: Duration(milliseconds: 200)), screens: [ const Timetable(), const ChatList(), diff --git a/lib/screen/pages/files/files.dart b/lib/screen/pages/files/files.dart index c9b6b16..d67a9c6 100644 --- a/lib/screen/pages/files/files.dart +++ b/lib/screen/pages/files/files.dart @@ -42,25 +42,40 @@ class _FilesState extends State { @override Widget build(BuildContext context) { - return Consumer( - builder: (context, value, child) { - if(value.primaryLoading()) return const Center(child: CircularProgressIndicator()); + return Scaffold( + appBar: AppBar( + title: const Text("Dateien"), + actions: [ + IconButton( + icon: const Icon(Icons.search), + onPressed: () => {}, + ), + IconButton( + icon: const Icon(Icons.sort), + onPressed: () => {}, + ) + ], + ), + body: Consumer( + builder: (context, value, child) { + if(value.primaryLoading()) return const Center(child: CircularProgressIndicator()); - if(value.listFilesResponse.files.isEmpty) { - return const ErrorView(text: "Der Ordner ist leer", icon: Icons.folder_off_outlined); - } + if(value.listFilesResponse.files.isEmpty) { + return const ErrorView(text: "Der Ordner ist leer", icon: Icons.folder_off_outlined); + } - List files = value.listFilesResponse.files.toList(); - files.sort((a, b) => a.isDirectory ? -1 : 1); + List files = value.listFilesResponse.files.toList(); + files.sort((a, b) => a.isDirectory ? -1 : 1); - return ListView.builder( - itemCount: files.length, - itemBuilder: (context, index) { - CacheableFile file = files.skip(index).first; - return FileElement(file, updateAppBar); - }, - ); - } + return ListView.builder( + itemCount: files.length, + itemBuilder: (context, index) { + CacheableFile file = files.skip(index).first; + return FileElement(file, updateAppBar); + }, + ); + } + ), ); } } diff --git a/lib/screen/pages/talk/chatList.dart b/lib/screen/pages/talk/chatList.dart index 5f2cded..506e88b 100644 --- a/lib/screen/pages/talk/chatList.dart +++ b/lib/screen/pages/talk/chatList.dart @@ -36,71 +36,82 @@ class _ChatListState extends State { @override Widget build(BuildContext context) { - return Consumer( - builder: (context, data, child) { + return Scaffold( + appBar: AppBar( + title: const Text("Talk"), + actions: [ + IconButton( + icon: const Icon(Icons.search), + onPressed: () => {}, + ) + ], + ), + body: Consumer( + builder: (context, data, child) { - if(data.primaryLoading()) { - return const Center(child: CircularProgressIndicator()); - } + if(data.primaryLoading()) { + return const Center(child: CircularProgressIndicator()); + } - List chats = List.empty(growable: true); + List chats = List.empty(growable: true); - for (var chatRoom in data.getRoomsResponse.sortByLastActivity()) { + for (var chatRoom in data.getRoomsResponse.sortByLastActivity()) { - CircleAvatar circleAvatar = CircleAvatar( - foregroundImage: chatRoom.type == GetRoomResponseObjectConversationType.oneToOne ? Image.network("https://cloud.marianum-fulda.de/avatar/${chatRoom.name}/128").image : null, - backgroundColor: Theme.of(context).primaryColor, - foregroundColor: Colors.white, - child: chatRoom.type == GetRoomResponseObjectConversationType.group ? const Icon(Icons.group) : const Icon(Icons.person), - ); + CircleAvatar circleAvatar = CircleAvatar( + foregroundImage: chatRoom.type == GetRoomResponseObjectConversationType.oneToOne ? Image.network("https://cloud.marianum-fulda.de/avatar/${chatRoom.name}/128").image : null, + backgroundColor: Theme.of(context).primaryColor, + foregroundColor: Colors.white, + child: chatRoom.type == GetRoomResponseObjectConversationType.group ? const Icon(Icons.group) : const Icon(Icons.person), + ); - chats.add(ListTile( - title: Text(chatRoom.displayName), - subtitle: Text("${Jiffy.unixFromSecondsSinceEpoch(chatRoom.lastMessage.timestamp).fromNow()}: ${RichObjectStringProcessor.parseToString(chatRoom.lastMessage.message.replaceAll("\n", " "), chatRoom.lastMessage.messageParameters)}", overflow: TextOverflow.ellipsis), - trailing: Visibility( - visible: chatRoom.unreadMessages > 0, - child: Container( - padding: const EdgeInsets.all(1), - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular(30), - ), - constraints: const BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: Text( - "${chatRoom.unreadMessages}", - style: const TextStyle( - color: Colors.white, - fontSize: 15, + chats.add(ListTile( + title: Text(chatRoom.displayName), + subtitle: Text("${Jiffy.unixFromSecondsSinceEpoch(chatRoom.lastMessage.timestamp).fromNow()}: ${RichObjectStringProcessor.parseToString(chatRoom.lastMessage.message.replaceAll("\n", " "), chatRoom.lastMessage.messageParameters)}", overflow: TextOverflow.ellipsis), + trailing: Visibility( + visible: chatRoom.unreadMessages > 0, + child: Container( + padding: const EdgeInsets.all(1), + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular(30), + ), + constraints: const BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Text( + "${chatRoom.unreadMessages}", + style: const TextStyle( + color: Colors.white, + fontSize: 15, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), ), - ), - leading: circleAvatar, - onTap: () async { - Navigator.of(context).push(MaterialPageRoute(builder: (context) { - return ChatView( - room: chatRoom, - selfId: username, - avatar: circleAvatar, - ); - })); - }, - )); - } + leading: circleAvatar, + onTap: () async { + Navigator.of(context).push(MaterialPageRoute(builder: (context) { + return ChatView( + room: chatRoom, + selfId: username, + avatar: circleAvatar, + ); + })); + }, + )); + } - return RefreshIndicator( - color: Theme.of(context).primaryColor, - onRefresh: () { - Provider.of(context, listen: false).run(renew: true); - return Future.delayed(const Duration(seconds: 3)); - }, - child: ListView(children: chats), - ); - }, + return RefreshIndicator( + color: Theme.of(context).primaryColor, + onRefresh: () { + Provider.of(context, listen: false).run(renew: true); + return Future.delayed(const Duration(seconds: 3)); + }, + child: ListView(children: chats), + ); + }, + ), ); } } \ No newline at end of file diff --git a/lib/screen/pages/timetable/timetable.dart b/lib/screen/pages/timetable/timetable.dart index bd6d932..5b1cb0c 100644 --- a/lib/screen/pages/timetable/timetable.dart +++ b/lib/screen/pages/timetable/timetable.dart @@ -26,80 +26,85 @@ class _TimetableState extends State { @override Widget build(BuildContext context) { - return Consumer( - builder: (context, value, child) { - if(value.primaryLoading()) { - return const Center(child: CircularProgressIndicator()); - } + return Scaffold( + appBar: AppBar( + title: const Text("Vertretungsplan"), + ), + body: Consumer( + builder: (context, value, child) { + if(value.primaryLoading()) { + return const Center(child: CircularProgressIndicator()); + } - TimetableProps timetable = Provider.of(context, listen: false); - return Column( - children: [ - Expanded( - child: GestureDetector( - child: WeekView(value), - onHorizontalDragUpdate: (details) { - if(!draggable) return; - if(details.delta.dx > 5) { - draggable = false; - timetable.switchWeek(previous: true); - } else if(details.delta.dx < 5) { - draggable = false; - timetable.switchWeek(); - } - }, - onHorizontalDragEnd: (details) { - draggable = true; - }, - ), - ), - - // Flexible( - // child: - // ), - - Visibility( - visible: false, - child: Container( - padding: const EdgeInsets.only(top: 5, bottom: 5), - decoration: BoxDecoration( - border: Border( - top: BorderSide(width: 2, color: Theme.of(context).disabledColor) - ) - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - - children: [ - IconButton( - onPressed: () => timetable.switchWeek(previous: true), - icon: const Icon(Icons.navigate_before_sharp), - color: Theme.of(context).primaryColor, - iconSize: 30, - ), - Row( - children: [ - IconButton( - onPressed: () => timetable.nearest(), - icon: const Icon(Icons.home), - color: Theme.of(context).primaryColor, - iconSize: 30, - ), - ], - ), - IconButton( - onPressed: () => timetable.switchWeek(), - icon: const Icon(Icons.navigate_next_sharp), - color: Theme.of(context).primaryColor, - iconSize: 30, - ) - ], + TimetableProps timetable = Provider.of(context, listen: false); + return Column( + children: [ + Expanded( + child: GestureDetector( + child: WeekView(value), + onHorizontalDragUpdate: (details) { + if(!draggable) return; + if(details.delta.dx > 5) { + draggable = false; + timetable.switchWeek(previous: true); + } else if(details.delta.dx < 5) { + draggable = false; + timetable.switchWeek(); + } + }, + onHorizontalDragEnd: (details) { + draggable = true; + }, ), ), - ) - ], - ); - }, + + // Flexible( + // child: + // ), + + Visibility( + visible: false, + child: Container( + padding: const EdgeInsets.only(top: 5, bottom: 5), + decoration: BoxDecoration( + border: Border( + top: BorderSide(width: 2, color: Theme.of(context).disabledColor) + ) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + + children: [ + IconButton( + onPressed: () => timetable.switchWeek(previous: true), + icon: const Icon(Icons.navigate_before_sharp), + color: Theme.of(context).primaryColor, + iconSize: 30, + ), + Row( + children: [ + IconButton( + onPressed: () => timetable.nearest(), + icon: const Icon(Icons.home), + color: Theme.of(context).primaryColor, + iconSize: 30, + ), + ], + ), + IconButton( + onPressed: () => timetable.switchWeek(), + icon: const Icon(Icons.navigate_next_sharp), + color: Theme.of(context).primaryColor, + iconSize: 30, + ) + ], + ), + ), + ) + ], + ); + }, + ), ); } }