You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/UpdatePage.dart

72 lines
2.2 KiB
Dart

3 years ago
// @dart=2.9
4 years ago
import 'dart:io' show Platform;
4 years ago
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
4 years ago
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
4 years ago
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
4 years ago
import 'widgets/shared/buttons/secondary_button.dart';
4 years ago
class UpdatePage extends StatelessWidget {
final String message;
final String androidLink;
final String iosLink;
4 years ago
const UpdatePage({Key key, this.message, this.androidLink, this.iosLink})
: super(key: key);
4 years ago
@override
Widget build(BuildContext context) {
return SafeArea(
child: AppScaffold(
isShowAppBar: false,
backgroundColor: Colors.white,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
'assets/images/update_rocket_image.png',
width: double.maxFinite,fit: BoxFit.fill,
4 years ago
),
Image.asset('assets/images/HMG_logo.png'),
SizedBox(height: 8,),
AppText(
TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17,
4 years ago
fontWeight: FontWeight.w600,
),
SizedBox(height: 12,),
4 years ago
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(message??"Update the app",fontSize: 12,),
4 years ago
)
4 years ago
],
),
),
bottomSheet: Container(
height: 80,
child: Container(
// padding: const EdgeInsets.all(8.0),
margin: EdgeInsets.all(15),
child: SecondaryButton(
color: Colors.red[800],
4 years ago
onTap: () {
if (Platform.isIOS)
launch(iosLink);
4 years ago
else
launch(androidLink);
4 years ago
},
label: TranslationBase.of(context).updateNow.toUpperCase(),
4 years ago
),
),
),
),
);
}
}