forked from TheAlphamerc/flutter_twitter_clone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7958d4
commit b890649
Showing
5 changed files
with
165 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_twitter_clone/helper/theme.dart'; | ||
import 'package:flutter_twitter_clone/helper/utility.dart'; | ||
import 'package:flutter_twitter_clone/page/common/splash.dart'; | ||
import 'package:flutter_twitter_clone/widgets/customWidgets.dart'; | ||
import 'package:flutter_twitter_clone/widgets/newWidget/title_text.dart'; | ||
|
||
class UpdateApp extends StatefulWidget { | ||
const UpdateApp({Key key}) : super(key: key); | ||
|
||
@override | ||
_UpdateAppState createState() => _UpdateAppState(); | ||
} | ||
|
||
class _UpdateAppState extends State<UpdateApp> with WidgetsBindingObserver { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
WidgetsBinding.instance.addObserver(this); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
WidgetsBinding.instance.removeObserver(this); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
void didChangeAppLifecycleState(AppLifecycleState state) { | ||
if (state == AppLifecycleState.resumed) { | ||
Navigator.pushReplacement( | ||
context, MaterialPageRoute(builder: (context) => SplashPage())); | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: TwitterColor.mystic, | ||
body: Container( | ||
margin: EdgeInsets.symmetric(horizontal: 36), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Image.asset("assets/images/icon-480.png"), | ||
TitleText( | ||
"New Update is available", | ||
fontSize: 25, | ||
textAlign: TextAlign.center, | ||
), | ||
SizedBox(height: 20), | ||
TitleText( | ||
"The current version of app is no longer supported. We aploigize for any inconveiience we may have caused you", | ||
fontSize: 14, | ||
color: AppColor.darkGrey, | ||
textAlign: TextAlign.center, | ||
), | ||
SizedBox(height: 30), | ||
Container( | ||
width: fullWidth(context), | ||
margin: EdgeInsets.symmetric(vertical: 35), | ||
child: FlatButton( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(30)), | ||
color: TwitterColor.dodgetBlue, | ||
onPressed: () { | ||
launchURL( | ||
"https://play.google.com/store/apps/details?id=com.thealphamerc.flutter_twitter_clone"); | ||
}, | ||
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 10), | ||
child: TitleText('Update now', color: Colors.white), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters