modified: lib/home/appbar/addpodcast.dart
modified: lib/home/appbar/popupmenu.dart modified: lib/home/audio_player.dart modified: lib/home/home.dart modified: test/widget_test.dart
This commit is contained in:
parent
59d208bb03
commit
455d37b727
|
@ -15,7 +15,7 @@ import 'package:tsacdop/class/searchpodcast.dart';
|
||||||
import 'package:tsacdop/class/podcastlocal.dart';
|
import 'package:tsacdop/class/podcastlocal.dart';
|
||||||
import 'package:tsacdop/class/sqflite_localpodcast.dart';
|
import 'package:tsacdop/class/sqflite_localpodcast.dart';
|
||||||
import 'package:tsacdop/home/home.dart';
|
import 'package:tsacdop/home/home.dart';
|
||||||
import 'popupmenu.dart';
|
import 'package:tsacdop/home/appbar/popupmenu.dart';
|
||||||
import 'package:tsacdop/webfeed/webfeed.dart';
|
import 'package:tsacdop/webfeed/webfeed.dart';
|
||||||
|
|
||||||
class MyHomePage extends StatefulWidget {
|
class MyHomePage extends StatefulWidget {
|
||||||
|
@ -29,28 +29,34 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return ChangeNotifierProvider(
|
||||||
key: _scaffoldKey,
|
create: (context) => ImportOmpl(),
|
||||||
appBar: AppBar(
|
child: Scaffold(
|
||||||
elevation: 0,
|
key: _scaffoldKey,
|
||||||
centerTitle: true,
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.grey[100],
|
elevation: 0,
|
||||||
leading: IconButton(
|
centerTitle: true,
|
||||||
tooltip: 'Add',
|
backgroundColor: Colors.grey[100],
|
||||||
icon: const Icon(Icons.add_circle_outline),
|
leading: IconButton(
|
||||||
onPressed: () async {
|
tooltip: 'Add',
|
||||||
await showSearch<int>(
|
icon: const Icon(Icons.add_circle_outline),
|
||||||
context: context,
|
onPressed: () async {
|
||||||
delegate: _delegate,
|
await showSearch<int>(
|
||||||
);
|
context: context,
|
||||||
},
|
delegate: _delegate,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Image(
|
||||||
|
image: AssetImage('assets/text.png'),
|
||||||
|
height: 30,
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
PopupMenu(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
title: Image(image: AssetImage('assets/text.png'), height: 30,),
|
body: Home(),
|
||||||
actions: <Widget>[
|
|
||||||
PopupMenu(),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
body: Home(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,8 +213,8 @@ class _SearchResultState extends State<SearchResult> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final importOmpl = Provider.of<ImportOmpl>(context);
|
ImportOmpl importOmpl = Provider.of<ImportOmpl>(context);
|
||||||
|
|
||||||
savePodcast(String rss) async {
|
savePodcast(String rss) async {
|
||||||
print(rss);
|
print(rss);
|
||||||
if (mounted) setState(() => _adding = true);
|
if (mounted) setState(() => _adding = true);
|
||||||
|
@ -222,37 +228,36 @@ class _SearchResultState extends State<SearchResult> {
|
||||||
|
|
||||||
print(_p.title);
|
print(_p.title);
|
||||||
var dir = await getApplicationDocumentsDirectory();
|
var dir = await getApplicationDocumentsDirectory();
|
||||||
try{
|
try {
|
||||||
Response<List<int>> imageResponse = await Dio().get<List<int>>(
|
Response<List<int>> imageResponse = await Dio().get<List<int>>(
|
||||||
_p.itunes.image.href,
|
_p.itunes.image.href,
|
||||||
options: Options(responseType: ResponseType.bytes));
|
options: Options(responseType: ResponseType.bytes));
|
||||||
|
|
||||||
img.Image image = img.decodeImage(imageResponse.data);
|
img.Image image = img.decodeImage(imageResponse.data);
|
||||||
img.Image thumbnail = img.copyResize(image, width: 300);
|
img.Image thumbnail = img.copyResize(image, width: 300);
|
||||||
File("${dir.path}/${_p.title}.png")
|
File("${dir.path}/${_p.title}.png")
|
||||||
..writeAsBytesSync(img.encodePng(thumbnail));
|
..writeAsBytesSync(img.encodePng(thumbnail));
|
||||||
|
|
||||||
String _primaryColor =
|
String _primaryColor =
|
||||||
await getColor(File("${dir.path}/${_p.title}.png"));
|
await getColor(File("${dir.path}/${_p.title}.png"));
|
||||||
PodcastLocal podcastLocal = PodcastLocal(
|
PodcastLocal podcastLocal = PodcastLocal(
|
||||||
_p.title, _p.itunes.image.href, rss, _primaryColor, _p.author);
|
_p.title, _p.itunes.image.href, rss, _primaryColor, _p.author);
|
||||||
podcastLocal.description = _p.description;
|
podcastLocal.description = _p.description;
|
||||||
var dbHelper = DBHelper();
|
var dbHelper = DBHelper();
|
||||||
await dbHelper.savePodcastLocal(podcastLocal);
|
await dbHelper.savePodcastLocal(podcastLocal);
|
||||||
|
|
||||||
importOmpl.importState = ImportState.parse;
|
importOmpl.importState = ImportState.parse;
|
||||||
|
|
||||||
await dbHelper.savePodcastRss(_p);
|
await dbHelper.savePodcastRss(_p);
|
||||||
|
|
||||||
importOmpl.importState = ImportState.complete;
|
importOmpl.importState = ImportState.complete;
|
||||||
importOmpl.importState = ImportState.stop;
|
importOmpl.importState = ImportState.stop;
|
||||||
print('fatch data');
|
print('fatch data');
|
||||||
}
|
} catch (e) {
|
||||||
catch(e){
|
Fluttertoast.showToast(
|
||||||
Fluttertoast.showToast(
|
msg: 'Network error, Subscribe failed',
|
||||||
msg: 'Network error, Subscribe failed',
|
gravity: ToastGravity.BOTTOM,
|
||||||
gravity: ToastGravity.BOTTOM,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class PopupMenu extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final importOmpl = Provider.of<ImportOmpl>(context);
|
ImportOmpl importOmpl = Provider.of<ImportOmpl>(context);
|
||||||
|
|
||||||
_refreshAll() async {
|
_refreshAll() async {
|
||||||
var dbHelper = DBHelper();
|
var dbHelper = DBHelper();
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:network_image_to_byte/network_image_to_byte.dart';
|
|
||||||
|
|
||||||
import 'package:audiofileplayer/audiofileplayer.dart';
|
import 'package:audiofileplayer/audiofileplayer.dart';
|
||||||
import 'package:audiofileplayer/audio_system.dart';
|
import 'package:audiofileplayer/audio_system.dart';
|
||||||
|
@ -37,7 +36,6 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
String url;
|
String url;
|
||||||
String _title;
|
String _title;
|
||||||
String _feedtitle;
|
String _feedtitle;
|
||||||
String _imgurl;
|
|
||||||
bool _isLoading;
|
bool _isLoading;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -156,10 +154,10 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
}
|
}
|
||||||
return 'NotDownload';
|
return 'NotDownload';
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteData getAudio(String path) {
|
ByteData getAudio(String path) {
|
||||||
File audioFile = File(path);
|
File audioFile = File(path);
|
||||||
Uint8List audio = audioFile.readAsBytesSync();
|
Uint8List audio = audioFile.readAsBytesSync();
|
||||||
return ByteData.view(audio.buffer);
|
return ByteData.view(audio.buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,9 +170,8 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
_title = Provider.of<Urlchange>(context).title;
|
_title = Provider.of<Urlchange>(context).title;
|
||||||
_feedtitle = Provider.of<Urlchange>(context).feedtitle;
|
_feedtitle = Provider.of<Urlchange>(context).feedtitle;
|
||||||
_imgurl = Provider.of<Urlchange>(context).imageurl;
|
_backgroundAudioPlaying = true;
|
||||||
_backgroundAudioPlaying = true;
|
_isLoading = true;
|
||||||
_isLoading = true;
|
|
||||||
_getFile(url).then((result) {
|
_getFile(url).then((result) {
|
||||||
result == 'NotDownload'
|
result == 'NotDownload'
|
||||||
? _initbackgroundAudioPlayer(url)
|
? _initbackgroundAudioPlayer(url)
|
||||||
|
@ -236,11 +233,6 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Uint8List> _networkImageToByte(String url) async {
|
|
||||||
Uint8List byteImage = await networkImageToByte(url);
|
|
||||||
return byteImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
final _pauseButton = AndroidCustomMediaButton(
|
final _pauseButton = AndroidCustomMediaButton(
|
||||||
'pausenow', pausenowButtonId, 'ic_stat_pause_circle_filled');
|
'pausenow', pausenowButtonId, 'ic_stat_pause_circle_filled');
|
||||||
final _replay10Button = AndroidCustomMediaButton(
|
final _replay10Button = AndroidCustomMediaButton(
|
||||||
|
@ -252,7 +244,8 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
|
|
||||||
Future<void> _setNotification() async {
|
Future<void> _setNotification() async {
|
||||||
var dir = await getApplicationDocumentsDirectory();
|
var dir = await getApplicationDocumentsDirectory();
|
||||||
final Uint8List imageBytes = File('${dir.path}/$_feedtitle.png').readAsBytesSync();
|
final Uint8List imageBytes =
|
||||||
|
File('${dir.path}/$_feedtitle.png').readAsBytesSync();
|
||||||
AudioSystem.instance.setMetadata(AudioMetadata(
|
AudioSystem.instance.setMetadata(AudioMetadata(
|
||||||
title: _title,
|
title: _title,
|
||||||
artist: _feedtitle,
|
artist: _feedtitle,
|
||||||
|
@ -290,9 +283,9 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
Provider.of<Urlchange>(context, listen: false).audioState =
|
Provider.of<Urlchange>(context, listen: false).audioState =
|
||||||
AudioState.play;
|
AudioState.play;
|
||||||
});
|
});
|
||||||
var dir = await getApplicationDocumentsDirectory();
|
var dir = await getApplicationDocumentsDirectory();
|
||||||
final Uint8List imageBytes = File('${dir.path}/$_feedtitle.png').readAsBytesSync();
|
final Uint8List imageBytes =
|
||||||
//final Uint8List imageBytes = await _networkImageToByte(_imgurl);
|
File('${dir.path}/$_feedtitle.png').readAsBytesSync();
|
||||||
AudioSystem.instance.setMetadata(AudioMetadata(
|
AudioSystem.instance.setMetadata(AudioMetadata(
|
||||||
title: _title,
|
title: _title,
|
||||||
artist: _feedtitle,
|
artist: _feedtitle,
|
||||||
|
@ -367,141 +360,149 @@ class _PlayerWidgetState extends State<PlayerWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return !_isLoading
|
return ChangeNotifierProvider(
|
||||||
? Center()
|
create: (context) => Urlchange(),
|
||||||
: Container(
|
child: !_isLoading
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
? Center()
|
||||||
color: Colors.grey[100],
|
: Container(
|
||||||
height: 120.0,
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
child: Column(
|
color: Colors.grey[100],
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
height: 120.0,
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
children: <Widget>[
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Container(
|
mainAxisSize: MainAxisSize.min,
|
||||||
alignment: Alignment.centerLeft,
|
children: <Widget>[
|
||||||
child: _remoteErrorMessage != null
|
Container(
|
||||||
? Text(_remoteErrorMessage,
|
alignment: Alignment.centerLeft,
|
||||||
style:
|
child: _remoteErrorMessage != null
|
||||||
const TextStyle(color: const Color(0xFFFF0000)))
|
? Text(_remoteErrorMessage,
|
||||||
: Text(
|
style: const TextStyle(
|
||||||
_remoteAudioLoading ? 'Buffring...' : '',
|
color: const Color(0xFFFF0000)))
|
||||||
style: TextStyle(color: Colors.blue),
|
: Text(
|
||||||
|
_remoteAudioLoading ? 'Buffring...' : '',
|
||||||
|
style: TextStyle(color: Colors.blue),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SliderTheme(
|
||||||
|
data: SliderTheme.of(context).copyWith(
|
||||||
|
activeTrackColor: Colors.blue[100],
|
||||||
|
inactiveTrackColor: Colors.grey[300],
|
||||||
|
trackHeight: 2.0,
|
||||||
|
thumbColor: Colors.blue[400],
|
||||||
|
thumbShape:
|
||||||
|
RoundSliderThumbShape(enabledThumbRadius: 5.0),
|
||||||
|
overlayColor: Colors.blue.withAlpha(32),
|
||||||
|
overlayShape:
|
||||||
|
RoundSliderOverlayShape(overlayRadius: 14.0),
|
||||||
|
),
|
||||||
|
child: Slider(
|
||||||
|
value: _seekSliderValue,
|
||||||
|
onChanged: (double val) {
|
||||||
|
setState(() => _seekSliderValue = val);
|
||||||
|
final double positionSeconds =
|
||||||
|
val * _backgroundAudioDurationSeconds;
|
||||||
|
_backgroundAudio.seek(positionSeconds);
|
||||||
|
AudioSystem.instance
|
||||||
|
.setPlaybackState(true, positionSeconds);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 20.0,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
_stringForSeconds(
|
||||||
|
_backgroundAudioPositionSeconds) ??
|
||||||
|
'',
|
||||||
|
style: TextStyle(fontSize: 10),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
SliderTheme(
|
child: Container(
|
||||||
data: SliderTheme.of(context).copyWith(
|
padding: EdgeInsets.symmetric(horizontal: 30),
|
||||||
activeTrackColor: Colors.blue[100],
|
alignment: Alignment.center,
|
||||||
inactiveTrackColor: Colors.grey[300],
|
child: (_title.length > 50)
|
||||||
trackHeight: 2.0,
|
? Marquee(
|
||||||
thumbColor: Colors.blue[400],
|
text: _title,
|
||||||
thumbShape:
|
style:
|
||||||
RoundSliderThumbShape(enabledThumbRadius: 5.0),
|
TextStyle(fontWeight: FontWeight.bold),
|
||||||
overlayColor: Colors.blue.withAlpha(32),
|
scrollAxis: Axis.horizontal,
|
||||||
overlayShape:
|
crossAxisAlignment:
|
||||||
RoundSliderOverlayShape(overlayRadius: 14.0),
|
CrossAxisAlignment.start,
|
||||||
|
blankSpace: 30.0,
|
||||||
|
velocity: 50.0,
|
||||||
|
pauseAfterRound: Duration(seconds: 1),
|
||||||
|
startPadding: 30.0,
|
||||||
|
accelerationDuration: Duration(seconds: 1),
|
||||||
|
accelerationCurve: Curves.linear,
|
||||||
|
decelerationDuration:
|
||||||
|
Duration(milliseconds: 500),
|
||||||
|
decelerationCurve: Curves.easeOut,
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
_title,
|
||||||
|
style:
|
||||||
|
TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Text(
|
||||||
|
_stringForSeconds(
|
||||||
|
_backgroundAudioDurationSeconds) ??
|
||||||
|
'',
|
||||||
|
style: TextStyle(fontSize: 10),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Slider(
|
Row(
|
||||||
value: _seekSliderValue,
|
mainAxisSize: MainAxisSize.min,
|
||||||
onChanged: (double val) {
|
children: [
|
||||||
setState(() => _seekSliderValue = val);
|
IconButton(
|
||||||
final double positionSeconds =
|
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||||
val * _backgroundAudioDurationSeconds;
|
onPressed: _backgroundAudioPlaying
|
||||||
_backgroundAudio.seek(positionSeconds);
|
? () => _forwardBackgroundAudio(-10)
|
||||||
AudioSystem.instance
|
: null,
|
||||||
.setPlaybackState(true, positionSeconds);
|
iconSize: 25.0,
|
||||||
}),
|
icon: Icon(Icons.replay_10),
|
||||||
),
|
color: Colors.black),
|
||||||
Container(
|
_backgroundAudioPlaying
|
||||||
height: 20.0,
|
? IconButton(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||||
child: Row(
|
onPressed: _backgroundAudioPlaying
|
||||||
children: <Widget>[
|
? () {
|
||||||
Text(
|
_pauseBackgroundAudio();
|
||||||
_stringForSeconds(_backgroundAudioPositionSeconds) ??
|
}
|
||||||
'',
|
: null,
|
||||||
style: TextStyle(fontSize: 10),
|
iconSize: 32.0,
|
||||||
),
|
icon: Icon(Icons.pause_circle_filled),
|
||||||
Expanded(
|
color: Colors.black)
|
||||||
child: Container(
|
: IconButton(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30),
|
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||||
alignment: Alignment.center,
|
onPressed: _backgroundAudioPlaying
|
||||||
child: (_title.length > 50)
|
? null
|
||||||
? Marquee(
|
: () {
|
||||||
text: _title,
|
_resumeBackgroundAudio();
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
},
|
||||||
scrollAxis: Axis.horizontal,
|
iconSize: 32.0,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
icon: Icon(Icons.play_circle_filled),
|
||||||
blankSpace: 30.0,
|
color: Colors.black),
|
||||||
velocity: 50.0,
|
IconButton(
|
||||||
pauseAfterRound: Duration(seconds: 1),
|
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||||
startPadding: 30.0,
|
onPressed: _backgroundAudioPlaying
|
||||||
accelerationDuration: Duration(seconds: 1),
|
? () => _forwardBackgroundAudio(30)
|
||||||
accelerationCurve: Curves.linear,
|
: null,
|
||||||
decelerationDuration:
|
iconSize: 25.0,
|
||||||
Duration(milliseconds: 500),
|
icon: Icon(Icons.forward_30),
|
||||||
decelerationCurve: Curves.easeOut,
|
color: Colors.black),
|
||||||
)
|
/*IconButton(
|
||||||
: Text(
|
|
||||||
_title,
|
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
Text(
|
|
||||||
_stringForSeconds(_backgroundAudioDurationSeconds) ??
|
|
||||||
'',
|
|
||||||
style: TextStyle(fontSize: 10),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
IconButton(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
|
||||||
onPressed: _backgroundAudioPlaying
|
|
||||||
? () => _forwardBackgroundAudio(-10)
|
|
||||||
: null,
|
|
||||||
iconSize: 25.0,
|
|
||||||
icon: Icon(Icons.replay_10),
|
|
||||||
color: Colors.black),
|
|
||||||
_backgroundAudioPlaying
|
|
||||||
? IconButton(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
|
||||||
onPressed: _backgroundAudioPlaying
|
|
||||||
? () {
|
|
||||||
_pauseBackgroundAudio();
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
iconSize: 32.0,
|
|
||||||
icon: Icon(Icons.pause_circle_filled),
|
|
||||||
color: Colors.black)
|
|
||||||
: IconButton(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
|
||||||
onPressed: _backgroundAudioPlaying
|
|
||||||
? null
|
|
||||||
: () {
|
|
||||||
_resumeBackgroundAudio();
|
|
||||||
},
|
|
||||||
iconSize: 32.0,
|
|
||||||
icon: Icon(Icons.play_circle_filled),
|
|
||||||
color: Colors.black),
|
|
||||||
IconButton(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
|
||||||
onPressed: _backgroundAudioPlaying
|
|
||||||
? () => _forwardBackgroundAudio(30)
|
|
||||||
: null,
|
|
||||||
iconSize: 25.0,
|
|
||||||
icon: Icon(Icons.forward_30),
|
|
||||||
color: Colors.black),
|
|
||||||
/*IconButton(
|
|
||||||
onPressed: _isPlaying || _isPaused ? () => _stop() : null,
|
onPressed: _isPlaying || _isPaused ? () => _stop() : null,
|
||||||
iconSize: 32.0,
|
iconSize: 32.0,
|
||||||
icon: Icon(Icons.stop),
|
icon: Icon(Icons.stop),
|
||||||
color: Colors.black), */
|
color: Colors.black), */
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
);
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:tsacdop/class/audiostate.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../podcasts/podcastlist.dart';
|
import 'package:tsacdop/podcasts/podcastlist.dart';
|
||||||
import 'hometab.dart';
|
import 'hometab.dart';
|
||||||
import 'package:tsacdop/home/appbar/importompl.dart';
|
import 'package:tsacdop/home/appbar/importompl.dart';
|
||||||
import 'audio_player.dart';
|
import 'package:tsacdop/home/audio_player.dart';
|
||||||
import 'homescroll.dart';
|
import 'homescroll.dart';
|
||||||
import 'package:tsacdop/util/pageroute.dart';
|
import 'package:tsacdop/util/pageroute.dart';
|
||||||
|
|
||||||
|
@ -16,15 +18,17 @@ class Home extends StatefulWidget {
|
||||||
class _HomeState extends State<Home> {
|
class _HomeState extends State<Home> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return ChangeNotifierProvider(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
create: (context) => Urlchange(),
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
children: <Widget>[
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Import(),
|
mainAxisSize: MainAxisSize.min,
|
||||||
Container(
|
children: <Widget>[
|
||||||
height: 30,
|
Import(),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
Container(
|
||||||
alignment: Alignment.bottomRight,
|
height: 30,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
|
@ -43,12 +47,12 @@ class _HomeState extends State<Home> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(child: ScrollPodcasts()),
|
Container(child: ScrollPodcasts()),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: MainTab(),
|
child: MainTab(),
|
||||||
),
|
),
|
||||||
PlayerWidget(),
|
PlayerWidget(),
|
||||||
],
|
],
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,15 @@ void main() {
|
||||||
await tester.pumpWidget(MyApp());
|
await tester.pumpWidget(MyApp());
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
// Verify that our counter starts at 0.
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('Favorites'), findsOneWidget);
|
||||||
expect(find.text('1'), findsNothing);
|
expect(find.text('Next'), findsNothing);
|
||||||
|
|
||||||
// Tap the '+' icon and trigger a frame.
|
// Tap the '+' icon and trigger a frame.
|
||||||
await tester.tap(find.byIcon(Icons.add));
|
//await tester.tap(find.byIcon(Icons.add));
|
||||||
await tester.pump();
|
//await tester.pump();
|
||||||
|
|
||||||
// Verify that our counter has incremented.
|
// Verify that our counter has incremented.
|
||||||
expect(find.text('0'), findsNothing);
|
//expect(find.text('0'), findsNothing);
|
||||||
expect(find.text('1'), findsOneWidget);
|
//expect(find.text('1'), findsOneWidget);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue