ready for v1.5 final release
This commit is contained in:
parent
c911698855
commit
f0bd19c030
|
|
@ -3,7 +3,7 @@ name: app-dev
|
||||||
spec:
|
spec:
|
||||||
allow_http: false
|
allow_http: false
|
||||||
disable_default_domains: true
|
disable_default_domains: true
|
||||||
image: app-dev:1.5.0
|
image: app-dev:1.5.4
|
||||||
image_pull_policy: IfNotPresent
|
image_pull_policy: IfNotPresent
|
||||||
path: /
|
path: /
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ class StudioDetailsState extends CoreProvier {
|
||||||
StudioRequestArgs? podcastArgs;
|
StudioRequestArgs? podcastArgs;
|
||||||
final List<int> relatedQueue = [];
|
final List<int> relatedQueue = [];
|
||||||
bool _positionListenerActivated = false;
|
bool _positionListenerActivated = false;
|
||||||
|
AppState alongSideState = AppState.idle;
|
||||||
|
|
||||||
int _selectedDetailsIndex = 0;
|
int _selectedDetailsIndex = 0;
|
||||||
Timer? timer;
|
Timer? timer;
|
||||||
|
|
@ -69,6 +70,9 @@ class StudioDetailsState extends CoreProvier {
|
||||||
MediaService.audioPlayerTag = 'podcast';
|
MediaService.audioPlayerTag = 'podcast';
|
||||||
}
|
}
|
||||||
appState = AppState.busy;
|
appState = AppState.busy;
|
||||||
|
} else {
|
||||||
|
alongSideState = AppState.busy;
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
final service = RequestService(RequestHelper.studioDetails(id, this.args));
|
final service = RequestService(RequestHelper.studioDetails(id, this.args));
|
||||||
await service.httpGet();
|
await service.httpGet();
|
||||||
|
|
@ -90,11 +94,15 @@ class StudioDetailsState extends CoreProvier {
|
||||||
if (isForward == null && !forceFetch) {
|
if (isForward == null && !forceFetch) {
|
||||||
await _handlePodcastPlayback(studio);
|
await _handlePodcastPlayback(studio);
|
||||||
}
|
}
|
||||||
|
alongSideState = AppState.idle;
|
||||||
appState = AppState.idle;
|
appState = AppState.idle;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isForward == null) {
|
if (isForward == null) {
|
||||||
appState = AppState.failed;
|
appState = AppState.failed;
|
||||||
|
} else {
|
||||||
|
alongSideState = AppState.failed;
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:didvan/config/design_config.dart';
|
import 'package:didvan/config/design_config.dart';
|
||||||
import 'package:didvan/config/theme_data.dart';
|
import 'package:didvan/config/theme_data.dart';
|
||||||
import 'package:didvan/constants/app_icons.dart';
|
import 'package:didvan/constants/app_icons.dart';
|
||||||
|
import 'package:didvan/models/enums.dart';
|
||||||
import 'package:didvan/models/studio_details_data.dart';
|
import 'package:didvan/models/studio_details_data.dart';
|
||||||
import 'package:didvan/views/home/comments/comments.dart';
|
import 'package:didvan/views/home/comments/comments.dart';
|
||||||
import 'package:didvan/views/home/comments/comments_state.dart';
|
import 'package:didvan/views/home/comments/comments_state.dart';
|
||||||
|
|
@ -9,6 +10,7 @@ import 'package:didvan/views/home/studio/studio_details/widgets/details_tab_bar.
|
||||||
import 'package:didvan/views/home/widgets/overview/multitype.dart';
|
import 'package:didvan/views/home/widgets/overview/multitype.dart';
|
||||||
import 'package:didvan/views/home/widgets/tag_item.dart';
|
import 'package:didvan/views/home/widgets/tag_item.dart';
|
||||||
import 'package:didvan/views/widgets/didvan/text.dart';
|
import 'package:didvan/views/widgets/didvan/text.dart';
|
||||||
|
import 'package:didvan/views/widgets/shimmer_placeholder.dart';
|
||||||
import 'package:didvan/views/widgets/skeleton_image.dart';
|
import 'package:didvan/views/widgets/skeleton_image.dart';
|
||||||
import 'package:didvan/views/widgets/state_handlers/state_handler.dart';
|
import 'package:didvan/views/widgets/state_handlers/state_handler.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -42,17 +44,6 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
onCommentsTabSelected: onCommentsTabSelected ?? () {},
|
onCommentsTabSelected: onCommentsTabSelected ?? () {},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
StateHandler<StudioDetailsState>(
|
|
||||||
onRetry: () {},
|
|
||||||
state: state,
|
|
||||||
builder: (context, state) {
|
|
||||||
if (state.selectedDetailsIndex == 0) {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxHeight: ds.height -
|
maxHeight: ds.height -
|
||||||
|
|
@ -60,7 +51,19 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
144 -
|
144 -
|
||||||
MediaQuery.of(context).padding.top,
|
MediaQuery.of(context).padding.top,
|
||||||
),
|
),
|
||||||
child: Html(
|
child: StateHandler<StudioDetailsState>(
|
||||||
|
onRetry: () {},
|
||||||
|
state: state,
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state.selectedDetailsIndex == 0) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Html(
|
||||||
data: state.studio.description,
|
data: state.studio.description,
|
||||||
onAnchorTap: (href, context, map, element) =>
|
onAnchorTap: (href, context, map, element) =>
|
||||||
launch(href!),
|
launch(href!),
|
||||||
|
|
@ -74,14 +77,15 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
if (state.studio.tags.isNotEmpty)
|
if (state.studio.tags.isNotEmpty)
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: [
|
children: [
|
||||||
for (var i = 0; i < state.studio.tags.length; i++)
|
for (var i = 0;
|
||||||
|
i < state.studio.tags.length;
|
||||||
|
i++)
|
||||||
TagItem(tag: state.studio.tags[i]),
|
TagItem(tag: state.studio.tags[i]),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -90,21 +94,27 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
if (state.nextStudio != null)
|
if (state.nextStudio != null &&
|
||||||
|
state.alongSideState == AppState.idle)
|
||||||
_StudioPreview(
|
_StudioPreview(
|
||||||
isNext: true,
|
isNext: true,
|
||||||
studio: state.nextStudio!,
|
studio: state.nextStudio!,
|
||||||
scrollController: scrollController,
|
scrollController: scrollController,
|
||||||
),
|
),
|
||||||
if (state.prevStudio != null)
|
if (state.alongSideState == AppState.busy)
|
||||||
|
_StudioPreview.placeHolder,
|
||||||
|
if (state.prevStudio != null &&
|
||||||
|
state.alongSideState == AppState.idle)
|
||||||
_StudioPreview(
|
_StudioPreview(
|
||||||
isNext: false,
|
isNext: false,
|
||||||
studio: state.prevStudio!,
|
studio: state.prevStudio!,
|
||||||
scrollController: scrollController,
|
scrollController: scrollController,
|
||||||
),
|
),
|
||||||
|
if (state.alongSideState == AppState.busy)
|
||||||
|
_StudioPreview.placeHolder,
|
||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -112,11 +122,6 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
if (state.selectedDetailsIndex == 1) {
|
if (state.selectedDetailsIndex == 1) {
|
||||||
return ChangeNotifierProvider<CommentsState>(
|
return ChangeNotifierProvider<CommentsState>(
|
||||||
create: (context) => CommentsState(),
|
create: (context) => CommentsState(),
|
||||||
child: SizedBox(
|
|
||||||
height: ds.height -
|
|
||||||
ds.width * 9 / 16 -
|
|
||||||
144 -
|
|
||||||
MediaQuery.of(context).padding.top,
|
|
||||||
child: Comments(
|
child: Comments(
|
||||||
pageData: {
|
pageData: {
|
||||||
'id': state.studio.id,
|
'id': state.studio.id,
|
||||||
|
|
@ -126,7 +131,6 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
'isPage': false,
|
'isPage': false,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Column(
|
return Column(
|
||||||
|
|
@ -159,6 +163,7 @@ class StudioDetailsWidget extends StatelessWidget {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -237,4 +242,22 @@ class _StudioPreview extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Widget get placeHolder => SizedBox(
|
||||||
|
width: 88,
|
||||||
|
height: 216,
|
||||||
|
child: Column(
|
||||||
|
children: const [
|
||||||
|
ShimmerPlaceholder(width: 88, height: 88),
|
||||||
|
SizedBox(height: 8),
|
||||||
|
ShimmerPlaceholder(height: 20, width: 20),
|
||||||
|
SizedBox(height: 16),
|
||||||
|
ShimmerPlaceholder(height: 14, width: 60),
|
||||||
|
SizedBox(height: 16),
|
||||||
|
ShimmerPlaceholder(height: 12, width: double.infinity),
|
||||||
|
SizedBox(height: 8),
|
||||||
|
ShimmerPlaceholder(height: 12, width: 40),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:universal_html/html.dart' as html;
|
import 'package:universal_html/html.dart' as html;
|
||||||
|
import 'package:universal_html/js.dart' as js;
|
||||||
|
|
||||||
class Splash extends StatefulWidget {
|
class Splash extends StatefulWidget {
|
||||||
const Splash({Key? key}) : super(key: key);
|
const Splash({Key? key}) : super(key: key);
|
||||||
|
|
@ -50,8 +51,8 @@ class _SplashState extends State<Splash> {
|
||||||
value: DesignConfig.systemUiOverlayStyle.copyWith(
|
value: DesignConfig.systemUiOverlayStyle.copyWith(
|
||||||
systemNavigationBarColor: Theme.of(context).colorScheme.background,
|
systemNavigationBarColor: Theme.of(context).colorScheme.background,
|
||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Material(
|
||||||
body: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: const EdgeInsets.all(60),
|
padding: const EdgeInsets.all(60),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,8 @@ class _PlayerNavBar extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
DidvanText(
|
DidvanText(
|
||||||
MediaService.currentPodcast!.title,
|
MediaService.currentPodcast!.title,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
color: DesignConfig.isDark
|
color: DesignConfig.isDark
|
||||||
? null
|
? null
|
||||||
: Theme.of(context).colorScheme.secondCTA,
|
: Theme.of(context).colorScheme.secondCTA,
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ flutter:
|
||||||
# The following line ensures that the Material Icons font is
|
# The following line ensures that the Material Icons font is
|
||||||
# included with your application, so that you can use the icons in
|
# included with your application, so that you can use the icons in
|
||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
uses-material-design: true
|
uses-material-design: false
|
||||||
|
|
||||||
# To add assets to your application, add an assets section, like this:
|
# To add assets to your application, add an assets section, like this:
|
||||||
assets:
|
assets:
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
}
|
}
|
||||||
scriptLoaded = true;
|
scriptLoaded = true;
|
||||||
var scriptTag = document.createElement('script');
|
var scriptTag = document.createElement('script');
|
||||||
scriptTag.src = 'main.dart.js';
|
scriptTag.src = `main.dart.js?version=${Math.random()}`;
|
||||||
scriptTag.type = 'application/javascript';
|
scriptTag.type = 'application/javascript';
|
||||||
document.body.append(scriptTag);
|
document.body.append(scriptTag);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue