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:flutter/material.dart';
|
||||||
import 'package:localization/localization.dart';
|
import 'package:localization/localization.dart';
|
||||||
import 'package:loris/business_logic/network_tools/get_post_from_url.dart';
|
import 'package:loris/business_logic/network_tools/get_post_from_url.dart';
|
||||||
|
@ -112,97 +114,103 @@ class _FullPostViewState extends State<FullPostView> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
return SimpleDialog(
|
return BackdropFilter(
|
||||||
contentPadding: const EdgeInsets.fromLTRB(0, 24, 0, 0),
|
filter:
|
||||||
children: [
|
ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror),
|
||||||
global.settings!.identities.length > idsChecked
|
child: SimpleDialog(
|
||||||
? Column(
|
contentPadding: const EdgeInsets.fromLTRB(0, 24, 0, 0),
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
children: [
|
||||||
children: [
|
global.settings!.identities.length > idsChecked
|
||||||
SelectableText(
|
? Column(
|
||||||
"${"post-found-on".i18n()} $idsChecked ${idsChecked == 1 ? "instance".i18n() : "instances".i18n()}",
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
const LinearProgressIndicator(),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Padding(
|
|
||||||
padding: themes.defaultInsideMargins,
|
|
||||||
child: Wrap(
|
|
||||||
alignment: WrapAlignment.spaceAround,
|
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
DropdownButtonHideUnderline(
|
SelectableText(
|
||||||
child: DropdownButton<String>(
|
"${"post-found-on".i18n()} $idsChecked ${idsChecked == 1 ? "instance".i18n() : "instances".i18n()}",
|
||||||
alignment: Alignment.center,
|
textAlign: TextAlign.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();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (sensitive || widget.forceSensitive)
|
const LinearProgressIndicator(),
|
||||||
ElevatedButton.icon(
|
],
|
||||||
onPressed: () {
|
)
|
||||||
setState(() {
|
: Padding(
|
||||||
Navigator.of(context).pop();
|
padding: themes.defaultInsideMargins,
|
||||||
showDialog(
|
child: Wrap(
|
||||||
context: context,
|
alignment: WrapAlignment.spaceAround,
|
||||||
builder: (context) => FullPostView(
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
originPostModel: widget.originPostModel,
|
children: [
|
||||||
hidden: !widget.hidden,
|
DropdownButtonHideUnderline(
|
||||||
identities: identities,
|
child: DropdownButton<String>(
|
||||||
ancestors: ancestors,
|
alignment: Alignment.center,
|
||||||
descendants: descendants,
|
value: activeIdentity,
|
||||||
forceSensitive: true,
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
),
|
iconEnabledColor:
|
||||||
);
|
Theme.of(context).colorScheme.onSurface,
|
||||||
});
|
items: dropdownButtons,
|
||||||
},
|
onChanged: (value) {
|
||||||
icon: Icon(widget.hidden
|
setState(() {
|
||||||
? Icons.visibility
|
Navigator.of(context).pop();
|
||||||
: Icons.visibility_off),
|
showDialog(
|
||||||
label: Text(
|
barrierColor: Colors.transparent,
|
||||||
widget.hidden ? "show".i18n() : "hide".i18n(),
|
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);
|
c.addAll(descendantsWidgets);
|
||||||
return Container(
|
return Container(
|
||||||
padding:
|
padding: EdgeInsets.fromLTRB(
|
||||||
EdgeInsets.fromLTRB(level == 0 ? 0 : 4, 0, level == 0 ? 0 : 4, 0),
|
level == 0 ? 0 : 4,
|
||||||
|
themes.defaultSeperatorHeight,
|
||||||
|
level == 0 ? 0 : 4,
|
||||||
|
themes.defaultSeperatorHeight),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: level == 0
|
border: level == 0
|
||||||
? const Border()
|
? const Border()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:localization/localization.dart';
|
import 'package:localization/localization.dart';
|
||||||
|
@ -391,31 +392,35 @@ class _MakePostState extends State<MakePost> {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return SimpleDialog(
|
return BackdropFilter(
|
||||||
titlePadding: const EdgeInsets.all(0),
|
filter:
|
||||||
alignment: Alignment.center,
|
ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror),
|
||||||
contentPadding: themes.defaultMargins,
|
child: SimpleDialog(
|
||||||
title: Column(
|
titlePadding: const EdgeInsets.all(0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
contentPadding: themes.defaultMargins,
|
||||||
|
title: Column(
|
||||||
|
children: [
|
||||||
|
if (status != null) SelectableText(status!),
|
||||||
|
if (sending) const LinearProgressIndicator(),
|
||||||
|
],
|
||||||
|
),
|
||||||
children: [
|
children: [
|
||||||
if (status != null) SelectableText(status!),
|
SingleChildScrollView(
|
||||||
if (sending) const LinearProgressIndicator(),
|
child: Container(
|
||||||
],
|
width: (MediaQuery.of(context).size.width *
|
||||||
),
|
global.settings!.postWidth) -
|
||||||
children: [
|
56,
|
||||||
SingleChildScrollView(
|
constraints: global.getConstraints(context),
|
||||||
child: Container(
|
child: Column(
|
||||||
width: (MediaQuery.of(context).size.width *
|
mainAxisSize: MainAxisSize.min,
|
||||||
global.settings!.postWidth) -
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
56,
|
children: c,
|
||||||
constraints: global.getConstraints(context),
|
),
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: c,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:localization/localization.dart';
|
import 'package:localization/localization.dart';
|
||||||
|
@ -168,75 +169,83 @@ class _ProfileViewState extends State<ProfileView> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return SimpleDialog(
|
return BackdropFilter(
|
||||||
alignment: Alignment.center,
|
filter:
|
||||||
title: DisplayName(
|
ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror),
|
||||||
account: identities[activeIdentity]!,
|
child: SimpleDialog(
|
||||||
openInBrowser: true,
|
alignment: Alignment.center,
|
||||||
),
|
title: DisplayName(
|
||||||
contentPadding: const EdgeInsets.all(0),
|
account: identities[activeIdentity]!,
|
||||||
children: [
|
openInBrowser: true,
|
||||||
Column(children: [
|
),
|
||||||
loading
|
contentPadding: const EdgeInsets.all(0),
|
||||||
? Column(
|
children: [
|
||||||
children: [
|
Column(children: [
|
||||||
SelectableText(
|
loading
|
||||||
"${"found-account-on".i18n()} ${identities.length} ${identities.length <= 1 ? "instance" : "instances".i18n()}"),
|
? Column(
|
||||||
const LinearProgressIndicator(),
|
children: [
|
||||||
],
|
SelectableText(
|
||||||
)
|
"${"found-account-on".i18n()} ${identities.length} ${identities.length <= 1 ? "instance" : "instances".i18n()}"),
|
||||||
: Row(
|
const LinearProgressIndicator(),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
],
|
||||||
children: [
|
)
|
||||||
DropdownButtonHideUnderline(
|
: Row(
|
||||||
child: DropdownButton(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
isExpanded: false,
|
children: [
|
||||||
alignment: Alignment.center,
|
DropdownButtonHideUnderline(
|
||||||
iconEnabledColor:
|
child: DropdownButton(
|
||||||
Theme.of(context).colorScheme.onSurface,
|
isExpanded: false,
|
||||||
value: activeIdentity,
|
alignment: Alignment.center,
|
||||||
items: dmenuItems,
|
iconEnabledColor:
|
||||||
onChanged: (value) {
|
Theme.of(context).colorScheme.onSurface,
|
||||||
setState(() {
|
value: activeIdentity,
|
||||||
activeIdentity = value.toString();
|
items: dmenuItems,
|
||||||
});
|
onChanged: (value) {
|
||||||
reloadPosts();
|
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(
|
controller: _scrollController,
|
||||||
constraints: global.getConstraints(context),
|
itemCount: threads.length + 2,
|
||||||
width: global.getWidth(context) +
|
itemBuilder: (context, index) {
|
||||||
MediaQuery.of(context).size.width * 0.2,
|
if (index == 0) {
|
||||||
height: MediaQuery.of(context).size.height * 2 / 3,
|
return profileViewDisplay;
|
||||||
child: ListView.separated(
|
} else if (index > 0 && index <= threads.length) {
|
||||||
separatorBuilder: (context, index) => const Divider(
|
return Padding(
|
||||||
color: Colors.transparent,
|
padding: const EdgeInsets.fromLTRB(
|
||||||
height: themes.defaultSeperatorHeight,
|
themes.defaultSeperatorHeight * 2,
|
||||||
),
|
0,
|
||||||
controller: _scrollController,
|
themes.defaultSeperatorHeight * 2,
|
||||||
itemCount: threads.length + 2,
|
0),
|
||||||
itemBuilder: (context, index) {
|
child: Thread(
|
||||||
if (index == 0) {
|
model: threads[index - 1],
|
||||||
return profileViewDisplay;
|
constrained: false,
|
||||||
} else if (index > 0 && index <= threads.length) {
|
),
|
||||||
return Padding(
|
);
|
||||||
padding: themes.defaultMargins,
|
}
|
||||||
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)
|
if (relationshipModel != null)
|
||||||
Padding(
|
Padding(
|
||||||
padding: themes.defaultMargins,
|
padding: const EdgeInsets.all(themes.defaultSeperatorHeight),
|
||||||
child: AccountInteractionButtons(
|
child: AccountInteractionButtons(
|
||||||
account: accountModel,
|
account: accountModel,
|
||||||
relationship: relationshipModel!,
|
relationship: relationshipModel!,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:localization/localization.dart';
|
import 'package:localization/localization.dart';
|
||||||
import 'package:loris/business_logic/account/account.dart';
|
import 'package:loris/business_logic/account/account.dart';
|
||||||
|
@ -53,76 +55,80 @@ class _SearchDialogueState extends State<SearchDialogue> {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return SimpleDialog(
|
return BackdropFilter(
|
||||||
contentPadding: const EdgeInsets.all(0),
|
filter:
|
||||||
titlePadding: const EdgeInsets.all(0),
|
ImageFilter.blur(sigmaX: 10, sigmaY: 10, tileMode: TileMode.mirror),
|
||||||
title: Column(
|
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: [
|
children: [
|
||||||
TextField(
|
Container(
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
width: global.getWidth(context),
|
||||||
autofocus: true,
|
constraints: BoxConstraints(
|
||||||
keyboardType: TextInputType.url,
|
maxWidth: global.getConstraints(context).maxWidth,
|
||||||
onEditingComplete: () {
|
maxHeight: MediaQuery.of(context).size.height * 2 / 3,
|
||||||
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(),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
child: ListView.builder(
|
||||||
),
|
itemCount: accountModels.length + postModels.length,
|
||||||
children: [
|
itemBuilder: (context, index) {
|
||||||
Container(
|
if (index < accountModels.length) {
|
||||||
width: global.getWidth(context),
|
final model = accountModels[index];
|
||||||
constraints: BoxConstraints(
|
return Padding(
|
||||||
maxWidth: global.getConstraints(context).maxWidth,
|
padding: themes.defaultMargins,
|
||||||
maxHeight: MediaQuery.of(context).size.height * 2 / 3,
|
child: Column(
|
||||||
),
|
children: [
|
||||||
child: ListView.builder(
|
SelectableText(model.identity),
|
||||||
itemCount: accountModels.length + postModels.length,
|
DisplayName(account: model)
|
||||||
itemBuilder: (context, index) {
|
],
|
||||||
if (index < accountModels.length) {
|
),
|
||||||
final model = accountModels[index];
|
);
|
||||||
|
}
|
||||||
|
final model = postModels[index - accountModels.length];
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: themes.defaultMargins,
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SelectableText(model.identity),
|
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(
|
InkWell(
|
||||||
borderRadius: const BorderRadius.all(themes.defaultRadius),
|
borderRadius: const BorderRadius.all(themes.defaultRadius),
|
||||||
onTap: () => showDialog(
|
onTap: () => showDialog(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => ProfileView(model: model.account),
|
builder: (context) => ProfileView(model: model.account),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:localization/localization.dart';
|
import 'package:localization/localization.dart';
|
||||||
|
import 'package:loris/dialogues/makepost.dart';
|
||||||
import 'package:loris/dialogues/search.dart';
|
import 'package:loris/dialogues/search.dart';
|
||||||
import 'package:loris/partials/thread.dart';
|
import 'package:loris/partials/thread.dart';
|
||||||
import '../../business_logic/timeline/timeline.dart' as tl;
|
import '../../business_logic/timeline/timeline.dart' as tl;
|
||||||
|
@ -103,124 +104,147 @@ class TimelineState extends State<Timeline> {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
selectedId = global.settings!.activeIdentity;
|
selectedId = global.settings!.activeIdentity;
|
||||||
return Column(
|
return SizedBox(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
height: MediaQuery.of(context).size.height - 52,
|
||||||
children: [
|
child: Column(
|
||||||
Material(
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
color: Theme.of(context).colorScheme.surface,
|
children: [
|
||||||
child: Wrap(
|
Expanded(
|
||||||
alignment: WrapAlignment.spaceEvenly,
|
child: ListView.separated(
|
||||||
children: [
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
IconButton(
|
controller: controller,
|
||||||
onPressed: () {
|
itemBuilder: (context, index) {
|
||||||
reload();
|
return children[index];
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.refresh),
|
separatorBuilder: (context, index) {
|
||||||
),
|
return const Divider(
|
||||||
IconButton(
|
color: Colors.transparent,
|
||||||
onPressed: () => showDialog(
|
height: themes.defaultSeperatorHeight,
|
||||||
context: context,
|
);
|
||||||
builder: (context) => const SearchDialogue(),
|
},
|
||||||
),
|
itemCount: children.length,
|
||||||
icon: const Icon(Icons.search)),
|
addAutomaticKeepAlives: false,
|
||||||
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();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
Expanded(
|
decoration: BoxDecoration(
|
||||||
child: ListView.separated(
|
border: Border(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
top: BorderSide(
|
||||||
controller: controller,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
itemBuilder: (context, index) {
|
width: 2,
|
||||||
return children[index];
|
),
|
||||||
},
|
)),
|
||||||
separatorBuilder: (context, index) {
|
child: Material(
|
||||||
return const Divider(
|
color: Theme.of(context).colorScheme.surface,
|
||||||
color: Colors.transparent,
|
child: Wrap(
|
||||||
height: themes.defaultSeperatorHeight,
|
spacing: 18,
|
||||||
);
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
},
|
alignment: WrapAlignment.spaceEvenly,
|
||||||
itemCount: children.length,
|
children: [
|
||||||
addAutomaticKeepAlives: false,
|
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:flutter/material.dart';
|
||||||
import 'package:localization/localization.dart';
|
import 'package:localization/localization.dart';
|
||||||
import 'package:loris/dialogues/makepost.dart';
|
|
||||||
import 'package:loris/pages/chat/chat.dart';
|
import 'package:loris/pages/chat/chat.dart';
|
||||||
import 'package:loris/pages/notifications/notifications.dart';
|
import 'package:loris/pages/notifications/notifications.dart';
|
||||||
import 'package:loris/pages/timeline/timeline.dart';
|
import 'package:loris/pages/timeline/timeline.dart';
|
||||||
|
@ -47,13 +46,7 @@ class _MainScaffoldState extends State<MainScaffold> {
|
||||||
settings(context),
|
settings(context),
|
||||||
];
|
];
|
||||||
final buttons = [
|
final buttons = [
|
||||||
FloatingActionButton(
|
null,
|
||||||
child: const Icon(Icons.create),
|
|
||||||
onPressed: () => showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => const MakePost(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: const Icon(Icons.person_add),
|
child: const Icon(Icons.person_add),
|
||||||
|
@ -63,35 +56,39 @@ class _MainScaffoldState extends State<MainScaffold> {
|
||||||
];
|
];
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
extendBody: true,
|
extendBody: false,
|
||||||
body: IndexedStack(
|
body: IndexedStack(
|
||||||
index: index,
|
index: index,
|
||||||
children: screens,
|
children: screens,
|
||||||
),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||||
floatingActionButton: buttons[index],
|
floatingActionButton: buttons[index],
|
||||||
bottomNavigationBar: BottomAppBar(
|
bottomNavigationBar: SizedBox(
|
||||||
child: NavigationBar(
|
height: 52,
|
||||||
onDestinationSelected: (index) => setState(() {
|
child: BottomAppBar(
|
||||||
this.index = index;
|
child: NavigationBar(
|
||||||
if (index == 2) {
|
onDestinationSelected: (index) => setState(() {
|
||||||
unreadNotifs = 0;
|
this.index = index;
|
||||||
}
|
if (index == 2) {
|
||||||
}),
|
unreadNotifs = 0;
|
||||||
selectedIndex: index,
|
}
|
||||||
destinations: [
|
}),
|
||||||
NavigationDestination(
|
selectedIndex: index,
|
||||||
icon: const Icon(Icons.forum), label: "timeline".i18n()),
|
destinations: [
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
icon: const Icon(Icons.chat), label: "chat".i18n()),
|
icon: const Icon(Icons.forum), label: "timeline".i18n()),
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
icon: Icon((unreadNotifs >= 1)
|
icon: const Icon(Icons.chat), label: "chat".i18n()),
|
||||||
? Icons.notifications_active
|
NavigationDestination(
|
||||||
: Icons.notifications),
|
icon: Icon((unreadNotifs >= 1)
|
||||||
label: "notifications".i18n()),
|
? Icons.notifications_active
|
||||||
NavigationDestination(
|
: Icons.notifications),
|
||||||
icon: const Icon(Icons.settings), label: "settings".i18n()),
|
label: "notifications".i18n()),
|
||||||
]),
|
NavigationDestination(
|
||||||
|
icon: const Icon(Icons.settings),
|
||||||
|
label: "settings".i18n()),
|
||||||
|
]),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -93,6 +93,7 @@ class DisplayName extends StatelessWidget {
|
||||||
onTap: !openInBrowser
|
onTap: !openInBrowser
|
||||||
? () {
|
? () {
|
||||||
showDialog(
|
showDialog(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => ProfileView(model: account),
|
builder: (context) => ProfileView(model: account),
|
||||||
);
|
);
|
||||||
|
@ -232,6 +233,7 @@ class _PostBodyState extends State<PostBody> {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
borderRadius: const BorderRadius.all(themes.defaultRadius),
|
borderRadius: const BorderRadius.all(themes.defaultRadius),
|
||||||
onTap: () => showDialog(
|
onTap: () => showDialog(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => FullPostView(originPostModel: widget.model),
|
builder: (context) => FullPostView(originPostModel: widget.model),
|
||||||
),
|
),
|
||||||
|
@ -323,6 +325,7 @@ class _PostActionBarState extends State<PostActionBar> {
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: ((context) => MakePost(
|
builder: ((context) => MakePost(
|
||||||
inReplyTo: widget.model,
|
inReplyTo: widget.model,
|
||||||
|
@ -352,6 +355,7 @@ class _PostActionBarState extends State<PostActionBar> {
|
||||||
tooltip: "show-in-full".i18n(),
|
tooltip: "show-in-full".i18n(),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => FullPostView(
|
builder: (context) => FullPostView(
|
||||||
originPostModel: widget.model,
|
originPostModel: widget.model,
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:clipboard/clipboard.dart';
|
||||||
|
|
||||||
void popupPostOptions(context, PostModel model) {
|
void popupPostOptions(context, PostModel model) {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => PostOptions(model: model),
|
builder: (context) => PostOptions(model: model),
|
||||||
);
|
);
|
||||||
|
@ -52,6 +53,7 @@ class _PostOptionsState extends State<PostOptions> {
|
||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => showDialog(
|
onPressed: () => showDialog(
|
||||||
|
barrierColor: Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
FullPostView(originPostModel: widget.model),
|
FullPostView(originPostModel: widget.model),
|
||||||
|
|
|
@ -18,7 +18,7 @@ bool checkActive(Set<MaterialState> states) {
|
||||||
const defaultRadius = Radius.circular(8);
|
const defaultRadius = Radius.circular(8);
|
||||||
const defaultSeperatorHeight = 4.0;
|
const defaultSeperatorHeight = 4.0;
|
||||||
const defaultInsideMargins = EdgeInsets.all(18);
|
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
|
// color schemes to pick from can be added here
|
||||||
// there is a class to create these
|
// there is a class to create these
|
||||||
|
@ -175,6 +175,9 @@ ThemeData getTheme(CustomColors colors) {
|
||||||
color: colors.colorScheme.surface,
|
color: colors.colorScheme.surface,
|
||||||
),
|
),
|
||||||
navigationBarTheme: NavigationBarThemeData(
|
navigationBarTheme: NavigationBarThemeData(
|
||||||
|
indicatorShape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(defaultRadius),
|
||||||
|
),
|
||||||
labelTextStyle: MaterialStateProperty.all(
|
labelTextStyle: MaterialStateProperty.all(
|
||||||
TextStyle(
|
TextStyle(
|
||||||
color: colors.colorScheme.onSurface,
|
color: colors.colorScheme.onSurface,
|
||||||
|
@ -182,10 +185,10 @@ ThemeData getTheme(CustomColors colors) {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
|
||||||
indicatorColor: Colors.transparent,
|
indicatorColor: colors.hoverColor,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
height: 64,
|
height: 52,
|
||||||
),
|
),
|
||||||
scrollbarTheme: ScrollbarThemeData(
|
scrollbarTheme: ScrollbarThemeData(
|
||||||
thumbColor: MaterialStateProperty.all(colors.hintColor),
|
thumbColor: MaterialStateProperty.all(colors.hintColor),
|
||||||
|
|
Loading…
Reference in New Issue