Norbert515 / dynamic_theme

Dynamically changing your theme without hassle
MIT License
322 stars 68 forks source link

how to use it with below FAB code #31

Open ABINASH56 opened 5 years ago

ABINASH56 commented 5 years ago

import 'package:flutter/material.dart'; import 'package:dynamic_theme/dynamic_theme.dart'; import 'package:fab_circular_menu/fab_circular_menu.dart';

class FabDialer extends StatefulWidget {
  FabDialer({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _FabDialerState createState() => _FabDialerState();
}

class _FabDialerState extends State<FabDialer> {
  @override
  Widget build(BuildContext context) {
    return FabCircularMenu(
      child: Container(
        color: Colors.indigo[900],
        child: Center(
            child: Padding(
              padding: const EdgeInsets.only(bottom: 256.0),
              child: Text(
                  'FAB Circle Menu Example',
                  textAlign: TextAlign.center,
                  style: TextStyle(color: Colors.white, fontSize: 36.0)
              ),
            )
        ),
      ),
      ringColor: Colors.white30,
      options: <Widget>[
        IconButton(icon: Icon(Icons.widgets), onPressed: showChooser,
              iconSize: 48.0, color: Colors.white),
        IconButton(icon: Icon(Icons.widgets), onPressed: () {}, iconSize: 48.0, color: Colors.white),
        IconButton(icon: Icon(Icons.widgets), onPressed: () {}, iconSize: 48.0, color: Colors.white),
        IconButton(icon: Icon(Icons.widgets), onPressed: () {}, iconSize: 48.0, color: Colors.white),
      ],
    );
  }
}

void showChooser() { showDialog( context: context, builder: (context) { return BrightnessSwitcherDialog( onSelectedTheme: (brightness) { DynamicTheme.of(context).setBrightness(brightness); }, ); }); }

Norbert515 commented 4 years ago

What exactly is the question? Doesn't it work this way?