2020-07-27 20:43:58 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2020-08-18 00:12:28 +00:00
|
|
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
2020-07-27 20:43:58 +00:00
|
|
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
2020-08-18 00:12:28 +00:00
|
|
|
import 'package:mobile_nebula/services/share.dart';
|
2020-07-27 20:43:58 +00:00
|
|
|
|
|
|
|
class RenderedConfigScreen extends StatelessWidget {
|
|
|
|
final String config;
|
2020-08-18 00:12:28 +00:00
|
|
|
final String name;
|
2020-07-27 20:43:58 +00:00
|
|
|
|
2020-08-18 00:12:28 +00:00
|
|
|
RenderedConfigScreen({Key key, this.config, this.name}) : super(key: key);
|
2020-07-27 20:43:58 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SimplePage(
|
|
|
|
title: 'Rendered Site Config',
|
|
|
|
scrollable: SimpleScrollable.both,
|
2020-08-18 00:12:28 +00:00
|
|
|
trailingActions: <Widget>[
|
|
|
|
PlatformIconButton(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
icon: Icon(context.platformIcons.share, size: 28.0),
|
|
|
|
onPressed: () => Share.share(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),
|
2022-01-19 19:29:30 +00:00
|
|
|
child: SelectableText(config, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14))),
|
2020-07-27 20:43:58 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|