Skip to content

Latest commit

 

History

History
114 lines (88 loc) · 2.46 KB

package.md

File metadata and controls

114 lines (88 loc) · 2.46 KB

使えそうなパッケージ

shared_preferences

import 'package:shared_preferences/shared_preferences.dart';

saveFlag(bool flag) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  prefs.setBool('FLAG', flag);
}
loadFlag() async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return prefs.getBool('FLAG') ?? false;
}

url_launcher

IconButton(
  icon: Icon(Icons.open_in_browser),
  onPressed: () async {
    String url = Uri.encodeFull("https://www.google.co.jp");
    if (await canLaunch(url)) {
      await launch(
        url,
        forceSafariVC: true, // アプリ内で開くことを強制.
        forceWebView: true, // アプリ内で開くことを強制.
      );
    }
  }
)

flutter_launcher_icons

dev_dependencies:
  flutter_launcher_icons: "^0.10.0"

flutter_icons:
  android: true
  ios: true
  image_path: "assets/icon/icon.png"
  adaptive_icon_foreground: "assets/icon/icon_adaptive_foreground.png"
  adaptive_icon_background: "#ffffff"

上記にアイコンファイルの元を配置して以下コマンド

$ flutter pub get
$ flutter pub run flutter_launcher_icons:main

font_awesome_flutter

font_awesome_flutter: ^9.0.0
// FaIconとIconの違いがわからない.
FaIcon(FontAwesomeIcons.amazon, color: Colors.redAccent,)
Icon(FontAwesomeIcons.amazon, color: Colors.redAccent,)

flushbar / another_flushbar

ElevatedButton(
  onPressed: () {
    Flushbar(
      flushbarStyle: FlushbarStyle.GROUNDED,
      backgroundColor: Colors.green,
      title: 'フラッシュバー',
      message: 'コピーしたよ',
      flushbarPosition: FlushbarPosition.TOP,
      duration: Duration(seconds: 2),
    )..show(context);
  },
  child: Text('フラッシュバー'),
),

flutter_svg