mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +08:00
Add a Feature Timeline screen
This commit is contained in:
@ -182,7 +182,7 @@ feature:
|
|||||||
fileNameCustomize: Customize Note FileName
|
fileNameCustomize: Customize Note FileName
|
||||||
noteMetaDataCustomize:
|
noteMetaDataCustomize:
|
||||||
title: Customize Note Metadata
|
title: Customize Note Metadata
|
||||||
subtitle: Allows GitJorunal to be used with static website generators
|
subtitle: Allows GitJournal to be used with static website generators
|
||||||
autoMergeConflicts: Automation Merge Conflict Resolution
|
autoMergeConflicts: Automation Merge Conflict Resolution
|
||||||
noteSorting: Configurable Note Sorting
|
noteSorting: Configurable Note Sorting
|
||||||
gitPushFreq: Configurable Git Sync Frequency
|
gitPushFreq: Configurable Git Sync Frequency
|
||||||
@ -203,6 +203,12 @@ feature:
|
|||||||
yamlTagsKey: Customize the YAML tags key
|
yamlTagsKey: Customize the YAML tags key
|
||||||
disableYamlHeader: Disable YAML Metadata Header
|
disableYamlHeader: Disable YAML Metadata Header
|
||||||
customizeHomeScreen: Customize Home Screen
|
customizeHomeScreen: Customize Home Screen
|
||||||
|
zenMode: Zen Writing Mode
|
||||||
emojiSupport:
|
emojiSupport:
|
||||||
title: Emoji Support
|
title: Emoji Support
|
||||||
subtitle: "Convert :heart: to ❤️"
|
subtitle: "Convert :heart: to ❤️"
|
||||||
|
allNotesView: Add a screen to show "All Notes"
|
||||||
|
basicSearch: Basic Search
|
||||||
|
|
||||||
|
feature_timeline:
|
||||||
|
title: Feature Timeline
|
||||||
|
@ -4,6 +4,7 @@ class Features {
|
|||||||
static bool perFolderConfig = false;
|
static bool perFolderConfig = false;
|
||||||
|
|
||||||
static final all = <Feature>[
|
static final all = <Feature>[
|
||||||
|
Feature.basicSearch,
|
||||||
Feature.darkMode,
|
Feature.darkMode,
|
||||||
Feature.rawEditor,
|
Feature.rawEditor,
|
||||||
Feature.folderSupport,
|
Feature.folderSupport,
|
||||||
@ -17,6 +18,7 @@ class Features {
|
|||||||
Feature.checkListEditor,
|
Feature.checkListEditor,
|
||||||
Feature.disableYamlHeader,
|
Feature.disableYamlHeader,
|
||||||
Feature.journalEditor,
|
Feature.journalEditor,
|
||||||
|
Feature.allNotesView,
|
||||||
Feature.diffViews,
|
Feature.diffViews,
|
||||||
Feature.journalEditorDefaultFolder,
|
Feature.journalEditorDefaultFolder,
|
||||||
Feature.customizeHomeScreen,
|
Feature.customizeHomeScreen,
|
||||||
@ -43,6 +45,14 @@ class Feature {
|
|||||||
|
|
||||||
Feature(this.featureName, this.date, this.title, this.subtitle, this.pro);
|
Feature(this.featureName, this.date, this.title, this.subtitle, this.pro);
|
||||||
|
|
||||||
|
static final basicSearch = Feature(
|
||||||
|
"DarkMode",
|
||||||
|
DateTime(2019, 09, 15),
|
||||||
|
tr("feature.basicSearch"),
|
||||||
|
"",
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
|
||||||
static final darkMode = Feature(
|
static final darkMode = Feature(
|
||||||
"DarkMode",
|
"DarkMode",
|
||||||
DateTime(2019, 09, 25),
|
DateTime(2019, 09, 25),
|
||||||
@ -147,6 +157,14 @@ class Feature {
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static final allNotesView = Feature(
|
||||||
|
"AllNotesView",
|
||||||
|
DateTime(2020, 03, 15),
|
||||||
|
tr("feature.allNotesView"),
|
||||||
|
"",
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
|
||||||
static final diffViews = Feature(
|
static final diffViews = Feature(
|
||||||
"DiffViews",
|
"DiffViews",
|
||||||
DateTime(2020, 04, 01),
|
DateTime(2020, 04, 01),
|
||||||
|
97
lib/screens/feature_timeline_screen.dart
Normal file
97
lib/screens/feature_timeline_screen.dart
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gitjournal/features.dart';
|
||||||
|
|
||||||
|
class FeatureTimelineScreen extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(tr('feature_timeline.title')),
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
children: [
|
||||||
|
for (var feature in Features.all) FeatureTile(feature),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FeatureTile extends StatelessWidget {
|
||||||
|
final Feature feature;
|
||||||
|
|
||||||
|
FeatureTile(this.feature);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var dateStr = feature.date.toIso8601String().substring(0, 10);
|
||||||
|
var subtitle = dateStr;
|
||||||
|
if (feature.subtitle.isNotEmpty) {
|
||||||
|
subtitle += ' - ' + feature.subtitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
var theme = Theme.of(context);
|
||||||
|
var textTheme = theme.textTheme;
|
||||||
|
var titleTextStyle = textTheme.subtitle1.copyWith();
|
||||||
|
var subTitleTextStyle = textTheme.bodyText2.copyWith(
|
||||||
|
color: textTheme.caption.color,
|
||||||
|
);
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 10.0,
|
||||||
|
horizontal: 16.0,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 56.0,
|
||||||
|
child: feature.pro ? _Sign('PRO') : _Sign("FREE"),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(feature.title, style: titleTextStyle),
|
||||||
|
const SizedBox(height: 4.0),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
subtitle,
|
||||||
|
style: subTitleTextStyle,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
softWrap: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Sign extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
_Sign(this.text);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var theme = Theme.of(context);
|
||||||
|
var textStyle = theme.textTheme.subtitle2;
|
||||||
|
if (text == 'PRO') {
|
||||||
|
if (theme.brightness == Brightness.light) {
|
||||||
|
textStyle = textStyle.copyWith(color: theme.primaryColor);
|
||||||
|
} else {
|
||||||
|
textStyle = textStyle.copyWith(color: theme.accentColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Text(text, style: textStyle);
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import 'package:dynamic_theme/dynamic_theme.dart';
|
import 'package:dynamic_theme/dynamic_theme.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:gitjournal/screens/feature_timeline_screen.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@ -252,7 +253,17 @@ class SettingsListState extends State<SettingsList> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
SettingsHeader(tr('settings.analytics')),
|
ListTile(
|
||||||
|
title: Text(tr("feature_timeline.title")),
|
||||||
|
onTap: () {
|
||||||
|
var route = MaterialPageRoute(
|
||||||
|
builder: (context) => FeatureTimelineScreen(),
|
||||||
|
settings: const RouteSettings(name: '/featureTimeline'),
|
||||||
|
);
|
||||||
|
Navigator.of(context).push(route);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16.0),
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
title: Text(tr('settings.usageStats')),
|
title: Text(tr('settings.usageStats')),
|
||||||
value: settings.collectUsageStatistics,
|
value: settings.collectUsageStatistics,
|
||||||
|
Reference in New Issue
Block a user