import 'package:flutter/material.dart'; import "package:photos/generated/l10n.dart"; import "package:photos/service_locator.dart"; import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/components/buttons/button_widget.dart'; import 'package:photos/ui/components/divider_widget.dart'; import 'package:photos/ui/components/models/button_type.dart'; import 'package:photos/ui/components/title_bar_title_widget.dart'; import 'package:photos/ui/notification/update/change_log_entry.dart'; class ChangeLogPage extends StatefulWidget { const ChangeLogPage({ super.key, }); @override State createState() => _ChangeLogPageState(); } class _ChangeLogPageState extends State { @override Widget build(BuildContext context) { final enteColorScheme = getEnteColorScheme(context); return Scaffold( appBar: null, body: Container( color: enteColorScheme.backgroundElevated, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const SizedBox( height: 36, ), Container( alignment: Alignment.centerLeft, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: TitleBarTitleWidget( title: S.of(context).whatsNew, ), ), ), const SizedBox( height: 24, ), Expanded(child: _getChangeLog(context)), const DividerWidget( dividerType: DividerType.solid, ), SafeArea( child: Padding( padding: const EdgeInsets.only( left: 16.0, right: 16, top: 16, bottom: 8, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ ButtonWidget( buttonType: ButtonType.trailingIconPrimary, buttonSize: ButtonSize.large, labelText: S.of(context).continueLabel, icon: Icons.arrow_forward_outlined, onTap: () async { await updateService.hideChangeLog(); if (mounted && Navigator.of(context).canPop()) { Navigator.of(context).pop(); } }, ), const SizedBox( height: 8, ), ButtonWidget( buttonType: ButtonType.trailingIconSecondary, buttonSize: ButtonSize.large, labelText: S.of(context).rateTheApp, icon: Icons.favorite_rounded, iconColor: enteColorScheme.primary500, onTap: () async { await updateService.launchReviewUrl(); }, ), const SizedBox(height: 8), const SizedBox(height: 8), ], ), ), ), ], ), ), ); } Widget _getChangeLog(BuildContext ctx) { final scrollController = ScrollController(); final List items = []; items.addAll([ ChangeLogEntry( "Deep Links", "We have made public links even more powerful. Open links for Ente album directly in the app.\n\n" "Join the album as a viewer or collaborator, and experience it like any other shared album.", ), ChangeLogEntry( "Search Shared Files", "Indexes will now be shared along with shared memories.\n\n" "Which means you can now search for them using semantic search and label the people in shared photos. "), ChangeLogEntry( "Link Contact with people", "You dont have to deal with email addresses while sharing anymore.\n\n" "Connect a contact with a face and name. Go to the contact or people section to get started.", ), ]); return Container( padding: const EdgeInsets.only(left: 16), child: Scrollbar( controller: scrollController, thumbVisibility: true, thickness: 2.0, child: ListView.builder( physics: const BouncingScrollPhysics(), itemBuilder: (context, index) { return Padding( padding: const EdgeInsets.only(right: 16.0), child: ChangeLogEntryWidget(entry: items[index]), ); }, itemCount: items.length, ), ), ); } }