Skip to content

Instantly share code, notes, and snippets.

@rodydavis
Created July 3, 2018 13:02
Show Gist options
  • Save rodydavis/88c0ccbadea7de14c7802fc3e767f884 to your computer and use it in GitHub Desktop.
Save rodydavis/88c0ccbadea7de14c7802fc3e767f884 to your computer and use it in GitHub Desktop.
Example of using the whats new custom widget for flutter.
import 'package:flutter/material.dart';
import 'package:Unify_Mobile/globals.dart' as globals;
import 'package:Unify_Mobile/custom/whatsnew.dart';
class StartPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<WhatsNewItem> _items = [
WhatsNewItem(
title: Text('Dart Theme'),
subtitle: Text('Black and grey theme'),
leading: Icon(Icons.color_lens),
onPressed: () {
Navigator.of(context).popAndPushNamed("/settings");
},
),
WhatsNewItem(
title: Text('Quick Send'),
subtitle: Text('Step by step guide for sending emails'),
leading: Icon(Icons.send),
onPressed: () {
Navigator.of(context).popAndPushNamed("/settings");
},
),
WhatsNewItem(
title: Text('Video List Layout'),
subtitle: Text('Choose between a Grid layout and List layout'),
leading: Icon(Icons.grid_on),
onPressed: () {
Navigator.of(context).popAndPushNamed("/settings");
},
),
WhatsNewItem(
title: Text('Thumbnail Management'),
subtitle:
Text('Edit and view the current video for any editable email'),
leading: Icon(Icons.color_lens),
onPressed: () {
globals.Utility.showAlertPopup(context, "Info",
"Select a video, go to the video details (bottom right icon), scroll down to the thumbnail tile.");
},
),
];
return new Scaffold(
body: SafeArea(
child: WhatsNewPage(
title: Text(
"What's New",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
),
),
buttonText: Text('Continue'),
items: _items,
onPressed: () {
Navigator.of(context).popAndPushNamed("/menu");
},
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment