Skip to content

Commit

Permalink
added image to no_internet
Browse files Browse the repository at this point in the history
  • Loading branch information
bugudiramu committed Sep 4, 2019
1 parent 3480491 commit f4fa46e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/ui/articleDetail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class ArticleDetail extends StatefulWidget {

class _ArticleDetailState extends State<ArticleDetail> {
final myUrl = "https://buzzyfeed.page.link/AJDA";
final img =
"https://carepharmaceuticals.com.au/wp-content/uploads/sites/19/2018/02/placeholder-600x400.png";

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down
37 changes: 34 additions & 3 deletions lib/ui/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:news_app/services/googleSignIn.dart';
import 'package:news_app/services/usermanagement.dart';
import 'package:news_app/ui/articles.dart';
import 'package:random_color/random_color.dart';
import 'package:rflutter_alert/rflutter_alert.dart';
// import 'package:rflutter_alert/rflutter_alert.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:data_connection_checker/data_connection_checker.dart';

Expand Down Expand Up @@ -230,7 +230,38 @@ class _LoginState extends State<Login> with SingleTickerProviderStateMixin {
if (result == true) {
print("Connected");
} else {
Alert(
showDialog(
context: context,
builder: (_) {
return AlertDialog(
semanticLabel: "No Internet Dialog",

shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50.0)),
content: Image.asset("images/no_internet.gif"),
title: Column(
children: <Widget>[
Container(
alignment: Alignment.center,
child: Text(
"No Internet",
style: Theme.of(context).textTheme.headline,
),
),

],
),
// actions: <Widget>[
// FlatButton(
// child: Text("Ok"),
// onPressed: () {
// Navigator.of(context).pop();
// },
// )
// ],
);
});
/*Alert(
context: context,
type: AlertType.info,
title: "No Internet",
Expand All @@ -252,7 +283,7 @@ class _LoginState extends State<Login> with SingleTickerProviderStateMixin {
width: 120,
)
],
).show();
).show();*/
print('No internet :( Reason:');
print(DataConnectionChecker().lastTryResults);
}
Expand Down

0 comments on commit f4fa46e

Please sign in to comment.