Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
fluttering

Neil Jay Warner neiljaywarner

💭
fluttering
View GitHub Profile
@neiljaywarner
neiljaywarner / MainActivity.java
Created Mar 29, 2019
MainActivity.java for add2app scenario with 'custom' plugin internal to package and regular plugin
View MainActivity.java
package com.example.fluttergetstringdriver;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.FrameLayout;
@neiljaywarner
neiljaywarner / main.dart
Created Mar 29, 2019
Platform call and device_info simple plugin usage
View main.dart
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:device_info/device_info.dart';
import 'package:flutter/services.dart';
void main() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await (deviceInfo.androidInfo);
@neiljaywarner
neiljaywarner / GetStringPlugin.java
Created Mar 29, 2019
Simple java file to separate and decouple Android platform call for Flutter a bit while still not having to publish at all.
View GetStringPlugin.java
package com.example.fluttergetstringdriver;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.PluginRegistry;
public class GetStringPlugin implements MethodChannel.MethodCallHandler {
/** Plugin registration. */
public static void registerWith(PluginRegistry.Registrar registrar) {