3
0
Fork 0
trifid_mobile/lib/screens/siteConfig/RenderedConfigScreen.dart

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.3 KiB
Dart
Raw Permalink Normal View History

2020-07-27 20:43:58 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
2020-07-27 20:43:58 +00:00
import 'package:mobile_nebula/components/SimplePage.dart';
import 'package:mobile_nebula/services/share.dart';
2020-07-27 20:43:58 +00:00
class RenderedConfigScreen extends StatelessWidget {
final String config;
final String name;
2020-07-27 20:43:58 +00:00
RenderedConfigScreen({
Key? key,
required this.config,
required this.name,
}) : super(key: key);
2020-07-27 20:43:58 +00:00
@override
Widget build(BuildContext context) {
return SimplePage(
title: Text('Rendered Site Config'),
2020-07-27 20:43:58 +00:00
scrollable: SimpleScrollable.both,
trailingActions: <Widget>[
2023-05-15 20:12:24 +00:00
Builder(
builder: (BuildContext context) {
return PlatformIconButton(
padding: EdgeInsets.zero,
icon: Icon(context.platformIcons.share, size: 28.0),
onPressed: () =>
Share.share(context,
title: '$name.yaml', text: config, filename: '$name.yaml'),
);
}
),
],
2020-07-27 20:43:58 +00:00
child: Container(
padding: EdgeInsets.all(5),
constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width),
child: SelectableText(config, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14))),
2020-07-27 20:43:58 +00:00
);
}
}