From 2fe67e7964882aa1838e176598e5c75390027411 Mon Sep 17 00:00:00 2001 From: zoe Date: Mon, 26 Sep 2022 19:16:11 +0200 Subject: [PATCH] add fancy and cool blue --- lib/dialogues/full_post_view.dart | 183 ++++++++-------- lib/dialogues/makepost.dart | 49 +++-- lib/dialogues/profile_view.dart | 141 ++++++------ lib/dialogues/search.dart | 128 +++++------ lib/pages/notifications/single_notif.dart | 1 + lib/pages/timeline/timeline.dart | 256 ++++++++++++---------- lib/partials/main_scaffold.dart | 59 +++-- lib/partials/post.dart | 4 + lib/partials/post_options.dart | 2 + lib/themes/themes.dart | 11 +- 10 files changed, 448 insertions(+), 386 deletions(-) diff --git a/lib/dialogues/full_post_view.dart b/lib/dialogues/full_post_view.dart index 784a0d3..bd3b4f0 100644 --- a/lib/dialogues/full_post_view.dart +++ b/lib/dialogues/full_post_view.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; import 'package:loris/business_logic/network_tools/get_post_from_url.dart'; @@ -112,97 +114,103 @@ class _FullPostViewState extends State { ), ); }); - return SimpleDialog( - contentPadding: const EdgeInsets.fromLTRB(0, 24, 0, 0), - children: [ - global.settings!.identities.length > idsChecked - ? Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - SelectableText( - "${"post-found-on".i18n()} $idsChecked ${idsChecked == 1 ? "instance".i18n() : "instances".i18n()}", - textAlign: TextAlign.center, - ), - const LinearProgressIndicator(), - ], - ) - : Padding( - padding: themes.defaultInsideMargins, - child: Wrap( - alignment: WrapAlignment.spaceAround, - crossAxisAlignment: WrapCrossAlignment.center, + return BackdropFilter( + filter: + ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror), + child: SimpleDialog( + contentPadding: const EdgeInsets.fromLTRB(0, 24, 0, 0), + children: [ + global.settings!.identities.length > idsChecked + ? Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - alignment: Alignment.center, - value: activeIdentity, - style: Theme.of(context).textTheme.bodyMedium, - iconEnabledColor: - Theme.of(context).colorScheme.onSurface, - items: dropdownButtons, - onChanged: (value) { - setState(() { - Navigator.of(context).pop(); - showDialog( - context: context, - builder: (context) => FullPostView( - originPostModel: identities[value]!, - identities: identities, - ), - ); - }); - loadPosts(); - }, - ), + SelectableText( + "${"post-found-on".i18n()} $idsChecked ${idsChecked == 1 ? "instance".i18n() : "instances".i18n()}", + textAlign: TextAlign.center, ), - if (sensitive || widget.forceSensitive) - ElevatedButton.icon( - onPressed: () { - setState(() { - Navigator.of(context).pop(); - showDialog( - context: context, - builder: (context) => FullPostView( - originPostModel: widget.originPostModel, - hidden: !widget.hidden, - identities: identities, - ancestors: ancestors, - descendants: descendants, - forceSensitive: true, - ), - ); - }); - }, - icon: Icon(widget.hidden - ? Icons.visibility - : Icons.visibility_off), - label: Text( - widget.hidden ? "show".i18n() : "hide".i18n(), + const LinearProgressIndicator(), + ], + ) + : Padding( + padding: themes.defaultInsideMargins, + child: Wrap( + alignment: WrapAlignment.spaceAround, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + alignment: Alignment.center, + value: activeIdentity, + style: Theme.of(context).textTheme.bodyMedium, + iconEnabledColor: + Theme.of(context).colorScheme.onSurface, + items: dropdownButtons, + onChanged: (value) { + setState(() { + Navigator.of(context).pop(); + showDialog( + barrierColor: Colors.transparent, + context: context, + builder: (context) => FullPostView( + originPostModel: identities[value]!, + identities: identities, + ), + ); + }); + loadPosts(); + }, ), ), - ], + if (sensitive || widget.forceSensitive) + ElevatedButton.icon( + onPressed: () { + setState(() { + Navigator.of(context).pop(); + showDialog( + barrierColor: Colors.transparent, + context: context, + builder: (context) => FullPostView( + originPostModel: widget.originPostModel, + hidden: !widget.hidden, + identities: identities, + ancestors: ancestors, + descendants: descendants, + forceSensitive: true, + ), + ); + }); + }, + icon: Icon(widget.hidden + ? Icons.visibility + : Icons.visibility_off), + label: Text( + widget.hidden ? "show".i18n() : "hide".i18n(), + ), + ), + ], + ), + ), + Container( + constraints: BoxConstraints( + maxHeight: MediaQuery.of(context).size.height * 2 / 3, + maxWidth: global.getConstraints(context).maxWidth), + width: global.getWidth(context), + child: SingleChildScrollView( + child: Padding( + padding: themes.defaultMargins, + child: SingleFullPostDisplay( + ancestors: ancestors, + descendants: descendants, + hidden: widget.hidden, + level: 0, + model: identities[activeIdentity]!.reblog ?? + identities[activeIdentity]!, ), ), - Container( - constraints: BoxConstraints( - maxHeight: MediaQuery.of(context).size.height * 2 / 3, - maxWidth: global.getConstraints(context).maxWidth), - width: global.getWidth(context), - child: SingleChildScrollView( - child: Padding( - padding: themes.defaultMargins, - child: SingleFullPostDisplay( - ancestors: ancestors, - descendants: descendants, - hidden: widget.hidden, - level: 0, - model: identities[activeIdentity]!.reblog ?? - identities[activeIdentity]!, - ), ), - ), - ) - ], + ) + ], + ), ); } } @@ -254,8 +262,11 @@ class SingleFullPostDisplay extends StatelessWidget { )); c.addAll(descendantsWidgets); return Container( - padding: - EdgeInsets.fromLTRB(level == 0 ? 0 : 4, 0, level == 0 ? 0 : 4, 0), + padding: EdgeInsets.fromLTRB( + level == 0 ? 0 : 4, + themes.defaultSeperatorHeight, + level == 0 ? 0 : 4, + themes.defaultSeperatorHeight), decoration: BoxDecoration( border: level == 0 ? const Border() diff --git a/lib/dialogues/makepost.dart b/lib/dialogues/makepost.dart index 9348235..bbd3954 100644 --- a/lib/dialogues/makepost.dart +++ b/lib/dialogues/makepost.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; @@ -391,31 +392,35 @@ class _MakePostState extends State { )); } - return SimpleDialog( - titlePadding: const EdgeInsets.all(0), - alignment: Alignment.center, - contentPadding: themes.defaultMargins, - title: Column( + return BackdropFilter( + filter: + ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror), + child: SimpleDialog( + titlePadding: const EdgeInsets.all(0), + alignment: Alignment.center, + contentPadding: themes.defaultMargins, + title: Column( + children: [ + if (status != null) SelectableText(status!), + if (sending) const LinearProgressIndicator(), + ], + ), children: [ - if (status != null) SelectableText(status!), - if (sending) const LinearProgressIndicator(), - ], - ), - children: [ - SingleChildScrollView( - child: Container( - width: (MediaQuery.of(context).size.width * - global.settings!.postWidth) - - 56, - constraints: global.getConstraints(context), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: c, + SingleChildScrollView( + child: Container( + width: (MediaQuery.of(context).size.width * + global.settings!.postWidth) - + 56, + constraints: global.getConstraints(context), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: c, + ), ), ), - ), - ], + ], + ), ); } } diff --git a/lib/dialogues/profile_view.dart b/lib/dialogues/profile_view.dart index 455fec5..d4a985d 100644 --- a/lib/dialogues/profile_view.dart +++ b/lib/dialogues/profile_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; @@ -168,75 +169,83 @@ class _ProfileViewState extends State { ), ); - return SimpleDialog( - alignment: Alignment.center, - title: DisplayName( - account: identities[activeIdentity]!, - openInBrowser: true, - ), - contentPadding: const EdgeInsets.all(0), - children: [ - Column(children: [ - loading - ? Column( - children: [ - SelectableText( - "${"found-account-on".i18n()} ${identities.length} ${identities.length <= 1 ? "instance" : "instances".i18n()}"), - const LinearProgressIndicator(), - ], - ) - : Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: false, - alignment: Alignment.center, - iconEnabledColor: - Theme.of(context).colorScheme.onSurface, - value: activeIdentity, - items: dmenuItems, - onChanged: (value) { - setState(() { - activeIdentity = value.toString(); - }); - reloadPosts(); - }, + return BackdropFilter( + filter: + ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror), + child: SimpleDialog( + alignment: Alignment.center, + title: DisplayName( + account: identities[activeIdentity]!, + openInBrowser: true, + ), + contentPadding: const EdgeInsets.all(0), + children: [ + Column(children: [ + loading + ? Column( + children: [ + SelectableText( + "${"found-account-on".i18n()} ${identities.length} ${identities.length <= 1 ? "instance" : "instances".i18n()}"), + const LinearProgressIndicator(), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: false, + alignment: Alignment.center, + iconEnabledColor: + Theme.of(context).colorScheme.onSurface, + value: activeIdentity, + items: dmenuItems, + onChanged: (value) { + setState(() { + activeIdentity = value.toString(); + }); + reloadPosts(); + }, + ), ), - ), - ], + ], + ), + Container( + constraints: global.getConstraints(context), + width: global.getWidth(context) + + MediaQuery.of(context).size.width * 0.2, + height: MediaQuery.of(context).size.height * 2 / 3, + child: ListView.separated( + separatorBuilder: (context, index) => const Divider( + color: Colors.transparent, + height: themes.defaultSeperatorHeight, ), - Container( - constraints: global.getConstraints(context), - width: global.getWidth(context) + - MediaQuery.of(context).size.width * 0.2, - height: MediaQuery.of(context).size.height * 2 / 3, - child: ListView.separated( - separatorBuilder: (context, index) => const Divider( - color: Colors.transparent, - height: themes.defaultSeperatorHeight, - ), - controller: _scrollController, - itemCount: threads.length + 2, - itemBuilder: (context, index) { - if (index == 0) { - return profileViewDisplay; - } else if (index > 0 && index <= threads.length) { - return Padding( - padding: themes.defaultMargins, - child: Thread( - model: threads[index - 1], - constrained: false, - ), - ); - } + controller: _scrollController, + itemCount: threads.length + 2, + itemBuilder: (context, index) { + if (index == 0) { + return profileViewDisplay; + } else if (index > 0 && index <= threads.length) { + return Padding( + padding: const EdgeInsets.fromLTRB( + themes.defaultSeperatorHeight * 2, + 0, + themes.defaultSeperatorHeight * 2, + 0), + child: Thread( + model: threads[index - 1], + constrained: false, + ), + ); + } - return const LoadingBox(); - }, + return const LoadingBox(); + }, + ), ), - ), - ]), - ], + ]), + ], + ), ); } } @@ -370,7 +379,7 @@ class ProfileViewDisplay extends StatelessWidget { ), if (relationshipModel != null) Padding( - padding: themes.defaultMargins, + padding: const EdgeInsets.all(themes.defaultSeperatorHeight), child: AccountInteractionButtons( account: accountModel, relationship: relationshipModel!, diff --git a/lib/dialogues/search.dart b/lib/dialogues/search.dart index ff2640a..15eca9f 100644 --- a/lib/dialogues/search.dart +++ b/lib/dialogues/search.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; import 'package:loris/business_logic/account/account.dart'; @@ -53,76 +55,80 @@ class _SearchDialogueState extends State { } }, ); - return SimpleDialog( - contentPadding: const EdgeInsets.all(0), - titlePadding: const EdgeInsets.all(0), - title: Column( + return BackdropFilter( + filter: + ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror), + child: SimpleDialog( + contentPadding: const EdgeInsets.all(0), + titlePadding: const EdgeInsets.all(0), + title: Column( + children: [ + TextField( + style: Theme.of(context).textTheme.bodyMedium, + autofocus: true, + keyboardType: TextInputType.url, + onEditingComplete: () { + if (searchText.isNotEmpty) { + search(); + } + }, + onChanged: ((value) => setState(() { + searchText = value; + })), + decoration: InputDecoration( + prefixIcon: Icon( + color: Theme.of(context).colorScheme.primary, + Icons.search, + ))), + if (searched < global.settings!.identities.length && + searchTextControl.isNotEmpty) + Column( + children: [ + SelectableText( + "${"searched".i18n()} $searched ${searched == 1 ? "instance".i18n() : "instances".i18n()}"), + const LinearProgressIndicator(), + ], + ), + ], + ), children: [ - TextField( - style: Theme.of(context).textTheme.bodyMedium, - autofocus: true, - keyboardType: TextInputType.url, - onEditingComplete: () { - if (searchText.isNotEmpty) { - search(); - } - }, - onChanged: ((value) => setState(() { - searchText = value; - })), - decoration: InputDecoration( - prefixIcon: Icon( - color: Theme.of(context).colorScheme.primary, - Icons.search, - ))), - if (searched < global.settings!.identities.length && - searchTextControl.isNotEmpty) - Column( - children: [ - SelectableText( - "${"searched".i18n()} $searched ${searched == 1 ? "instance".i18n() : "instances".i18n()}"), - const LinearProgressIndicator(), - ], + Container( + width: global.getWidth(context), + constraints: BoxConstraints( + maxWidth: global.getConstraints(context).maxWidth, + maxHeight: MediaQuery.of(context).size.height * 2 / 3, ), - ], - ), - children: [ - Container( - width: global.getWidth(context), - constraints: BoxConstraints( - maxWidth: global.getConstraints(context).maxWidth, - maxHeight: MediaQuery.of(context).size.height * 2 / 3, - ), - child: ListView.builder( - itemCount: accountModels.length + postModels.length, - itemBuilder: (context, index) { - if (index < accountModels.length) { - final model = accountModels[index]; + child: ListView.builder( + itemCount: accountModels.length + postModels.length, + itemBuilder: (context, index) { + if (index < accountModels.length) { + final model = accountModels[index]; + return Padding( + padding: themes.defaultMargins, + child: Column( + children: [ + SelectableText(model.identity), + DisplayName(account: model) + ], + ), + ); + } + final model = postModels[index - accountModels.length]; return Padding( - padding: themes.defaultMargins, + padding: const EdgeInsets.all(8.0), child: Column( children: [ SelectableText(model.identity), - DisplayName(account: model) + Post( + model: model, + ) ], ), ); - } - final model = postModels[index - accountModels.length]; - return Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - SelectableText(model.identity), - Post( - model: model, - ) - ], - ), - ); - }), - ), - ], + }), + ), + ], + ), ); } } diff --git a/lib/pages/notifications/single_notif.dart b/lib/pages/notifications/single_notif.dart index 6e0a352..bc43a72 100644 --- a/lib/pages/notifications/single_notif.dart +++ b/lib/pages/notifications/single_notif.dart @@ -33,6 +33,7 @@ class SingleNotif extends StatelessWidget { InkWell( borderRadius: const BorderRadius.all(themes.defaultRadius), onTap: () => showDialog( + barrierColor: Colors.transparent, context: context, builder: (context) => ProfileView(model: model.account), ), diff --git a/lib/pages/timeline/timeline.dart b/lib/pages/timeline/timeline.dart index 2f7442a..5fffba8 100644 --- a/lib/pages/timeline/timeline.dart +++ b/lib/pages/timeline/timeline.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; +import 'package:loris/dialogues/makepost.dart'; import 'package:loris/dialogues/search.dart'; import 'package:loris/partials/thread.dart'; import '../../business_logic/timeline/timeline.dart' as tl; @@ -103,124 +104,147 @@ class TimelineState extends State { )); } selectedId = global.settings!.activeIdentity; - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Material( - color: Theme.of(context).colorScheme.surface, - child: Wrap( - alignment: WrapAlignment.spaceEvenly, - children: [ - IconButton( - onPressed: () { - reload(); - }, - icon: const Icon(Icons.refresh), - ), - IconButton( - onPressed: () => showDialog( - context: context, - builder: (context) => const SearchDialogue(), - ), - icon: const Icon(Icons.search)), - DropdownButtonHideUnderline( - child: DropdownButton( - alignment: Alignment.center, - borderRadius: BorderRadius.circular(8), - iconEnabledColor: Theme.of(context).colorScheme.onSurface, - value: selectedId, - items: identities, - onChanged: (dynamic value) async { - setState(() { - selectedId = value ?? global.settings!.activeIdentity; - global.settings!.saveActiveIdentity(selectedId); - reload(); - }); - }, - ), - ), - DropdownButtonHideUnderline( - child: DropdownButton( - alignment: Alignment.center, - borderRadius: BorderRadius.circular(8), - iconEnabledColor: Theme.of(context).colorScheme.onSurface, - value: selectedTimelineType, - items: [ - DropdownMenuItem( - alignment: Alignment.center, - value: tl.TimelineType.home, - child: RichText( - text: TextSpan( - style: Theme.of(context).textTheme.bodyMedium, - text: "${"home-timeline".i18n()} ", - children: const [ - WidgetSpan( - child: Icon(Icons.home), - ), - ], - ), - ), - ), - DropdownMenuItem( - alignment: Alignment.center, - value: tl.TimelineType.local, - child: RichText( - text: TextSpan( - style: Theme.of(context).textTheme.bodyMedium, - text: "${"local-timeline".i18n()} ", - children: const [ - WidgetSpan( - child: Icon(Icons.people), - ) - ], - ), - ), - ), - DropdownMenuItem( - alignment: Alignment.center, - value: tl.TimelineType.public, - child: RichText( - text: TextSpan( - style: Theme.of(context).textTheme.bodyMedium, - text: "${"public-timeline".i18n()} ", - children: const [ - WidgetSpan( - child: Icon(Icons.public), - ), - ], - ), - ), - ), - ], - onChanged: (tl.TimelineType? value) { - setState(() { - selectedTimelineType = value ?? tl.TimelineType.home; - reload(); - }); - }, - ), - ) - ], + return SizedBox( + height: MediaQuery.of(context).size.height - 52, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + child: ListView.separated( + physics: const AlwaysScrollableScrollPhysics(), + controller: controller, + itemBuilder: (context, index) { + return children[index]; + }, + separatorBuilder: (context, index) { + return const Divider( + color: Colors.transparent, + height: themes.defaultSeperatorHeight, + ); + }, + itemCount: children.length, + addAutomaticKeepAlives: false, + ), ), - ), - Expanded( - child: ListView.separated( - physics: const AlwaysScrollableScrollPhysics(), - controller: controller, - itemBuilder: (context, index) { - return children[index]; - }, - separatorBuilder: (context, index) { - return const Divider( - color: Colors.transparent, - height: themes.defaultSeperatorHeight, - ); - }, - itemCount: children.length, - addAutomaticKeepAlives: false, + Container( + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Theme.of(context).colorScheme.primary, + width: 2, + ), + )), + child: Material( + color: Theme.of(context).colorScheme.surface, + child: Wrap( + spacing: 18, + crossAxisAlignment: WrapCrossAlignment.center, + alignment: WrapAlignment.spaceEvenly, + children: [ + IconButton( + onPressed: () { + reload(); + }, + icon: const Icon(Icons.refresh), + ), + IconButton( + onPressed: () => showDialog( + barrierColor: Colors.transparent, + context: context, + builder: (context) => const SearchDialogue(), + ), + icon: const Icon(Icons.search)), + DropdownButtonHideUnderline( + child: DropdownButton( + alignment: Alignment.center, + borderRadius: BorderRadius.circular(8), + iconEnabledColor: Theme.of(context).colorScheme.onSurface, + value: selectedId, + items: identities, + onChanged: (dynamic value) async { + setState(() { + selectedId = value ?? global.settings!.activeIdentity; + global.settings!.saveActiveIdentity(selectedId); + reload(); + }); + }, + ), + ), + DropdownButtonHideUnderline( + child: DropdownButton( + alignment: Alignment.center, + borderRadius: BorderRadius.circular(8), + iconEnabledColor: Theme.of(context).colorScheme.onSurface, + value: selectedTimelineType, + items: [ + DropdownMenuItem( + alignment: Alignment.center, + value: tl.TimelineType.home, + child: RichText( + text: TextSpan( + style: Theme.of(context).textTheme.bodyMedium, + text: "${"home-timeline".i18n()} ", + children: const [ + WidgetSpan( + child: Icon(Icons.home), + ), + ], + ), + ), + ), + DropdownMenuItem( + alignment: Alignment.center, + value: tl.TimelineType.local, + child: RichText( + text: TextSpan( + style: Theme.of(context).textTheme.bodyMedium, + text: "${"local-timeline".i18n()} ", + children: const [ + WidgetSpan( + child: Icon(Icons.people), + ) + ], + ), + ), + ), + DropdownMenuItem( + alignment: Alignment.center, + value: tl.TimelineType.public, + child: RichText( + text: TextSpan( + style: Theme.of(context).textTheme.bodyMedium, + text: "${"public-timeline".i18n()} ", + children: const [ + WidgetSpan( + child: Icon(Icons.public), + ), + ], + ), + ), + ), + ], + onChanged: (tl.TimelineType? value) { + setState(() { + selectedTimelineType = value ?? tl.TimelineType.home; + reload(); + }); + }, + ), + ), + ElevatedButton.icon( + onPressed: (() => showDialog( + barrierColor: Colors.transparent, + context: context, + builder: (context) => const MakePost(), + )), + icon: const Icon(Icons.create), + label: Text("write".i18n())), + ], + ), + ), ), - ), - ], + ], + ), ); } diff --git a/lib/partials/main_scaffold.dart b/lib/partials/main_scaffold.dart index 222c6c1..34f2d23 100644 --- a/lib/partials/main_scaffold.dart +++ b/lib/partials/main_scaffold.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; -import 'package:loris/dialogues/makepost.dart'; import 'package:loris/pages/chat/chat.dart'; import 'package:loris/pages/notifications/notifications.dart'; import 'package:loris/pages/timeline/timeline.dart'; @@ -47,13 +46,7 @@ class _MainScaffoldState extends State { settings(context), ]; final buttons = [ - FloatingActionButton( - child: const Icon(Icons.create), - onPressed: () => showDialog( - context: context, - builder: (context) => const MakePost(), - ), - ), + null, FloatingActionButton( onPressed: () {}, child: const Icon(Icons.person_add), @@ -63,35 +56,39 @@ class _MainScaffoldState extends State { ]; return SafeArea( child: Scaffold( - extendBody: true, + extendBody: false, body: IndexedStack( index: index, children: screens, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: buttons[index], - bottomNavigationBar: BottomAppBar( - child: NavigationBar( - onDestinationSelected: (index) => setState(() { - this.index = index; - if (index == 2) { - unreadNotifs = 0; - } - }), - selectedIndex: index, - destinations: [ - NavigationDestination( - icon: const Icon(Icons.forum), label: "timeline".i18n()), - NavigationDestination( - icon: const Icon(Icons.chat), label: "chat".i18n()), - NavigationDestination( - icon: Icon((unreadNotifs >= 1) - ? Icons.notifications_active - : Icons.notifications), - label: "notifications".i18n()), - NavigationDestination( - icon: const Icon(Icons.settings), label: "settings".i18n()), - ]), + bottomNavigationBar: SizedBox( + height: 52, + child: BottomAppBar( + child: NavigationBar( + onDestinationSelected: (index) => setState(() { + this.index = index; + if (index == 2) { + unreadNotifs = 0; + } + }), + selectedIndex: index, + destinations: [ + NavigationDestination( + icon: const Icon(Icons.forum), label: "timeline".i18n()), + NavigationDestination( + icon: const Icon(Icons.chat), label: "chat".i18n()), + NavigationDestination( + icon: Icon((unreadNotifs >= 1) + ? Icons.notifications_active + : Icons.notifications), + label: "notifications".i18n()), + NavigationDestination( + icon: const Icon(Icons.settings), + label: "settings".i18n()), + ]), + ), ), ), ); diff --git a/lib/partials/post.dart b/lib/partials/post.dart index 4be7ce3..01a9098 100644 --- a/lib/partials/post.dart +++ b/lib/partials/post.dart @@ -93,6 +93,7 @@ class DisplayName extends StatelessWidget { onTap: !openInBrowser ? () { showDialog( + barrierColor: Colors.transparent, context: context, builder: (context) => ProfileView(model: account), ); @@ -232,6 +233,7 @@ class _PostBodyState extends State { return InkWell( borderRadius: const BorderRadius.all(themes.defaultRadius), onTap: () => showDialog( + barrierColor: Colors.transparent, context: context, builder: (context) => FullPostView(originPostModel: widget.model), ), @@ -323,6 +325,7 @@ class _PostActionBarState extends State { child: IconButton( onPressed: () { showDialog( + barrierColor: Colors.transparent, context: context, builder: ((context) => MakePost( inReplyTo: widget.model, @@ -352,6 +355,7 @@ class _PostActionBarState extends State { tooltip: "show-in-full".i18n(), onPressed: () { showDialog( + barrierColor: Colors.transparent, context: context, builder: (context) => FullPostView( originPostModel: widget.model, diff --git a/lib/partials/post_options.dart b/lib/partials/post_options.dart index 186801d..e22c999 100644 --- a/lib/partials/post_options.dart +++ b/lib/partials/post_options.dart @@ -9,6 +9,7 @@ import 'package:clipboard/clipboard.dart'; void popupPostOptions(context, PostModel model) { showModalBottomSheet( + barrierColor: Colors.transparent, context: context, builder: (context) => PostOptions(model: model), ); @@ -52,6 +53,7 @@ class _PostOptionsState extends State { ), TextButton.icon( onPressed: () => showDialog( + barrierColor: Colors.transparent, context: context, builder: (context) => FullPostView(originPostModel: widget.model), diff --git a/lib/themes/themes.dart b/lib/themes/themes.dart index 3d1967b..f46aecb 100644 --- a/lib/themes/themes.dart +++ b/lib/themes/themes.dart @@ -18,7 +18,7 @@ bool checkActive(Set states) { const defaultRadius = Radius.circular(8); const defaultSeperatorHeight = 4.0; const defaultInsideMargins = EdgeInsets.all(18); -const defaultMargins = EdgeInsets.all(18); +const defaultMargins = EdgeInsets.fromLTRB(18, 8, 18, 8); // color schemes to pick from can be added here // there is a class to create these @@ -175,6 +175,9 @@ ThemeData getTheme(CustomColors colors) { color: colors.colorScheme.surface, ), navigationBarTheme: NavigationBarThemeData( + indicatorShape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(defaultRadius), + ), labelTextStyle: MaterialStateProperty.all( TextStyle( color: colors.colorScheme.onSurface, @@ -182,10 +185,10 @@ ThemeData getTheme(CustomColors colors) { ), ), backgroundColor: Colors.transparent, - labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected, - indicatorColor: Colors.transparent, + labelBehavior: NavigationDestinationLabelBehavior.alwaysHide, + indicatorColor: colors.hoverColor, elevation: 0, - height: 64, + height: 52, ), scrollbarTheme: ScrollbarThemeData( thumbColor: MaterialStateProperty.all(colors.hintColor),