Compare commits
9 Commits
77a647d17d
...
v0.1.25
| Author | SHA1 | Date | |
|---|---|---|---|
| dca8c64555 | |||
| c80606b7d0 | |||
| be6020d6c5 | |||
| 5eb58d7cf2 | |||
| 306a38a36a | |||
| 1aaea5f6d9 | |||
| 99a8aaa409 | |||
| 85d57c6e1c | |||
| 3a54a077f3 |
@@ -9,66 +9,15 @@ on:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
calculate-version:
|
||||
name: Calculate Version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
new_version: ${{ steps.version.outputs.new_version }}
|
||||
bump_type: ${{ steps.version.outputs.bump_type }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get commit message and determine version bump
|
||||
id: version
|
||||
run: |
|
||||
COMMIT_MSG="${{ github.event.head_commit.message }}"
|
||||
|
||||
if [[ $COMMIT_MSG == [fix]* ]]; then
|
||||
BUMP_TYPE="patch"
|
||||
elif [[ $COMMIT_MSG == [feature]* ]]; then
|
||||
BUMP_TYPE="minor"
|
||||
elif [[ $COMMIT_MSG == [release]* ]]; then
|
||||
BUMP_TYPE="major"
|
||||
else
|
||||
BUMP_TYPE="none"
|
||||
fi
|
||||
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||
LATEST_TAG=${LATEST_TAG#v}
|
||||
|
||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_TAG"
|
||||
MAJOR=${MAJOR:-0}
|
||||
MINOR=${MINOR:-0}
|
||||
PATCH=${PATCH:-0}
|
||||
|
||||
if [ "$BUMP_TYPE" == "major" ]; then
|
||||
((MAJOR++))
|
||||
MINOR=0
|
||||
PATCH=0
|
||||
elif [ "$BUMP_TYPE" == "minor" ]; then
|
||||
((MINOR++))
|
||||
PATCH=0
|
||||
elif [ "$BUMP_TYPE" == "patch" ]; then
|
||||
((PATCH++))
|
||||
fi
|
||||
|
||||
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "bump_type=$BUMP_TYPE" >> $GITHUB_OUTPUT
|
||||
|
||||
build_apk:
|
||||
name: Build Flutter APK
|
||||
runs-on: ubuntu-latest
|
||||
needs: calculate-version
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -89,18 +38,12 @@ jobs:
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
|
||||
- run: flutter --version
|
||||
- run: flutter doctor
|
||||
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Update pubspec.yaml with new version
|
||||
run: |
|
||||
sed -i "s/^version: .*/version: ${{ needs.calculate-version.outputs.new_version }}+${{ github.run_number }}/" pubspec.yaml
|
||||
cat pubspec.yaml | grep version
|
||||
|
||||
- name: Build APK
|
||||
run: flutter build apk --release
|
||||
|
||||
@@ -111,37 +54,14 @@ jobs:
|
||||
path: build/app/outputs/flutter-apk/app-release.apk
|
||||
retention-days: 30
|
||||
|
||||
create-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [calculate-version, build_apk]
|
||||
if: needs.calculate-version.outputs.bump_type != 'none'
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download APK artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: flutter-apk
|
||||
|
||||
- name: Create Git tag
|
||||
run: |
|
||||
NEW_TAG="v${{ needs.calculate-version.outputs.new_version }}"
|
||||
git config --local user.name "GitHub Actions"
|
||||
git config --local user.email "actions@github.com"
|
||||
git tag -a "$NEW_TAG" -m "Release ${{ needs.calculate-version.outputs.new_version }}"
|
||||
git push origin "$NEW_TAG"
|
||||
|
||||
- name: Create Gitea release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.RUNNER_CREATE_RELEASE }}
|
||||
with:
|
||||
tag_name: "v${{ needs.calculate-version.outputs.new_version }}"
|
||||
name: "Flutter Android v${{ needs.calculate-version.outputs.new_version }}"
|
||||
body: "Automated build from CI\n\nVersion bump type: ${{ needs.calculate-version.outputs.bump_type }}"
|
||||
tag_name: "v0.1.${{ github.run_number }}"
|
||||
name: "Flutter Android v0.1.${{ github.run_number }}"
|
||||
body: "Automated build from CI"
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: |
|
||||
|
||||
@@ -12,5 +12,16 @@
|
||||
"chooseCollection": "Sammlung auswählen",
|
||||
"collections": "Sammlungen",
|
||||
"tipCreateCollections": "Erstelle deine erste Sammlung!",
|
||||
"search": "Suche"
|
||||
"search": "Suche",
|
||||
"createBookmark": "Lesezeichen erstellen",
|
||||
"createCollection": "Sammlung erstellen",
|
||||
"create": "Erstellen",
|
||||
"delete": "Löschen",
|
||||
"add": "Hinzufügen",
|
||||
"startSearching": "Suche etwas",
|
||||
"tipNoResults": "Keine Suchergebnisse gefunden",
|
||||
"collectionName": "Name der Sammlung",
|
||||
"bookmarkTitle": "Titel des Lesezeichens",
|
||||
"url": "Url",
|
||||
"description": "Beschreibung"
|
||||
}
|
||||
@@ -12,5 +12,16 @@
|
||||
"chooseCollection": "Choose Collection",
|
||||
"collections": "Collections",
|
||||
"tipCreateCollections": "Create your first Collection to get started!",
|
||||
"search": "Search"
|
||||
"search": "Search",
|
||||
"createBookmark": "Create Bookmark",
|
||||
"createCollection": "Create Collection",
|
||||
"create": "Create",
|
||||
"delete": "Delete",
|
||||
"add": "Add",
|
||||
"startSearching": "Start searching",
|
||||
"tipNoResults": "There are no results that match your search",
|
||||
"collectionName": "Collection Name",
|
||||
"bookmarkTitle": "Bookmark Title",
|
||||
"url": "Url",
|
||||
"description": "Description"
|
||||
}
|
||||
@@ -133,6 +133,72 @@ abstract class AppLocalizations {
|
||||
/// In en, this message translates to:
|
||||
/// **'Search'**
|
||||
String get search;
|
||||
|
||||
/// No description provided for @createBookmark.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create Bookmark'**
|
||||
String get createBookmark;
|
||||
|
||||
/// No description provided for @createCollection.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create Collection'**
|
||||
String get createCollection;
|
||||
|
||||
/// No description provided for @create.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create'**
|
||||
String get create;
|
||||
|
||||
/// No description provided for @delete.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Delete'**
|
||||
String get delete;
|
||||
|
||||
/// No description provided for @add.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Add'**
|
||||
String get add;
|
||||
|
||||
/// No description provided for @startSearching.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Start searching'**
|
||||
String get startSearching;
|
||||
|
||||
/// No description provided for @tipNoResults.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'There are no results that match your search'**
|
||||
String get tipNoResults;
|
||||
|
||||
/// No description provided for @collectionName.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Collection Name'**
|
||||
String get collectionName;
|
||||
|
||||
/// No description provided for @bookmarkTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Bookmark Title'**
|
||||
String get bookmarkTitle;
|
||||
|
||||
/// No description provided for @url.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Url'**
|
||||
String get url;
|
||||
|
||||
/// No description provided for @description.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Description'**
|
||||
String get description;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -27,4 +27,37 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get search => 'Suche';
|
||||
|
||||
@override
|
||||
String get createBookmark => 'Lesezeichen erstellen';
|
||||
|
||||
@override
|
||||
String get createCollection => 'Sammlung erstellen';
|
||||
|
||||
@override
|
||||
String get create => 'Erstellen';
|
||||
|
||||
@override
|
||||
String get delete => 'Löschen';
|
||||
|
||||
@override
|
||||
String get add => 'Hinzufügen';
|
||||
|
||||
@override
|
||||
String get startSearching => 'Suche etwas';
|
||||
|
||||
@override
|
||||
String get tipNoResults => 'Keine Suchergebnisse gefunden';
|
||||
|
||||
@override
|
||||
String get collectionName => 'Name der Sammlung';
|
||||
|
||||
@override
|
||||
String get bookmarkTitle => 'Titel des Lesezeichens';
|
||||
|
||||
@override
|
||||
String get url => 'Url';
|
||||
|
||||
@override
|
||||
String get description => 'Beschreibung';
|
||||
}
|
||||
|
||||
@@ -28,4 +28,37 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get search => 'Search';
|
||||
|
||||
@override
|
||||
String get createBookmark => 'Create Bookmark';
|
||||
|
||||
@override
|
||||
String get createCollection => 'Create Collection';
|
||||
|
||||
@override
|
||||
String get create => 'Create';
|
||||
|
||||
@override
|
||||
String get delete => 'Delete';
|
||||
|
||||
@override
|
||||
String get add => 'Add';
|
||||
|
||||
@override
|
||||
String get startSearching => 'Start searching';
|
||||
|
||||
@override
|
||||
String get tipNoResults => 'There are no results that match your search';
|
||||
|
||||
@override
|
||||
String get collectionName => 'Collection Name';
|
||||
|
||||
@override
|
||||
String get bookmarkTitle => 'Bookmark Title';
|
||||
|
||||
@override
|
||||
String get url => 'Url';
|
||||
|
||||
@override
|
||||
String get description => 'Description';
|
||||
}
|
||||
|
||||
@@ -102,10 +102,16 @@ class _CollectionPageState extends State<CollectionPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ListView.builder(
|
||||
body: Center(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: ListView.separated(
|
||||
itemBuilder: (context, index) =>
|
||||
bookmarksListItemBuilder(context, bookmarks.elementAt(index)),
|
||||
itemCount: bookmarks.length,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: onAddButtonPressed,
|
||||
|
||||
@@ -110,12 +110,18 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
|
||||
child: Icon(Icons.add),
|
||||
),
|
||||
body: collections.isNotEmpty
|
||||
? ListView.builder(
|
||||
? Center(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: ListView.separated(
|
||||
itemBuilder: (context, index) => collectionsListItemBuilder(
|
||||
context,
|
||||
collections.elementAt(index),
|
||||
),
|
||||
itemCount: collections.length,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Center(
|
||||
child: Text(AppLocalizations.of(context)!.tipCreateCollections),
|
||||
|
||||
@@ -14,15 +14,22 @@ class SearchPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.search)),
|
||||
body: Column(
|
||||
body: Center(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(padding: EdgeInsetsGeometry.only(top: 10)),
|
||||
SearchBarWidget(
|
||||
onEditingComplete: context.read<SearchProvider>().setSearchText,
|
||||
onResetSearch: context.read<SearchProvider>().removeSearchText,
|
||||
),
|
||||
Padding(padding: EdgeInsetsGeometry.only(top: 10)),
|
||||
Expanded(child: SearchResultsWidget()),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
ThemeData get lightTheme => ThemeData.from(colorScheme: _lightColorScheme);
|
||||
const _seed = Colors.deepPurple;
|
||||
|
||||
ThemeData get darkTheme => ThemeData.from(colorScheme: _darkColorScheme);
|
||||
ColorScheme get _lightColorScheme =>
|
||||
ColorScheme.fromSeed(seedColor: _seed, brightness: Brightness.light);
|
||||
|
||||
ColorScheme get _darkColorScheme => ColorScheme.fromSeed(
|
||||
seedColor: Colors.deepPurple,
|
||||
brightness: Brightness.dark,
|
||||
);
|
||||
ColorScheme get _darkColorScheme =>
|
||||
ColorScheme.fromSeed(seedColor: _seed, brightness: Brightness.dark);
|
||||
|
||||
ColorScheme get _lightColorScheme => ColorScheme.fromSeed(
|
||||
seedColor: Colors.deepPurple,
|
||||
brightness: Brightness.light,
|
||||
);
|
||||
ThemeData get lightTheme => _baseTheme(_lightColorScheme);
|
||||
|
||||
ThemeData get darkTheme => _baseTheme(_darkColorScheme);
|
||||
|
||||
ThemeData _baseTheme(ColorScheme scheme) =>
|
||||
ThemeData.from(colorScheme: scheme, useMaterial3: true).copyWith(
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
listTileTheme: ListTileThemeData(
|
||||
tileColor: scheme.surfaceContainer,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusGeometry.circular(12),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../model/collection.dart';
|
||||
import 'edit_dialog_widgets/edit_dialog_actions.dart' show EditDialogActions;
|
||||
import 'edit_dialog_widgets/edit_dialog_title.dart';
|
||||
@@ -40,9 +41,7 @@ class CreateBookmarkCollectionDialog extends StatelessWidget {
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
// TODO: Localize
|
||||
labelText: 'Collection Name',
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
|
||||
labelText: AppLocalizations.of(context)!.collectionName,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../model/bookmark.dart';
|
||||
import '../model/maps_link_metadata.dart';
|
||||
import 'edit_dialog_widgets/edit_dialog_actions.dart';
|
||||
@@ -59,10 +60,7 @@ class CreateBookmarkDialog extends StatelessWidget {
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Bookmark Title',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.bookmarkTitle,
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
@@ -76,10 +74,7 @@ class CreateBookmarkDialog extends StatelessWidget {
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Url',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.url,
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
@@ -93,10 +88,7 @@ class CreateBookmarkDialog extends StatelessWidget {
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Description',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.description,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart'
|
||||
show TextButton, FloatingActionButton, Icons;
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
class EditDialogActions extends StatelessWidget {
|
||||
const EditDialogActions({super.key, required this.onSavePressed});
|
||||
final VoidCallback onSavePressed;
|
||||
@@ -13,7 +15,7 @@ class EditDialogActions extends StatelessWidget {
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text('Cancel'),
|
||||
child: Text(AppLocalizations.of(context)!.cancel),
|
||||
),
|
||||
FloatingActionButton(onPressed: onSavePressed, child: Icon(Icons.save)),
|
||||
],
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
class SearchBarWidget extends StatelessWidget {
|
||||
const SearchBarWidget({
|
||||
super.key,
|
||||
@@ -28,6 +30,7 @@ class SearchBarWidget extends StatelessWidget {
|
||||
},
|
||||
icon: Icon(Icons.delete_outline_outlined),
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.search,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../../model/bookmark.dart';
|
||||
import '../../service/notifying.dart';
|
||||
import '../../service/search_provider.dart';
|
||||
@@ -46,11 +47,12 @@ class _SearchResultsWidgetState extends State<SearchResultsWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (filteredBookmarks.isNotEmpty) {
|
||||
return ListView.builder(
|
||||
return ListView.separated(
|
||||
itemBuilder: bookmarkListItemBuilder,
|
||||
itemCount: filteredBookmarks.length,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||
);
|
||||
}
|
||||
return Center(child: Text('Start searching'));
|
||||
return Center(child: Text(AppLocalizations.of(context)!.tipNoResults));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user