k_social 0.0.2 copy "k_social: ^0.0.2" to clipboard
k_social: ^0.0.2 copied to clipboard

개빡쳐서 만든 한국용 소셜 플러그인

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'core/facebook_login_state_provider.dart';

void main() {
  runApp(
    const ProviderScope(
      child: MyApp(),
    ),
  );
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Social Plugin for Korea'),
        ),
        body: const FacebookLoginPageView(),
      ),
    );
  }
}

class FacebookLoginPageView extends ConsumerWidget {
  const FacebookLoginPageView({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final bool loginStatus = ref.watch(facebookLoginStateProvider);

    return Column(children: [
      ElevatedButton(
        onPressed: () async {
          await ref.read(facebookLoginStateProvider.notifier).login();
        },
        child: Text(loginStatus ? "LogOut" : "LogIn"),
      )
    ]);
  }
}
3
likes
0
points
63
downloads

Publisher

unverified uploader

Weekly Downloads

개빡쳐서 만든 한국용 소셜 플러그인

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on k_social