mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-17 16:07:51 +01:00
Small cleanups and optimizations
This commit is contained in:
192
.github/workflows/screenshots.yml
vendored
192
.github/workflows/screenshots.yml
vendored
@@ -3,40 +3,39 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# screenshots_apple:
|
||||
# name: 'Apple'
|
||||
# runs-on: macos-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Common flutter setup
|
||||
# uses: ./.github/actions/flutter-common
|
||||
#
|
||||
# - name: Install CocoaPods
|
||||
# run: |
|
||||
# cd ios
|
||||
# pod install || true
|
||||
# cd ..
|
||||
#
|
||||
# - name: Boot iOS simulator
|
||||
# id: boot
|
||||
# run: |
|
||||
# SIMULATOR=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone 17/{print $2; exit}')
|
||||
# SIMULATOR=${SIMULATOR:-$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/{print $2; exit}')}
|
||||
# echo "SIMULATOR=$SIMULATOR" >> $GITHUB_ENV
|
||||
# xcrun simctl boot "$SIMULATOR" || true
|
||||
# open -a Simulator || true
|
||||
# n=0; until xcrun simctl bootstatus "$SIMULATOR" -b || [ $n -ge 60 ]; do sleep 1; n=$((n+1)); done
|
||||
#
|
||||
# - name: Generate screenshots on iOS simulator
|
||||
# run: |
|
||||
# flutter drive --driver=test_driver/screenshot_driver.dart --target=integration_test/make_screenshots_test.dart --dart-define=DEVICE_TYPE=iOSPhoneBig -d "$SIMULATOR"
|
||||
#
|
||||
# - name: Upload screenshots artifacts
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: screenshots-ios
|
||||
# path: fastlane/metadata/ios/**/images/iPhone 6.9/*.png
|
||||
screenshots_apple:
|
||||
name: 'iOS'
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Common flutter setup
|
||||
uses: ./.github/actions/flutter-common
|
||||
|
||||
- name: Install CocoaPods
|
||||
run: |
|
||||
cd ios
|
||||
pod install || true
|
||||
cd ..
|
||||
|
||||
- name: Boot iOS simulator
|
||||
id: boot
|
||||
run: |
|
||||
SIMULATOR=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone 17/{print $2; exit}')
|
||||
echo "SIMULATOR=$SIMULATOR" >> $GITHUB_ENV
|
||||
xcrun simctl boot "$SIMULATOR" || true
|
||||
open -a Simulator || true
|
||||
n=0; until xcrun simctl bootstatus "$SIMULATOR" -b || [ $n -ge 60 ]; do sleep 1; n=$((n+1)); done
|
||||
|
||||
- name: Generate screenshots
|
||||
run: |
|
||||
flutter drive --driver=test_driver/screenshot_driver.dart --target=integration_test/make_screenshots_test.dart --dart-define=DEVICE_TYPE=iOSPhoneBig -d "$SIMULATOR"
|
||||
|
||||
- name: Upload screenshots
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: screenshots-ios
|
||||
path: fastlane/metadata/ios/**/images/iPhone 6.9/*.png
|
||||
|
||||
screenshots_android:
|
||||
name: 'Android - ${{ matrix.device.name }}'
|
||||
@@ -101,31 +100,6 @@ jobs:
|
||||
sudo apt-get clean || true
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# TMP -------------------->
|
||||
- name: Gradle cache
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
|
||||
- name: AVD cache
|
||||
uses: actions/cache@v4
|
||||
id: avd-cache
|
||||
with:
|
||||
path: |
|
||||
~/.android/avd/*
|
||||
~/.android/adb*
|
||||
key: avd-api-36
|
||||
|
||||
- name: Run on Android emulator
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 36
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
profile: ${{ matrix.device.profile }}
|
||||
script: echo "Generated AVD snapshot for caching."
|
||||
# <-------------------- TMP
|
||||
|
||||
- name: Generate screenshots
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
@@ -135,71 +109,49 @@ jobs:
|
||||
profile: ${{ matrix.device.profile }}
|
||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
disable-animations: true
|
||||
script: |
|
||||
|
||||
# Values for rotation
|
||||
# 0 for portrait (0°)
|
||||
# 1 for landscape (90°)
|
||||
# 2 for portrait reversed (180°)
|
||||
# 3 for landscape reversed (270°)
|
||||
|
||||
# turn off auto rotation and rotate to portrait mode
|
||||
#adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
|
||||
#adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
|
||||
|
||||
echo "Device settings:"
|
||||
adb shell settings put system accelerometer_rotation 0
|
||||
adb shell settings put system user_rotation 0
|
||||
|
||||
sleep 5
|
||||
|
||||
adb shell settings get system accelerometer_rotation
|
||||
adb shell settings get system user_rotation
|
||||
|
||||
# Make the screenshots
|
||||
script: |
|
||||
flutter drive --driver=test_driver/screenshot_driver.dart --target=integration_test/make_screenshots_test.dart --dart-define=DEVICE_TYPE=${{ matrix.device.device_type }}
|
||||
|
||||
- name: Upload screenshots artifacts
|
||||
- name: Upload screenshots
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: screenshots-android-${{ matrix.device.folder }}
|
||||
path: fastlane/metadata/android/**/images/${{ matrix.device.folder }}/*.png
|
||||
|
||||
# commit_screenshots:
|
||||
# name: 'Commit and push'
|
||||
# needs:
|
||||
# - screenshots_apple
|
||||
# - screenshots_android
|
||||
#
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Download all screenshot artifacts
|
||||
# uses: actions/download-artifact@v4
|
||||
# with:
|
||||
# path: screenshots
|
||||
#
|
||||
# - name: Merge artifacts into fastlane/metadata
|
||||
# run: |
|
||||
# set -euo pipefail
|
||||
# rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-phoneScreenshots/" fastlane/metadata/android/
|
||||
# rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-sevenInchScreenshots/" fastlane/metadata/android/
|
||||
# rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-tenInchScreenshots/" fastlane/metadata/android/
|
||||
# rsync --archive --checksum --itemize-changes "screenshots/screenshots-ios/" fastlane/metadata/ios/
|
||||
#
|
||||
# - name: Commit screenshots to repository
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# run: |
|
||||
# git config user.name "github-actions[bot]"
|
||||
# git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
# git status
|
||||
# git add fastlane/metadata/android fastlane/metadata/ios || true
|
||||
# if git diff --staged --quiet; then
|
||||
# echo "No new/changed screenshots to commit."
|
||||
# else
|
||||
# BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
# # git commit -m "Update screenshots"
|
||||
# # git push origin HEAD:"${BRANCH}"
|
||||
# fi
|
||||
commit_screenshots:
|
||||
name: 'Commit and push'
|
||||
needs:
|
||||
- screenshots_apple
|
||||
- screenshots_android
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all screenshot artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: screenshots
|
||||
|
||||
- name: Merge artifacts into fastlane/metadata
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-phoneScreenshots/" fastlane/metadata/android/
|
||||
rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-sevenInchScreenshots/" fastlane/metadata/android/
|
||||
rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-tenInchScreenshots/" fastlane/metadata/android/
|
||||
rsync --archive --checksum --itemize-changes "screenshots/screenshots-ios/" fastlane/metadata/ios/
|
||||
|
||||
- name: Commit screenshots to repository
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add fastlane/metadata/android fastlane/metadata/ios || true
|
||||
if git diff --staged --quiet; then
|
||||
echo "No new or changed screenshots to commit."
|
||||
else
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
git commit -m "Update screenshots"
|
||||
git push origin HEAD:"${BRANCH}"
|
||||
fi
|
||||
@@ -3,16 +3,21 @@ import 'package:mockito/mockito.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/l10n/generated/app_localizations.dart';
|
||||
import 'package:wger/models/workouts/session.dart';
|
||||
import 'package:wger/providers/auth.dart';
|
||||
import 'package:wger/providers/body_weight.dart';
|
||||
import 'package:wger/providers/exercises.dart';
|
||||
import 'package:wger/providers/gallery.dart';
|
||||
import 'package:wger/providers/measurement.dart';
|
||||
import 'package:wger/providers/nutrition.dart';
|
||||
import 'package:wger/providers/routines.dart';
|
||||
import 'package:wger/providers/user.dart';
|
||||
import 'package:wger/screens/dashboard.dart';
|
||||
import 'package:wger/screens/home_tabs_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
|
||||
import '../test/exercises/contribute_exercise_test.mocks.dart';
|
||||
import '../test/gallery/gallery_form_test.mocks.dart';
|
||||
import '../test/measurements/measurement_categories_screen_test.mocks.dart';
|
||||
import '../test/nutrition/nutritional_plan_screen_test.mocks.dart';
|
||||
import '../test/routine/weight_unit_form_widget_test.mocks.dart';
|
||||
import '../test/weight/weight_screen_test.mocks.dart' as weight;
|
||||
import '../test_data/body_weight.dart';
|
||||
@@ -25,6 +30,14 @@ import '../test_data/routines.dart';
|
||||
Widget createDashboardScreen({Locale? locale}) {
|
||||
locale ??= const Locale('en');
|
||||
|
||||
final mockGalleryProvider = MockGalleryProvider();
|
||||
|
||||
final mockExercisesProvider = MockExercisesProvider();
|
||||
|
||||
final mockAuthProvider = MockAuthProvider();
|
||||
when(mockAuthProvider.setServerVersion()).thenAnswer((_) async {});
|
||||
when(mockAuthProvider.dataInit).thenReturn(true);
|
||||
|
||||
final mockWorkoutProvider = MockRoutinesProvider();
|
||||
when(mockWorkoutProvider.items).thenReturn([getTestRoutine(exercises: getScreenshotExercises())]);
|
||||
when(
|
||||
@@ -60,13 +73,22 @@ Widget createDashboardScreen({Locale? locale}) {
|
||||
when(mockUserProvider.profile).thenReturn(tProfile1);
|
||||
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
),
|
||||
child: MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<GalleryProvider>(
|
||||
create: (context) => mockGalleryProvider,
|
||||
),
|
||||
ChangeNotifierProvider<ExercisesProvider>(
|
||||
create: (context) => mockExercisesProvider,
|
||||
),
|
||||
ChangeNotifierProvider<AuthProvider>(
|
||||
create: (context) => mockAuthProvider,
|
||||
),
|
||||
ChangeNotifierProvider<UserProvider>(
|
||||
create: (context) => mockUserProvider,
|
||||
),
|
||||
@@ -89,7 +111,7 @@ Widget createDashboardScreen({Locale? locale}) {
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
theme: wgerLightTheme,
|
||||
home: const DashboardScreen(),
|
||||
home: HomeTabsScreen(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -16,12 +16,10 @@ Widget createWorkoutDetailScreen({Locale? locale}) {
|
||||
|
||||
final mockRoutinesProvider = MockRoutinesProvider();
|
||||
final routine = getTestRoutine(exercises: getScreenshotExercises());
|
||||
// when(mockRoutinesProvider.activeRoutine).thenReturn(routine);
|
||||
when(mockRoutinesProvider.findById(1)).thenReturn(routine);
|
||||
// when(mockRoutinesProvider.fetchAndSetRoutineFull(1)).thenAnswer((_) => Future.value(routine));
|
||||
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
|
||||
@@ -30,7 +30,7 @@ Widget createGymModeScreen({Locale? locale}) {
|
||||
//when(mockExerciseProvider.findExerciseBaseById(3)).thenReturn(bases[2]); // dead lift
|
||||
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
|
||||
@@ -16,7 +16,7 @@ Widget createMeasurementScreen({Locale? locale}) {
|
||||
when(mockMeasurementProvider.categories).thenReturn(getMeasurementCategories());
|
||||
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
|
||||
@@ -18,7 +18,7 @@ Widget createNutritionalPlanScreen({Locale? locale}) {
|
||||
final key = GlobalKey<NavigatorState>();
|
||||
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
|
||||
@@ -28,7 +28,7 @@ Widget createWeightScreen({Locale? locale}) {
|
||||
when(mockNutritionPlansProvider.items).thenReturn([getNutritionalPlan()]);
|
||||
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
|
||||
@@ -100,13 +100,12 @@ const languages = [
|
||||
void main() {
|
||||
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
|
||||
|
||||
group('Generate screenshots', () {
|
||||
setUpAll(() async {
|
||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
await SystemChrome.setPreferredOrientations(DeviceOrientation.values);
|
||||
// Suppress warnings about multiple database instances, it's ok during testing
|
||||
driftRuntimeOptions.dontWarnAboutMultipleDatabases = true;
|
||||
});
|
||||
|
||||
for (final language in languages) {
|
||||
@@ -118,6 +117,7 @@ void main() {
|
||||
|
||||
testWidgets('dashboard screen - $language', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(createDashboardScreen(locale: locale));
|
||||
await tester.pumpAndSettle();
|
||||
await takeScreenshot(tester, binding, language, '01 - dashboard');
|
||||
});
|
||||
|
||||
@@ -137,6 +137,7 @@ void main() {
|
||||
|
||||
testWidgets('measurement screen - $language', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(createMeasurementScreen(locale: locale));
|
||||
await tester.pumpAndSettle();
|
||||
await takeScreenshot(tester, binding, language, '04 - measurements');
|
||||
});
|
||||
|
||||
|
||||
@@ -22,25 +22,25 @@ PODS:
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqlite3 (3.50.4):
|
||||
- sqlite3/common (= 3.50.4)
|
||||
- sqlite3/common (3.50.4)
|
||||
- sqlite3/dbstatvtab (3.50.4):
|
||||
- sqlite3 (3.51.1):
|
||||
- sqlite3/common (= 3.51.1)
|
||||
- sqlite3/common (3.51.1)
|
||||
- sqlite3/dbstatvtab (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/fts5 (3.50.4):
|
||||
- sqlite3/fts5 (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/math (3.50.4):
|
||||
- sqlite3/math (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/perf-threadsafe (3.50.4):
|
||||
- sqlite3/perf-threadsafe (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/rtree (3.50.4):
|
||||
- sqlite3/rtree (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/session (3.50.4):
|
||||
- sqlite3/session (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3_flutter_libs (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqlite3 (~> 3.50.4)
|
||||
- sqlite3 (~> 3.51.1)
|
||||
- sqlite3/dbstatvtab
|
||||
- sqlite3/fts5
|
||||
- sqlite3/math
|
||||
@@ -115,8 +115,8 @@ SPEC CHECKSUMS:
|
||||
pointer_interceptor_ios: da06a662d5bfd329602b45b2ab41bc0fb5fdb0f0
|
||||
rive_common: dd421daaf9ae69f0125aa761dd96abd278399952
|
||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||
sqlite3: 73513155ec6979715d3904ef53a8d68892d4032b
|
||||
sqlite3_flutter_libs: 83f8e9f5b6554077f1d93119fe20ebaa5f3a9ef1
|
||||
sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b
|
||||
sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41
|
||||
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
|
||||
video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ class _AuthCardState extends State<AuthCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final i18n = AppLocalizations.of(context);
|
||||
final deviceSize = MediaQuery.of(context).size;
|
||||
final deviceSize = MediaQuery.sizeOf(context);
|
||||
|
||||
return Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
|
||||
@@ -65,8 +65,8 @@ class _HomeTabsScreenState extends State<HomeTabsScreen> with SingleTickerProvid
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
final double width = MediaQuery.of(context).size.width;
|
||||
_isWideScreen = width > MATERIAL_XS_BREAKPOINT;
|
||||
final size = MediaQuery.sizeOf(context);
|
||||
_isWideScreen = size.width > MATERIAL_XS_BREAKPOINT;
|
||||
}
|
||||
|
||||
void _onItemTapped(int index) {
|
||||
|
||||
@@ -85,46 +85,62 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
|
||||
PlanForm(),
|
||||
),
|
||||
if (_hasContent)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(AppLocalizations.of(context).goToDetailPage),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
NutritionalPlanScreen.routeName,
|
||||
arguments: _plan,
|
||||
);
|
||||
},
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
IconButton(
|
||||
icon: const SvgIcon(
|
||||
icon: SvgIconData('assets/icons/ingredient-diary.svg'),
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: constraints.maxWidth),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(AppLocalizations.of(context).goToDetailPage),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
NutritionalPlanScreen.routeName,
|
||||
arguments: _plan,
|
||||
);
|
||||
},
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const SvgIcon(
|
||||
icon: SvgIconData('assets/icons/ingredient-diary.svg'),
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).logIngredient,
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).logIngredient,
|
||||
getIngredientLogForm(_plan!),
|
||||
hasListView: true,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const SvgIcon(
|
||||
icon: SvgIconData('assets/icons/meal-diary.svg'),
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).logMeal,
|
||||
onPressed: () {
|
||||
Navigator.of(
|
||||
context,
|
||||
).pushNamed(LogMealsScreen.routeName, arguments: _plan);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).logIngredient,
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).logIngredient,
|
||||
getIngredientLogForm(_plan!),
|
||||
hasListView: true,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const SvgIcon(
|
||||
icon: SvgIconData('assets/icons/meal-diary.svg'),
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).logMeal,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(LogMealsScreen.routeName, arguments: _plan);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -75,36 +75,47 @@ class DashboardWeightWidget extends StatelessWidget {
|
||||
entries7dAvg.last,
|
||||
weightUnit(profile.isMetric, context),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).goToDetailPage,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(WeightScreen.routeName);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).newEntry,
|
||||
WeightForm(
|
||||
weightProvider.getNewestEntry()?.copyWith(
|
||||
id: null,
|
||||
date: DateTime.now(),
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: constraints.maxWidth),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).goToDetailPage,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(WeightScreen.routeName);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).newEntry,
|
||||
WeightForm(
|
||||
weightProvider.getNewestEntry()?.copyWith(
|
||||
id: null,
|
||||
date: DateTime.now(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -29,8 +29,6 @@ class ExerciseListTile extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//final size = MediaQuery.of(context).size;
|
||||
//final theme = Theme.of(context);
|
||||
const double IMG_SIZE = 60;
|
||||
|
||||
return ListTile(
|
||||
|
||||
@@ -49,33 +49,43 @@ class CategoriesCard extends StatelessWidget {
|
||||
currentCategory.unit,
|
||||
),
|
||||
const Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(AppLocalizations.of(context).goToDetailPage),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
MeasurementEntriesScreen.routeName,
|
||||
arguments: currentCategory.id,
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await Navigator.pushNamed(
|
||||
context,
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).newEntry,
|
||||
MeasurementEntryForm(currentCategory.id!),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
],
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: constraints.maxWidth),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(AppLocalizations.of(context).goToDetailPage),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
MeasurementEntriesScreen.routeName,
|
||||
arguments: currentCategory.id,
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await Navigator.pushNamed(
|
||||
context,
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).newEntry,
|
||||
MeasurementEntryForm(currentCategory.id!),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -14,25 +14,25 @@ PODS:
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqlite3 (3.50.4):
|
||||
- sqlite3/common (= 3.50.4)
|
||||
- sqlite3/common (3.50.4)
|
||||
- sqlite3/dbstatvtab (3.50.4):
|
||||
- sqlite3 (3.51.1):
|
||||
- sqlite3/common (= 3.51.1)
|
||||
- sqlite3/common (3.51.1)
|
||||
- sqlite3/dbstatvtab (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/fts5 (3.50.4):
|
||||
- sqlite3/fts5 (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/math (3.50.4):
|
||||
- sqlite3/math (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/perf-threadsafe (3.50.4):
|
||||
- sqlite3/perf-threadsafe (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/rtree (3.50.4):
|
||||
- sqlite3/rtree (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/session (3.50.4):
|
||||
- sqlite3/session (3.51.1):
|
||||
- sqlite3/common
|
||||
- sqlite3_flutter_libs (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqlite3 (~> 3.50.4)
|
||||
- sqlite3 (~> 3.51.1)
|
||||
- sqlite3/dbstatvtab
|
||||
- sqlite3/fts5
|
||||
- sqlite3/math
|
||||
@@ -91,8 +91,8 @@ SPEC CHECKSUMS:
|
||||
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
||||
rive_common: ea79040f86acf053a2d5a75a2506175ee39796a5
|
||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||
sqlite3: 73513155ec6979715d3904ef53a8d68892d4032b
|
||||
sqlite3_flutter_libs: 83f8e9f5b6554077f1d93119fe20ebaa5f3a9ef1
|
||||
sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b
|
||||
sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41
|
||||
url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd
|
||||
video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a
|
||||
|
||||
|
||||
@@ -1523,4 +1523,4 @@ packages:
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.9.0 <4.0.0"
|
||||
flutter: ">=3.35.0"
|
||||
flutter: ">=3.38.0"
|
||||
|
||||
Reference in New Issue
Block a user