リスト 6.8


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

void main() => runApp(TestPage());

// リスト 6.8
class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('flutter_speed_dial')
      ),
      body: Center(
        child: Text('flutter_speed_dial')
      ),
      floatingActionButton: SpeedDial(
        icon: Icons.add,
        activeIcon: Icons.remove,
        buttonSize: 56.0,
        curve: Curves.bounceIn,
        tooltip: '画像を追加できます',
        backgroundColor: Colors.grey,
        foregroundColor: Colors.white,
        overlayOpacity: 0.0,
        children: [
          SpeedDialChild(
            child: Icon(Icons.arrow_back, color: Colors.white),
            backgroundColor: Colors.blue,
            label: 'Back',
            labelBackgroundColor: Colors.transparent,
            labelStyle: TextStyle(fontSize: 18.0, color: Colors.white),
            onTap: () {}
          ),
          SpeedDialChild(
            child: Icon(Icons.arrow_forward, color: Colors.white),
            backgroundColor: Colors.green,
            label: 'Forward',
            labelBackgroundColor: Colors.transparent,
            labelStyle: TextStyle(fontSize: 18.0, color: Colors.white),
            onTap: () {}
          ),
          SpeedDialChild(
            child: Icon(Icons.arrow_upward, color: Colors.white),
            backgroundColor: Colors.red,
            label: 'Upward',
            labelBackgroundColor: Colors.transparent,
            labelStyle: TextStyle(fontSize: 18.0, color: Colors.white),
            onTap: () {}
          )
        ]
      )
    );
  }
}