Compare commits

...

1 Commits

Author SHA1 Message Date
18dadaa5ec v0.2.15 (#39)
* Add capitlzation to text fields (#37)

* added ability for split view to be expanded to full screen. (#38)

Co-authored-by: Efreak <Efreak@users.noreply.github.com>
2022-06-05 00:58:49 -07:00
11 changed files with 113 additions and 49 deletions

View File

@ -0,0 +1,6 @@
- You can now add filters for searching.
- You can now participate in polls.
- Pick up where you left off.
- Swipe left on comment tile to view its parents without scrolling all the way up.
- Huge performance boost.
- Bugfixes.

View File

@ -577,7 +577,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.14; MARKETING_VERSION = 0.2.15;
PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki; PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -714,7 +714,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.14; MARKETING_VERSION = 0.2.15;
PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki; PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -745,7 +745,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.14; MARKETING_VERSION = 0.2.15;
PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki; PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -21,4 +21,6 @@ class SplitViewCubit extends Cubit<SplitViewState> {
void enableSplitView() => emit(state.copyWith(enabled: true)); void enableSplitView() => emit(state.copyWith(enabled: true));
void disableSplitView() => emit(state.copyWith(enabled: false)); void disableSplitView() => emit(state.copyWith(enabled: false));
void zoom() => emit(state.copyWith(expanded: !state.expanded));
} }

View File

@ -3,19 +3,27 @@ part of 'split_view_cubit.dart';
class SplitViewState extends Equatable { class SplitViewState extends Equatable {
const SplitViewState({ const SplitViewState({
required this.storyScreenArgs, required this.storyScreenArgs,
required this.expanded,
required this.enabled, required this.enabled,
}); });
const SplitViewState.init() const SplitViewState.init()
: enabled = false, : enabled = false,
expanded = false,
storyScreenArgs = null; storyScreenArgs = null;
final bool enabled; final bool enabled;
final bool expanded;
final StoryScreenArgs? storyScreenArgs; final StoryScreenArgs? storyScreenArgs;
SplitViewState copyWith({bool? enabled, StoryScreenArgs? storyScreenArgs}) { SplitViewState copyWith({
bool? enabled,
bool? expanded,
StoryScreenArgs? storyScreenArgs,
}) {
return SplitViewState( return SplitViewState(
enabled: enabled ?? this.enabled, enabled: enabled ?? this.enabled,
expanded: expanded ?? this.expanded,
storyScreenArgs: storyScreenArgs ?? this.storyScreenArgs, storyScreenArgs: storyScreenArgs ?? this.storyScreenArgs,
); );
} }
@ -23,6 +31,7 @@ class SplitViewState extends Equatable {
@override @override
List<Object?> get props => <Object?>[ List<Object?> get props => <Object?>[
enabled, enabled,
expanded,
storyScreenArgs, storyScreenArgs,
]; ];
} }

View File

@ -390,11 +390,11 @@ class _HomeScreenState extends State<HomeScreen>
return ScreenTypeLayout.builder( return ScreenTypeLayout.builder(
mobile: (BuildContext context) { mobile: (BuildContext context) {
context.read<SplitViewCubit>().disableSplitView(); context.read<SplitViewCubit>().disableSplitView();
return _MobileHomeScreenBuilder( return _MobileHomeScreen(
homeScreen: homeScreen, homeScreen: homeScreen,
); );
}, },
tablet: (BuildContext context) => _TabletHomeScreenBuilder( tablet: (BuildContext context) => _TabletHomeScreen(
homeScreen: homeScreen, homeScreen: homeScreen,
), ),
); );
@ -511,8 +511,8 @@ class _HomeScreenState extends State<HomeScreen>
} }
} }
class _MobileHomeScreenBuilder extends StatelessWidget { class _MobileHomeScreen extends StatelessWidget {
const _MobileHomeScreenBuilder({ const _MobileHomeScreen({
Key? key, Key? key,
required this.homeScreen, required this.homeScreen,
}) : super(key: key); }) : super(key: key);
@ -537,8 +537,8 @@ class _MobileHomeScreenBuilder extends StatelessWidget {
} }
} }
class _TabletHomeScreenBuilder extends StatelessWidget { class _TabletHomeScreen extends StatelessWidget {
const _TabletHomeScreenBuilder({ const _TabletHomeScreen({
Key? key, Key? key,
required this.homeScreen, required this.homeScreen,
}) : super(key: key); }) : super(key: key);
@ -556,30 +556,40 @@ class _TabletHomeScreenBuilder extends StatelessWidget {
homeScreenWidth = 345.0; homeScreenWidth = 345.0;
} }
return Stack( return BlocBuilder<SplitViewCubit, SplitViewState>(
children: <Widget>[ buildWhen: (SplitViewState previous, SplitViewState current) =>
Positioned( previous.expanded != current.expanded,
left: 0, builder: (BuildContext context, SplitViewState state) {
top: 0, return Stack(
bottom: 0, children: <Widget>[
width: homeScreenWidth, AnimatedPositioned(
child: homeScreen, left: 0,
), top: 0,
Positioned( bottom: 0,
left: 24, width: state.expanded ? 0 : homeScreenWidth,
bottom: 36, duration: const Duration(milliseconds: 300),
height: 40, curve: Curves.elasticOut,
width: homeScreenWidth - 24, child: homeScreen,
child: const CountdownReminder(), ),
), Positioned(
Positioned( left: 24,
right: 0, bottom: 36,
top: 0, height: 40,
bottom: 0, width: homeScreenWidth - 24,
left: homeScreenWidth, child: const CountdownReminder(),
child: const _TabletStoryView(), ),
), AnimatedPositioned(
], right: 0,
top: 0,
bottom: 0,
left: state.expanded ? 0 : homeScreenWidth,
duration: const Duration(milliseconds: 300),
curve: Curves.elasticOut,
child: const _TabletStoryView(),
),
],
);
},
); );
}, },
); );

View File

@ -407,7 +407,7 @@ class _ProfileScreenState extends State<ProfileScreen>
showAboutDialog( showAboutDialog(
context: context, context: context,
applicationName: 'Hacki', applicationName: 'Hacki',
applicationVersion: 'v0.2.14', applicationVersion: 'v0.2.15',
applicationIcon: ClipRRect( applicationIcon: ClipRRect(
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(12), Radius.circular(12),

View File

@ -525,19 +525,34 @@ class _StoryScreenState extends State<StoryScreen> {
Positioned.fill( Positioned.fill(
child: mainView, child: mainView,
), ),
Positioned( BlocBuilder<SplitViewCubit, SplitViewState>(
top: 0, buildWhen: (
left: 0, SplitViewState previous,
right: 0, SplitViewState current,
child: CustomAppBar( ) =>
backgroundColor: Theme.of(context) previous.expanded != current.expanded,
.canvasColor builder:
.withOpacity(0.6), (BuildContext context, SplitViewState state) {
story: widget.story, return Positioned(
scrollController: scrollController, top: 0,
onBackgroundTap: onFeatureDiscoveryDismissed, left: 0,
onDismiss: onFeatureDiscoveryDismissed, right: 0,
), child: CustomAppBar(
backgroundColor: Theme.of(context)
.canvasColor
.withOpacity(0.6),
story: widget.story,
scrollController: scrollController,
onBackgroundTap:
onFeatureDiscoveryDismissed,
onDismiss: onFeatureDiscoveryDismissed,
splitViewEnabled: state.enabled,
expanded: state.expanded,
onZoomTap:
context.read<SplitViewCubit>().zoom,
),
);
},
), ),
Positioned( Positioned(
bottom: 0, bottom: 0,

View File

@ -1,4 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'package:hacki/models/models.dart'; import 'package:hacki/models/models.dart';
import 'package:hacki/screens/story/widgets/fav_icon_button.dart'; import 'package:hacki/screens/story/widgets/fav_icon_button.dart';
import 'package:hacki/screens/story/widgets/link_icon_button.dart'; import 'package:hacki/screens/story/widgets/link_icon_button.dart';
@ -13,11 +15,29 @@ class CustomAppBar extends AppBar {
required Color backgroundColor, required Color backgroundColor,
required Future<bool> Function() onBackgroundTap, required Future<bool> Function() onBackgroundTap,
required Future<bool> Function() onDismiss, required Future<bool> Function() onDismiss,
bool splitViewEnabled = false,
VoidCallback? onZoomTap,
bool? expanded,
}) : super( }) : super(
key: key, key: key,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
elevation: 0, elevation: 0,
actions: <Widget>[ actions: <Widget>[
if (splitViewEnabled) ...<Widget>[
IconButton(
icon: Icon(
expanded ?? false
? FeatherIcons.minimize2
: FeatherIcons.maximize2,
size: 20,
),
onPressed: () {
HapticFeedback.lightImpact();
onZoomTap?.call();
},
),
const Spacer(),
],
ScrollUpIconButton( ScrollUpIconButton(
scrollController: scrollController, scrollController: scrollController,
), ),

View File

@ -189,6 +189,7 @@ class _ReplyBoxState extends State<ReplyBox> {
border: InputBorder.none, border: InputBorder.none,
), ),
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
textCapitalization: TextCapitalization.sentences,
textInputAction: TextInputAction.newline, textInputAction: TextInputAction.newline,
onChanged: widget.onChanged, onChanged: widget.onChanged,
), ),

View File

@ -187,6 +187,7 @@ class _SubmitScreenState extends State<SubmitScreen> {
), ),
), ),
onChanged: context.read<SubmitCubit>().onTextChanged, onChanged: context.read<SubmitCubit>().onTextChanged,
textCapitalization: TextCapitalization.sentences,
), ),
), ),
), ),

View File

@ -1,6 +1,6 @@
name: hacki name: hacki
description: A Hacker News reader. description: A Hacker News reader.
version: 0.2.14+53 version: 0.2.15+54
publish_to: none publish_to: none
environment: environment: