flutter_showcase 0.1.0

Flutter Android iOS web

A fast, easy and cool way to share you flutter project with the world.


import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'apps/apps.dart';
import 'indicator/smooth_page_indicator.dart';
import 'indicator/effects/expanding_dots_effect.dart';
import 'package:flutter_showcase/flutter_showcase.dart';

void main() => runApp(Examples());

class Examples extends StatefulWidget {
  State<StatefulWidget> createState() => _ExamplesState();

class _ExamplesState extends State<Examples> {
  PageController pageController;
  void initState() {
    pageController = PageController(initialPage: 0);

  Widget build(BuildContext context) {
    return Directionality(
        textDirection: TextDirection.ltr,
        child: Stack(children: [
              controller: pageController,
              scrollDirection: Axis.vertical,
              itemBuilder: (context, index) {
                if (index > 0 && index <= GskinnerApps.values.length) {
                  final app = GskinnerApps.values[index - 1];
                  return app.showcase;
                } else {
                  return Showcase(
                      title: 'Flutter Showcase',
                      app: MyApp(pageController: pageController),
                      description: '''
Share your Flutter project with the world            
                      template: SimpleTemplate(reverse: false),
                      theme: TemplateThemeData(
                          backgroundColor: Colors.grey[100],
                              TextStyle(fontWeight: FontWeight.w700),
                          descriptionTextStyle: TextStyle(
                              fontSize: 24,
                              height: 1.2,
                              fontWeight: FontWeight.w200)),
                      links: [
                      logoLink: LinkData(
                          icon: Image.asset('assets/jaime_logo.png',
                              fit: BoxFit.fitHeight),
                          url: 'https://github.com/jamesblasco'));
              itemCount: 1 + GskinnerApps.values.length),
              alignment: Alignment.centerRight,
              child: Padding(
                  padding: EdgeInsets.all(20),
                  child: SmoothPageIndicator(
                      controller: pageController,
                      count: 1 + GskinnerApps.values.length,
                      effect: ExpandingDotsEffect(
                          radius: 14,
                          dotHeight: 10,
                          dotWidth: 10,
                          dotColor: Colors.black12,
                          activeDotColor: Colors.black87))))

class MyApp extends StatelessWidget {
  final PageController pageController;
  const MyApp({Key key, this.pageController}) : super(key: key);
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Showcase',
        builder: (context, child) =>
            FrameBuilder(app: child, builder: Frame.builder),
        debugShowCheckedModeBanner: false,
        theme: ThemeData(accentColor: Colors.black, primaryColor: Colors.white),
        home: MyHomePage(title: 'Your app', pageController: pageController));

class MyHomePage extends StatefulWidget {
  final PageController pageController;
  MyHomePage({Key key, this.title, this.pageController}) : super(key: key);
  final String title;
  _MyHomePageState createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
            child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
          Text('Add your App here',
              style: Theme.of(context)
                  .copyWith(color: Colors.black87)),
          SizedBox(height: 8),
          Text('Make your showcase project interactive',
              style: TextStyle(fontSize: 20)),
          SizedBox(height: 200),
          Text('Scroll down\nto explore some examples',
              style: TextStyle(fontSize: 20), textAlign: TextAlign.center),
          SizedBox(height: 20),
              onPressed: () => widget.pageController?.animateToPage(1,
                  duration: Duration(seconds: 1), curve: Curves.easeInOutQuart),
              tooltip: 'Scroll',
              child: Icon(Icons.arrow_downward))