2023-02-17 11:49:24 +00:00
import " dart:io " ;
2022-11-09 08:06:10 +00:00
import ' package:flutter/material.dart ' ;
2023-04-06 08:41:04 +00:00
import " package:photos/generated/l10n.dart " ;
2022-11-09 08:18:58 +00:00
import ' package:photos/services/update_service.dart ' ;
2022-11-09 08:06:10 +00:00
import ' package:photos/theme/ente_theme.dart ' ;
2023-03-10 08:08:51 +00:00
import ' package:photos/ui/components/buttons/button_widget.dart ' ;
2022-11-09 09:45:56 +00:00
import ' package:photos/ui/components/divider_widget.dart ' ;
2022-12-17 04:59:15 +00:00
import ' package:photos/ui/components/models/button_type.dart ' ;
2022-11-09 08:06:10 +00:00
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 ( {
Key ? key ,
} ) : super ( key: key ) ;
@ override
State < ChangeLogPage > createState ( ) = > _ChangeLogPageState ( ) ;
}
class _ChangeLogPageState extends State < ChangeLogPage > {
@ override
void initState ( ) {
super . initState ( ) ;
}
@ 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 ,
) ,
2022-11-23 07:54:02 +00:00
Container (
alignment: Alignment . centerLeft ,
child: const Padding (
padding: EdgeInsets . symmetric ( horizontal: 16.0 ) ,
child: TitleBarTitleWidget (
title: " What's new " ,
2022-11-09 08:06:10 +00:00
) ,
) ,
) ,
2022-11-23 07:54:02 +00:00
const SizedBox (
height: 24 ,
) ,
2022-11-09 08:06:10 +00:00
Expanded ( child: _getChangeLog ( ) ) ,
2022-11-09 09:45:56 +00:00
const DividerWidget (
dividerType: DividerType . solid ,
) ,
2022-11-09 08:06:10 +00:00
SafeArea (
child: Padding (
2022-11-09 09:45:56 +00:00
padding: const EdgeInsets . only (
left: 16.0 ,
right: 16 ,
top: 16 ,
bottom: 8 ,
) ,
2022-11-09 08:06:10 +00:00
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
2022-12-17 04:59:15 +00:00
ButtonWidget (
buttonType: ButtonType . trailingIconPrimary ,
buttonSize: ButtonSize . large ,
2023-04-06 08:41:04 +00:00
labelText: S . of ( context ) . continueLabel ,
2022-12-17 04:59:15 +00:00
icon: Icons . arrow_forward_outlined ,
onTap: ( ) async {
await UpdateService . instance . hideChangeLog ( ) ;
if ( mounted & & Navigator . of ( context ) . canPop ( ) ) {
Navigator . of ( context ) . pop ( ) ;
}
} ,
) ,
const SizedBox (
height: 8 ,
2022-11-09 08:06:10 +00:00
) ,
2022-12-17 04:59:15 +00:00
ButtonWidget (
buttonType: ButtonType . trailingIconSecondary ,
buttonSize: ButtonSize . large ,
2023-04-06 08:41:04 +00:00
labelText: S . of ( context ) . rateTheApp ,
2022-12-17 04:59:15 +00:00
icon: Icons . favorite_rounded ,
iconColor: enteColorScheme . primary500 ,
onTap: ( ) async {
2023-01-07 10:32:24 +00:00
await UpdateService . instance . launchReviewUrl ( ) ;
2022-12-17 04:59:15 +00:00
} ,
2022-11-09 08:06:10 +00:00
) ,
const SizedBox ( height: 8 ) ,
] ,
) ,
) ,
) ,
] ,
) ,
) ,
) ;
}
Widget _getChangeLog ( ) {
final scrollController = ScrollController ( ) ;
final List < ChangeLogEntry > items = [ ] ;
items . add (
ChangeLogEntry (
2023-02-17 11:49:24 +00:00
" Referrals ✨ " ,
2023-02-27 04:39:56 +00:00
" You can now double your storage by referring your friends and family. Both you and your loved ones will get 10 GB of storage when "
2023-02-17 11:49:24 +00:00
" they upgrade to a paid plan. \n \n Go to Settings -> General -> "
2023-02-27 04:39:56 +00:00
" Referrals to get started! " ,
2022-11-09 08:06:10 +00:00
) ,
) ;
2023-02-17 11:49:24 +00:00
if ( Platform . isAndroid ) {
items . add (
ChangeLogEntry (
" Pick Files " ,
" While sharing photos and videos through other apps, ente will now "
" be an option to pick files from. This means you can now easily "
" attach files backed up to ente. \n \n Consider this the first "
" step towards making ente your default gallery app! " ,
) ,
) ;
}
2022-11-09 08:06:10 +00:00
2023-02-27 04:39:56 +00:00
items . add (
ChangeLogEntry (
" Verification ID " ,
" Security of your end-to-end encryption with those you are sharing your "
" albums with can now be verified, with the help of Verification IDs. "
" \n \n Please click on the Verify button on the album sharing page to learn more. " ,
) ,
) ;
items . add (
ChangeLogEntry (
" Prettier Pixels " ,
" This release is also packed with a bunch of user interface improvements suggested by our community. "
" \n \n We have added more actions to your Memories section, introduced archived albums to your Archived section, improved the experience of the Trash screen and sprinkled a few more improvements here and there. " ,
isFeature: false ,
) ,
) ;
2022-11-09 08:06:10 +00:00
return Container (
padding: const EdgeInsets . only ( left: 16 ) ,
child: Scrollbar (
controller: scrollController ,
thumbVisibility: true ,
thickness: 2.0 ,
child: ListView . builder (
2022-11-23 15:52:34 +00:00
physics: const BouncingScrollPhysics ( ) ,
2022-11-09 08:06:10 +00:00
itemBuilder: ( context , index ) {
return Padding (
padding: const EdgeInsets . only ( right: 16.0 ) ,
child: ChangeLogEntryWidget ( entry: items [ index ] ) ,
) ;
} ,
itemCount: items . length ,
) ,
) ,
) ;
}
}