Skip to content

Commit fed1208

Browse files
committed
Add linwood app template
1 parent be9af67 commit fed1208

30 files changed

+1243
-61
lines changed

app/.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
*.swp
66
.DS_Store
77
.atom/
8-
.build/
98
.buildlog/
109
.history
1110
.svn/
12-
.swiftpm/
13-
migrate_working_dir/
1411

1512
# IntelliJ related
1613
*.iml
@@ -21,17 +18,21 @@ migrate_working_dir/
2118
# The .vscode folder contains launch configuration and tasks you configure in
2219
# VS Code which you may wish to be included in version control, so this line
2320
# is commented out by default.
24-
#.vscode/
21+
.vscode/
2522

2623
# Flutter/Dart/Pub related
2724
**/doc/api/
2825
**/ios/Flutter/.last_build_id
2926
.dart_tool/
3027
.flutter-plugins
3128
.flutter-plugins-dependencies
29+
.packages
3230
.pub-cache/
3331
.pub/
3432
/build/
33+
/lib/src/generated
34+
35+
# Web related
3536

3637
# Symbolication related
3738
app.*.symbols

app/android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gradle-wrapper.jar
66
/local.properties
77
GeneratedPluginRegistrant.java
88
.cxx/
9+
/build/
910

1011
# Remember to never publicly share your keystore.
1112
# See https://flutter.dev/to/reference-keystore

app/android/app/build.gradle.kts

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
import java.io.FileInputStream
2+
import java.util.Properties
3+
14
plugins {
25
id("com.android.application")
36
id("kotlin-android")
47
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
58
id("dev.flutter.flutter-gradle-plugin")
69
}
710

11+
val keystoreProperties = Properties()
12+
val keystorePropertiesFile = rootProject.file("key.properties")
13+
if (keystorePropertiesFile.exists()) {
14+
FileInputStream(keystorePropertiesFile).use { keystoreProperties.load(it) }
15+
}
16+
817
android {
918
namespace = "dev.linwood.vulpine"
1019
compileSdk = flutter.compileSdkVersion
@@ -20,47 +29,48 @@ android {
2029
}
2130

2231
defaultConfig {
23-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2432
applicationId = "dev.linwood.vulpine"
25-
// You can update the following values to match your application needs.
26-
// For more information, see: https://flutter.dev/to/review-gradle-config.
2733
minSdk = flutter.minSdkVersion
2834
targetSdk = flutter.targetSdkVersion
2935
versionCode = flutter.versionCode
3036
versionName = flutter.versionName
3137
}
32-
productFlavors {
33-
production {
34-
dimension "default"
35-
applicationIdSuffix ""
36-
manifestPlaceholders = [appName: "Vulpine"]
38+
39+
flavorDimensions += "default"
40+
productFlavors {
41+
create("production") {
42+
dimension = "default"
43+
applicationIdSuffix = ""
44+
manifestPlaceholders["appName"] = "Vulpine"
3745
}
38-
development {
39-
dimension "default"
40-
applicationIdSuffix ""
41-
manifestPlaceholders = [appName: "Vulpine Nightly"]
46+
create("development") {
47+
dimension = "default"
48+
applicationIdSuffix = ""
49+
manifestPlaceholders["appName"] = "Vulpine Nightly"
4250
}
43-
nightly {
44-
dimension "default"
45-
applicationIdSuffix ".nightly"
46-
manifestPlaceholders = [appName: "Vulpine Nightly"]
51+
create("nightly") {
52+
dimension = "default"
53+
applicationIdSuffix = ".nightly"
54+
manifestPlaceholders["appName"] = "Vulpine Nightly"
4755
}
4856
}
57+
4958
signingConfigs {
50-
release {
51-
keyAlias keystoreProperties['keyAlias']
52-
keyPassword keystoreProperties['keyPassword']
53-
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
54-
storePassword keystoreProperties['storePassword']
59+
create("release") {
60+
keyAlias = keystoreProperties["keyAlias"] as String?
61+
keyPassword = keystoreProperties["keyPassword"] as String?
62+
storeFile = keystoreProperties["storeFile"]?.let { file(it as String) }
63+
storePassword = keystoreProperties["storePassword"] as String?
5564
}
5665
}
66+
5767
buildTypes {
58-
release {
59-
// Signing with the debug keys for now, so `flutter run --release` works.
60-
if (keystorePropertiesFile.exists()) {
61-
signingConfig signingConfigs.release
68+
getByName("release") {
69+
// Use your release keystore if available, fall back to debug key
70+
signingConfig = if (keystorePropertiesFile.exists()) {
71+
signingConfigs.getByName("release")
6272
} else {
63-
signingConfig signingConfigs.debug
73+
signingConfigs.getByName("debug")
6474
}
6575
}
6676
}

app/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<uses-permission android:name="android.permission.INTERNET"/>
23
<application
3-
android:label="vulpine"
4+
android:label="${appName}"
45
android:name="${applicationName}"
56
android:icon="@mipmap/ic_launcher">
67
<activity
78
android:name=".MainActivity"
89
android:exported="true"
910
android:launchMode="singleTop"
10-
android:taskAffinity=""
1111
android:theme="@style/LaunchTheme"
1212
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1313
android:hardwareAccelerated="true"

app/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionSha256Sum=61ad310d3c7d3e5da131b76bbf22b5a4c0786e9d892dae8c1658d4b484de3caa
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
5+
networkTimeout=10000
6+
validateDistributionUrl=true
37
zipStoreBase=GRADLE_USER_HOME
48
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

app/devtools_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: This file stores settings for Dart & Flutter DevTools.
2+
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3+
extensions:

app/l10n.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
arb-dir: lib/l10n
2+
template-arb-file: app_en.arb
3+
output-localization-file: app_localizations.dart
4+
nullable-getter: false
5+
synthetic-package: false
6+
output-dir: lib/src/generated/i18n

app/lib/api/settings.dart

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'dart:ui';
2+
3+
import 'package:vulpine/pages/settings/home.dart';
4+
import 'package:flutter/material.dart';
5+
6+
Future<void> openSettings(BuildContext context) => showGeneralDialog<void>(
7+
context: context,
8+
pageBuilder:
9+
(context, animation, secondaryAnimation) => ScaffoldMessenger(
10+
child: BackdropFilter(
11+
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
12+
child: Dialog(
13+
clipBehavior: Clip.antiAlias,
14+
child: ConstrainedBox(
15+
constraints: const BoxConstraints(maxHeight: 800, maxWidth: 1000),
16+
child: const SettingsPage(isDialog: true),
17+
),
18+
),
19+
),
20+
),
21+
barrierDismissible: true,
22+
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
23+
transitionDuration: const Duration(milliseconds: 200),
24+
transitionBuilder: (context, animation, secondaryAnimation, child) {
25+
// Animate the dialog from bottom to center
26+
return SlideTransition(
27+
position: Tween<Offset>(
28+
begin: const Offset(0, 1),
29+
end: Offset.zero,
30+
).chain(CurveTween(curve: Curves.easeOutQuart)).animate(animation),
31+
child: child,
32+
);
33+
},
34+
);

app/lib/helpers/theme_mode.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:vulpine/src/generated/i18n/app_localizations.dart';
3+
import 'package:phosphor_flutter/phosphor_flutter.dart';
4+
5+
extension ThemeModeHelper on ThemeMode {
6+
PhosphorIconData get icon {
7+
switch (this) {
8+
case ThemeMode.light:
9+
return PhosphorIconsLight.sun;
10+
case ThemeMode.dark:
11+
return PhosphorIconsLight.moon;
12+
case ThemeMode.system:
13+
return PhosphorIconsLight.power;
14+
}
15+
}
16+
17+
String getDisplayString(BuildContext context) {
18+
switch (this) {
19+
case ThemeMode.light:
20+
return AppLocalizations.of(context).light;
21+
case ThemeMode.dark:
22+
return AppLocalizations.of(context).dark;
23+
case ThemeMode.system:
24+
return AppLocalizations.of(context).systemDefault;
25+
}
26+
}
27+
}

app/lib/l10n/app_en.arb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"settings": "Settings",
3+
"data": "Data",
4+
"version": "Version",
5+
"language": "Language",
6+
"theme": "Theme",
7+
"dark": "Dark",
8+
"light": "Light",
9+
"personalization": "Personalization",
10+
"information": "Information",
11+
"legal": "Legal",
12+
"general": "General",
13+
"update": "Update",
14+
"currentVersion": "Current Version",
15+
"checkForUpdates": "Check for Updates",
16+
"checkForUpdatesWarning": "Performing a check for updates will connect to the Butterfly website to get the information.",
17+
"usingLatestStable": "You are using the latest stable version",
18+
"usingLatestNightly": "You are using the latest nightly version",
19+
"updateNow": "Update now",
20+
"stable": "Stable",
21+
"nightly": "Nightly",
22+
"updateAvailable": "Update available",
23+
"error": "Error",
24+
"documentation": "Documentation",
25+
"releaseNotes": "Release notes",
26+
"privacyPolicy": "Privacy policy",
27+
"translate": "Translate",
28+
"sourceCode": "Source code",
29+
"changelog": "Changelog",
30+
"license": "License",
31+
"imprint": "Imprint",
32+
"thirdPartyLicenses": "Third Party Licenses",
33+
"systemLocale": "System locale",
34+
"systemDefault": "System default",
35+
"comfortable": "Comfortable",
36+
"compact": "Compact",
37+
"standard": "Standard",
38+
"design": "Design",
39+
"maximize": "Maximize",
40+
"desktop": "Desktop",
41+
"nativeTitleBar": "Native title bar",
42+
"density": "Density",
43+
"highContrast": "High contrast"
44+
}

0 commit comments

Comments
 (0)