og1_post 0.0.4 copy "og1_post: ^0.0.4" to clipboard
og1_post: ^0.0.4 copied to clipboard

OG1 Post package project.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:og1_post/og1_post.dart';

import 'src/mocks/repository-mock.dart';
import 'src/widgets/news_feed.dart';

void main() {
  runApp(const Og1PostExample());
}

class Og1PostExample extends StatefulWidget {
  const Og1PostExample({Key? key}) : super(key: key);

  @override
  _Og1PostExampleState createState() => _Og1PostExampleState();
}

class _Og1PostExampleState extends State<Og1PostExample> {
  @override
  Widget build(BuildContext context) {
    LikeService likeService = LikeService(
        Theme.of(context).highlightColor, Theme.of(context).highlightColor);

    return MaterialApp(
        theme: ThemeData.dark(),
        home: Scaffold(
            body: Og1NewsFeed(
                key: const PageStorageKey('Og1NewsFeed'),
                currentUser: Repository.currentUser,
                onlineUsers: Repository.onlineUsers,
                stories: Repository.stories,
                posts: Repository.posts,
                actionButtons: ActionButtonsService.defaultActionButtons(
                  Theme.of(context).highlightColor,
                ),
                postActionButtons:
                    PostActionButtonsService.defaultPostActionButtons(context,
                        Theme.of(context).highlightColor, likeService))));
  }
}