From b75cf7da1386f647f4106c424783f4759baa8b86 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 27 Oct 2023 11:32:45 -0500 Subject: [PATCH] carga --- lib/src/screens/reputacion_pro.dart | 26 +++++++++++++++++--------- lib/src/screens/reputation.dart | 26 +++++++++++++++++--------- lib/src/screens/web_view.dart | 29 ++++++++++++++++++----------- 3 files changed, 52 insertions(+), 29 deletions(-) diff --git a/lib/src/screens/reputacion_pro.dart b/lib/src/screens/reputacion_pro.dart index 0a1b486..3b58482 100644 --- a/lib/src/screens/reputacion_pro.dart +++ b/lib/src/screens/reputacion_pro.dart @@ -29,6 +29,21 @@ class _ReputationProScreenState extends State { } } + Widget _scoreList(List list) { + if (list.isEmpty) { + return const Padding( + padding: EdgeInsets.symmetric(vertical: 40), + child: Center( + child: Text('Sin calificaciones'), + ), + ); + } else { + return Column( + children: list.map((e) => _scoreItem(e)).toList(), + ); + } + } + @override Widget build(BuildContext context) { return Scaffold( @@ -38,18 +53,11 @@ class _ReputationProScreenState extends State { }, label: 'Reputación'), body: SingleChildScrollView( - child: Column( - children: [ - ..._scoresList(scoresModel?.details ?? []), - ], - )), + child: _scoreList(scoresModel?.details ?? []), + ), ); } - List _scoresList(List list) { - return list.map((e) => _scoreItem(e)).toList(); - } - Widget _scoreItem(ScoreDetailModel scoreDetails) { return ListTile( onTap: () {}, diff --git a/lib/src/screens/reputation.dart b/lib/src/screens/reputation.dart index 4b3fd7a..e37c28b 100644 --- a/lib/src/screens/reputation.dart +++ b/lib/src/screens/reputation.dart @@ -29,6 +29,21 @@ class _ReputationScreenState extends State { } } + Widget _scoreList(List list) { + if (list.isEmpty) { + return const Padding( + padding: EdgeInsets.symmetric(vertical: 40), + child: Center( + child: Text('Sin calificaciones'), + ), + ); + } else { + return Column( + children: list.map((e) => _scoreItem(e)).toList(), + ); + } + } + @override Widget build(BuildContext context) { return Scaffold( @@ -38,18 +53,11 @@ class _ReputationScreenState extends State { }, label: 'Reputación'), body: SingleChildScrollView( - child: Column( - children: [ - ..._scoresList(scoresModel?.details ?? []), - ], - )), + child: _scoreList(scoresModel?.details ?? []), + ), ); } - List _scoresList(List list) { - return list.map((e) => _scoreItem(e)).toList(); - } - Widget _scoreItem(ScoreDetailModel scoreDetails) { return ListTile( onTap: () {}, diff --git a/lib/src/screens/web_view.dart b/lib/src/screens/web_view.dart index acd304d..7838457 100644 --- a/lib/src/screens/web_view.dart +++ b/lib/src/screens/web_view.dart @@ -19,9 +19,7 @@ class _WebViewScreenState extends State { ..setBackgroundColor(const Color(0x00000000)) ..setNavigationDelegate( NavigationDelegate( - onProgress: (int progress) { - // Update loading bar. - }, + onProgress: (int progress) {}, onPageStarted: (String url) {}, onPageFinished: (String url) {}, onWebResourceError: (WebResourceError error) {}, @@ -35,13 +33,22 @@ class _WebViewScreenState extends State { ) ..loadRequest(Uri.parse(widget.link)); return Scaffold( - appBar: PopAppbar( - onPressed: () { - Navigator.pop(context); - }, - label: widget.label, - ), - body: WebViewWidget(controller: controller), - ); + appBar: PopAppbar( + onPressed: () { + Navigator.pop(context); + }, + label: widget.label, + ), + body: Stack( + children: [ + const Center(child: CircularProgressIndicator()), + WebViewWidget(controller: controller), + ], + ) + + // isLoading + // ? const Center(child: CircularProgressIndicator()) + // : WebViewWidget(controller: controller), + ); } }