2020-07-27 15:43:58 -05:00
|
|
|
import 'package:flutter/material.dart';
|
2020-08-17 19:12:28 -05:00
|
|
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
2020-07-27 15:43:58 -05:00
|
|
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
2020-08-17 19:12:28 -05:00
|
|
|
import 'package:mobile_nebula/services/share.dart';
|
2020-07-27 15:43:58 -05:00
|
|
|
|
|
|
|
class RenderedConfigScreen extends StatelessWidget {
|
|
|
|
final String config;
|
2020-08-17 19:12:28 -05:00
|
|
|
final String name;
|
2020-07-27 15:43:58 -05:00
|
|
|
|
2022-09-21 15:27:35 -05:00
|
|
|
RenderedConfigScreen({
|
|
|
|
Key? key,
|
|
|
|
required this.config,
|
|
|
|
required this.name,
|
|
|
|
}) : super(key: key);
|
2020-07-27 15:43:58 -05:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SimplePage(
|
2022-11-17 16:43:16 -05:00
|
|
|
title: Text('Rendered Site Config'),
|
2020-07-27 15:43:58 -05:00
|
|
|
scrollable: SimpleScrollable.both,
|
2020-08-17 19:12:28 -05:00
|
|
|
trailingActions: <Widget>[
|
2024-09-20 14:19:23 -04: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-08-17 19:12:28 -05:00
|
|
|
],
|
2020-07-27 15:43:58 -05:00
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width),
|
2022-01-19 13:29:30 -06:00
|
|
|
child: SelectableText(config, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14))),
|
2020-07-27 15:43:58 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|