Open ABINASH56 opened 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); }, ); }); }
What exactly is the question? Doesn't it work this way?
import 'package:flutter/material.dart'; import 'package:dynamic_theme/dynamic_theme.dart'; import 'package:fab_circular_menu/fab_circular_menu.dart';
void showChooser() { showDialog(
context: context,
builder: (context) {
return BrightnessSwitcherDialog(
onSelectedTheme: (brightness) {
DynamicTheme.of(context).setBrightness(brightness);
},
);
});
}