minor fixes
This commit is contained in:
parent
7eee9bacd5
commit
c742b72f70
8 changed files with 49 additions and 22 deletions
|
@ -43,7 +43,7 @@ class LocationFilter extends CollectionFilter {
|
||||||
@override
|
@override
|
||||||
Widget iconBuilder(BuildContext context, double size, {bool showGenericIcon = true, bool embossed = false}) {
|
Widget iconBuilder(BuildContext context, double size, {bool showGenericIcon = true, bool embossed = false}) {
|
||||||
final flag = countryCodeToFlag(_countryCode);
|
final flag = countryCodeToFlag(_countryCode);
|
||||||
// as of Flutter v1.22.0-12.1.pre emoji shadows are rendered as colorful duplicates,
|
// as of Flutter v1.22.3, emoji shadows are rendered as colorful duplicates,
|
||||||
// not filled with the shadow color as expected, so we remove them
|
// not filled with the shadow color as expected, so we remove them
|
||||||
if (flag != null) return Text(flag, style: TextStyle(fontSize: size, shadows: []));
|
if (flag != null) return Text(flag, style: TextStyle(fontSize: size, shadows: []));
|
||||||
return Icon(_location.isEmpty ? AIcons.locationOff : AIcons.location, size: size);
|
return Icon(_location.isEmpty ? AIcons.locationOff : AIcons.location, size: size);
|
||||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/painting.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class Constants {
|
class Constants {
|
||||||
// as of Flutter v1.11.0, overflowing `Text` miscalculates height and some text (e.g. 'Å') is clipped
|
// as of Flutter v1.22.3, overflowing `Text` miscalculates height and some text (e.g. 'Å') is clipped
|
||||||
// so we give it a `strutStyle` with a slightly larger height
|
// so we give it a `strutStyle` with a slightly larger height
|
||||||
static const overflowStrutStyle = StrutStyle(height: 1.3);
|
static const overflowStrutStyle = StrutStyle(height: 1.3);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ class SectionHeader extends StatelessWidget {
|
||||||
final para = RenderParagraph(
|
final para = RenderParagraph(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
// `RenderParagraph` fails to lay out `WidgetSpan` offscreen as of Flutter v1.17.0
|
// as of Flutter v1.22.3, `RenderParagraph` fails to lay out `WidgetSpan` offscreen
|
||||||
// so we use a hair space times a magic number to match width
|
// so we use a hair space times a magic number to match width
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: '\u200A' * (hasLeading ? 23 : 1),
|
text: '\u200A' * (hasLeading ? 23 : 1),
|
||||||
|
|
|
@ -10,9 +10,9 @@ import 'package:aves/widgets/fullscreen/fullscreen_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
// use a `SliverList` instead of multiple `SliverGrid` because having one `SliverGrid` per section does not scale up
|
// Use a `SliverList` instead of multiple `SliverGrid` because having one `SliverGrid` per section does not scale up.
|
||||||
// with the multiple `SliverGrid` solution, thumbnails at the beginning of each sections are built even though they are offscreen
|
// With the multiple `SliverGrid` solution, thumbnails at the beginning of each sections are built even though they are offscreen
|
||||||
// because of `RenderSliverMultiBoxAdaptor.addInitialChild` called by `RenderSliverGrid.performLayout` (line 547), as of Flutter v1.17.0
|
// because of `RenderSliverMultiBoxAdaptor.addInitialChild` called by `RenderSliverGrid.performLayout` (line 547), as of Flutter v1.17.0.
|
||||||
class CollectionListSliver extends StatelessWidget {
|
class CollectionListSliver extends StatelessWidget {
|
||||||
const CollectionListSliver();
|
const CollectionListSliver();
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:aves/model/settings/home_page.dart';
|
||||||
import 'package:aves/model/settings/screen_on.dart';
|
import 'package:aves/model/settings/screen_on.dart';
|
||||||
import 'package:aves/model/settings/settings.dart';
|
import 'package:aves/model/settings/settings.dart';
|
||||||
import 'package:aves/utils/constants.dart';
|
import 'package:aves/utils/constants.dart';
|
||||||
|
import 'package:aves/utils/durations.dart';
|
||||||
import 'package:aves/widgets/common/aves_expansion_tile.dart';
|
import 'package:aves/widgets/common/aves_expansion_tile.dart';
|
||||||
import 'package:aves/widgets/common/aves_selection_dialog.dart';
|
import 'package:aves/widgets/common/aves_selection_dialog.dart';
|
||||||
import 'package:aves/widgets/common/data_providers/media_query_data_provider.dart';
|
import 'package:aves/widgets/common/data_providers/media_query_data_provider.dart';
|
||||||
|
@ -10,6 +11,7 @@ import 'package:aves/widgets/common/highlight_title.dart';
|
||||||
import 'package:aves/widgets/settings/access_grants.dart';
|
import 'package:aves/widgets/settings/access_grants.dart';
|
||||||
import 'package:aves/widgets/settings/svg_background.dart';
|
import 'package:aves/widgets/settings/svg_background.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class SettingsPage extends StatefulWidget {
|
class SettingsPage extends StatefulWidget {
|
||||||
|
@ -33,16 +35,28 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Consumer<Settings>(
|
child: Consumer<Settings>(
|
||||||
builder: (context, settings, child) => ListView(
|
builder: (context, settings, child) => AnimationLimiter(
|
||||||
padding: EdgeInsets.all(8),
|
child: ListView(
|
||||||
children: [
|
padding: EdgeInsets.all(8),
|
||||||
_buildNavigationSection(context),
|
children: AnimationConfiguration.toStaggeredList(
|
||||||
_buildDisplaySection(context),
|
duration: Durations.staggeredAnimation,
|
||||||
_buildThumbnailsSection(context),
|
delay: Durations.staggeredAnimationDelay,
|
||||||
_buildViewerSection(context),
|
childAnimationBuilder: (child) => SlideAnimation(
|
||||||
_buildSearchSection(context),
|
verticalOffset: 50.0,
|
||||||
_buildPrivacySection(context),
|
child: FadeInAnimation(
|
||||||
],
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
_buildNavigationSection(context),
|
||||||
|
_buildDisplaySection(context),
|
||||||
|
_buildThumbnailsSection(context),
|
||||||
|
_buildViewerSection(context),
|
||||||
|
_buildSearchSection(context),
|
||||||
|
_buildPrivacySection(context),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:aves/model/filters/filters.dart';
|
||||||
import 'package:aves/model/settings/settings.dart';
|
import 'package:aves/model/settings/settings.dart';
|
||||||
import 'package:aves/model/source/collection_lens.dart';
|
import 'package:aves/model/source/collection_lens.dart';
|
||||||
import 'package:aves/utils/color_utils.dart';
|
import 'package:aves/utils/color_utils.dart';
|
||||||
|
import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/widgets/collection/collection_page.dart';
|
import 'package:aves/widgets/collection/collection_page.dart';
|
||||||
import 'package:aves/widgets/common/aves_filter_chip.dart';
|
import 'package:aves/widgets/common/aves_filter_chip.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
@ -50,7 +51,10 @@ class FilterTable extends StatelessWidget {
|
||||||
return TableRow(
|
return TableRow(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(bottom: 8),
|
// the `Table` `border` property paints on the cells and does not add margins,
|
||||||
|
// so we define margins here instead, but they should be symmetric
|
||||||
|
// to keep all cells vertically aligned on the center/middle
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 4),
|
||||||
alignment: AlignmentDirectional.centerStart,
|
alignment: AlignmentDirectional.centerStart,
|
||||||
child: AvesFilterChip(
|
child: AvesFilterChip(
|
||||||
filter: filter,
|
filter: filter,
|
||||||
|
@ -65,7 +69,10 @@ class FilterTable extends StatelessWidget {
|
||||||
progressColor: stringToColor(label),
|
progressColor: stringToColor(label),
|
||||||
animation: true,
|
animation: true,
|
||||||
padding: EdgeInsets.symmetric(horizontal: lineHeight),
|
padding: EdgeInsets.symmetric(horizontal: lineHeight),
|
||||||
center: Text(NumberFormat.percentPattern().format(percent)),
|
center: Text(
|
||||||
|
NumberFormat.percentPattern().format(percent),
|
||||||
|
style: TextStyle(shadows: [Constants.embossShadow]),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'$count',
|
'$count',
|
||||||
|
|
|
@ -90,7 +90,10 @@ class StatsPage extends StatelessWidget {
|
||||||
leading: Icon(AIcons.location),
|
leading: Icon(AIcons.location),
|
||||||
// right padding to match leading, so that inside label is aligned with outside label below
|
// right padding to match leading, so that inside label is aligned with outside label below
|
||||||
padding: EdgeInsets.symmetric(horizontal: lineHeight) + EdgeInsets.only(right: 24),
|
padding: EdgeInsets.symmetric(horizontal: lineHeight) + EdgeInsets.only(right: 24),
|
||||||
center: Text(NumberFormat.percentPattern().format(withGpsPercent)),
|
center: Text(
|
||||||
|
NumberFormat.percentPattern().format(withGpsPercent),
|
||||||
|
style: TextStyle(shadows: [Constants.embossShadow]),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
Text('${withGps.length} ${Intl.plural(withGps.length, one: 'item', other: 'items')} with location'),
|
Text('${withGps.length} ${Intl.plural(withGps.length, one: 'item', other: 'items')} with location'),
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:aves/utils/durations.dart';
|
||||||
import 'package:aves/widgets/common/aves_logo.dart';
|
import 'package:aves/widgets/common/aves_logo.dart';
|
||||||
import 'package:aves/widgets/common/labeled_checkbox.dart';
|
import 'package:aves/widgets/common/labeled_checkbox.dart';
|
||||||
import 'package:aves/widgets/home_page.dart';
|
import 'package:aves/widgets/home_page.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
|
@ -24,6 +25,9 @@ class _WelcomePageState extends State<WelcomePage> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_termsLoader = rootBundle.loadString('assets/terms.md');
|
_termsLoader = rootBundle.loadString('assets/terms.md');
|
||||||
|
if (!kReleaseMode) {
|
||||||
|
settings.isCrashlyticsEnabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -167,9 +171,8 @@ class _WelcomePageState extends State<WelcomePage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// workaround to handle `Flexible` widgets,
|
// as of flutter_staggered_animations v0.1.2, `AnimationConfiguration.toStaggeredList` does not handle `Flexible` widgets
|
||||||
// because `AnimationConfiguration.toStaggeredList` does not,
|
// so we use this workaround instead
|
||||||
// as of flutter_staggered_animations v0.1.2,
|
|
||||||
static List<Widget> _toStaggeredList({
|
static List<Widget> _toStaggeredList({
|
||||||
Duration duration,
|
Duration duration,
|
||||||
Duration delay,
|
Duration delay,
|
||||||
|
|
Loading…
Reference in a new issue