fbmobile/lib/ui/views/about_view.dart

90 lines
3.3 KiB
Dart
Raw Normal View History

2021-02-02 14:33:23 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:flutter_translate/flutter_translate.dart';
import '../../core/enums/viewstate.dart';
import '../../core/viewmodels/about_model.dart';
import '../../ui/shared/text_styles.dart';
import '../../ui/shared/ui_helpers.dart';
import '../widgets/my_appbar.dart';
import 'base_view.dart';
class AboutView extends StatelessWidget {
static const routeName = '/about';
2023-01-04 20:17:54 +00:00
const AboutView({super.key});
2021-02-02 14:33:23 +00:00
@override
Widget build(BuildContext context) {
final logo = Hero(
tag: 'hero',
child: CircleAvatar(
backgroundColor: Colors.transparent,
radius: 30.0,
2021-02-02 14:33:23 +00:00
child: Image.asset('assets/logo_caption.png'),
),
);
return BaseView<AboutModel>(
onModelReady: (model) => model.init(),
2021-02-02 14:33:23 +00:00
builder: (context, model, child) => Scaffold(
appBar: MyAppBar(
title: Text(translate('titles.about')),
enableAbout: false,
),
2023-01-04 20:17:54 +00:00
body: model.state == ViewState.busy
? const Center(child: CircularProgressIndicator())
2021-02-02 14:33:23 +00:00
: Container(
2023-01-04 20:17:54 +00:00
padding: const EdgeInsets.all(0),
2021-02-02 14:33:23 +00:00
child: ListView(
shrinkWrap: true,
2023-01-16 00:44:34 +00:00
padding: const EdgeInsets.only(
left: 10.0, right: 10.0, bottom: 10, top: 10),
2021-02-02 14:33:23 +00:00
children: <Widget>[
UIHelper.verticalSpaceMedium(),
2021-02-02 14:33:23 +00:00
Center(child: logo),
UIHelper.verticalSpaceMedium(),
2021-02-02 14:33:23 +00:00
Center(
child: Text(
translate('about.versions', args: {
'appName': model.packageInfo.appName,
'packageName': model.packageInfo.packageName,
'version': model.packageInfo.version,
'buildNumber': model.packageInfo.buildNumber
}),
2021-02-02 14:33:23 +00:00
)),
UIHelper.verticalSpaceMedium(),
Center(
child: Text(
translate('about.description'),
)),
UIHelper.verticalSpaceMedium(),
Center(
child: Text(
translate('about.faq_headline'),
style: subHeaderStyle,
)),
Center(
child: Text(
translate(('about.faq')),
)),
UIHelper.verticalSpaceMedium(),
2021-02-02 14:33:23 +00:00
Center(
child: Text(
translate('about.contact_us'),
2021-02-02 14:33:23 +00:00
style: subHeaderStyle,
)),
UIHelper.verticalSpaceSmall(),
Center(
child: Linkify(
text: translate('about.website'),
2023-01-04 20:17:54 +00:00
options: const LinkifyOptions(humanize: false),
2021-02-02 14:33:23 +00:00
onOpen: (link) => model.openLink(link.url),
),
)
],
))),
);
}
}