Flutter PPTX

A Flutter plugin for creating PowerPoint presentations.

Getting Started

import 'package:flutter_pptx/flutter_pptx.dart';

final pres = Powerpoint();

Adding Slides

Title Slide

pres.addTitle(
    title: 'Title',
);

Title and Photo Slide

pres.addTitleAndPhoto(
    title: 'Title',
    imagePath: './samples/images/sample_gif.gif',
    imageName: 'Sample Gif',
);

Title and Photo Slide (Alternative)

pres.addTitleAndPhotoAlt(
    title: 'Title',
    imagePath: './samples/images/sample_jpg.jpg',
    imageName: 'Sample Jpg',
);

Title and Bullets Slide

pres.addTitleAndBullets(
    title: 'Title',
    bullets: [
        'Bullet 1',
        'Bullet 2',
        'Bullet 3',
        'Bullet 4',
    ],
);

Bullets Slide

pres.addBullets(
    bullets: [
        'Bullet 1',
        'Bullet 2',
        'Bullet 3',
        'Bullet 4',
    ],
);

Title, Bullets, and Photo Slide

pres.addSlideTitleBulletsAndPhoto(
    title: 'Title',
    imagePath: './samples/images/sample_jpg.jpg',
    imageName: 'Sample Jpg',
    bullets: [
        'Bullet 1',
        'Bullet 2',
        'Bullet 3',
        'Bullet 4',
    ],
);

Section Slide

pres.addSection(
    section: 'Section 1',
);

Title Only Slide

pres.addSlideTitleOnly(
    title: 'Title 1',
    subtitle: 'Subtitle 1',
);

Agenda Slide

pres.addSlideAgenda(
    title: 'Title 1',
    subtitle: 'Subtitle 1',
    topics: 'Topics 1',
);

Statement Slide

pres.addSlideStatement(
    statement: 'Statement 1',
);

Big Fact Slide

pres.addBigFact(
    fact: 'Title 1',
    information: 'Fact 1',
);

Quote Slide

pres.addSlideQuote(
    quote: 'Quote 1',
    attribution: 'Attribution 1',
);

Photo 3 Up Slide

pres.addSlidePhoto3Up(
    image1Path: './samples/images/sample_gif.gif',
    image2Path: './samples/images/sample_jpg.jpg',
    image3Path: './samples/images/sample_png.png',
);

Photo Slide

pres.addSlidePhoto(
    imagePath: './samples/images/sample_gif.gif',
);

Blank Slide

pres.addSlideBlank();

Widget Slide

await pres.addSlideWidget(Center(
  child: Container(
      padding: const EdgeInsets.all(30.0),
      decoration: BoxDecoration(
      border: Border.all(color: Colors.blueAccent, width: 5.0),
      color: Colors.redAccent,
    ),
    child: const Text("This is an invisible widget"),
  ),
));

Thanks to the screenshot package!

Background Properties

Background Color

slide.background.color = '000000';

Background Image

slide.background.image = ImageReference(
    path: './samples/images/sample_gif.gif',
    name: 'Sample Gif',
);

Presentation Properties

Show/Hide Slide Number

pres.showSlideNumber = true;

Exporting

Save to bytes

final bytes = await pres.save();

Links

GitHub

View Github