k_social 0.0.4 copy "k_social: ^0.0.4" to clipboard
k_social: ^0.0.4 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
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Social Login Example'),
        ),
        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 Center(
      child: Column(children: [
        ElevatedButton(
          onPressed: () async {
            await ref.read(facebookLoginStateProvider.notifier).login();
          },
          child: Text(loginStatus ? "LogOut" : "LogIn"),
        )
      ]),
    );
  }
}
3
likes
130
points
64
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on k_social