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

81 lines
2.4 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';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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
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',
3 years ago
width: double.maxFinite,
fit: BoxFit.fill,
4 years ago
),
Image.asset('assets/images/HMG_logo.png'),
3 years ago
SizedBox(
height: 8,
),
AppText(
3 years ago
TranslationBase.of(context).updateTheApp.toUpperCase(),
fontSize: 17,
4 years ago
fontWeight: FontWeight.w600,
),
3 years ago
SizedBox(
height: 12,
),
4 years ago
Padding(
padding: const EdgeInsets.all(8.0),
3 years ago
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: AppButton(
color: Colors.red[800],
onPressed: () {
4 years ago
if (Platform.isIOS)
launch(iosLink);
4 years ago
else
launch(androidLink);
4 years ago
},
title: TranslationBase.of(context).updateNow.toUpperCase(),
4 years ago
),
),
),
),
);
}
}