add fancy and cool blue
This commit is contained in:
parent
b281ffc061
commit
2fe67e7964
|
@ -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<FullPostView> {
|
|||
),
|
||||
);
|
||||
});
|
||||
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<String>(
|
||||
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<String>(
|
||||
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()
|
||||
|
|
|
@ -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<MakePost> {
|
|||
));
|
||||
}
|
||||
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<ProfileView> {
|
|||
),
|
||||
);
|
||||
|
||||
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!,
|
||||
|
|
|
@ -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<SearchDialogue> {
|
|||
}
|
||||
},
|
||||
);
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
|
|
|
@ -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<Timeline> {
|
|||
));
|
||||
}
|
||||
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())),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<MainScaffold> {
|
|||
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<MainScaffold> {
|
|||
];
|
||||
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()),
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -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<PostBody> {
|
|||
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<PostActionBar> {
|
|||
child: IconButton(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
barrierColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: ((context) => MakePost(
|
||||
inReplyTo: widget.model,
|
||||
|
@ -352,6 +355,7 @@ class _PostActionBarState extends State<PostActionBar> {
|
|||
tooltip: "show-in-full".i18n(),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
barrierColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: widget.model,
|
||||
|
|
|
@ -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<PostOptions> {
|
|||
),
|
||||
TextButton.icon(
|
||||
onPressed: () => showDialog(
|
||||
barrierColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
FullPostView(originPostModel: widget.model),
|
||||
|
|
|
@ -18,7 +18,7 @@ bool checkActive(Set<MaterialState> 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),
|
||||
|
|
Loading…
Reference in New Issue