This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:google_fonts/google_fonts.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
children: <Widget>[ | |
RadioListTile<ThemeData>( | |
title: const Text('Blue'), | |
value: blueThemeData(), | |
groupValue: _themeData, | |
onChanged: (value) { | |
setState(() { | |
_themeData = value!; | |
_themeModeValueNotifier.value = _themeData; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThemeData blueThemeData() { | |
return ThemeData( | |
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue), | |
scaffoldBackgroundColor: Colors.blue[100], | |
); | |
} | |
ThemeData redThemeData() { | |
return ThemeData( | |
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.red), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return ValueListenableBuilder<ThemeMode>( | |
valueListenable: _themeModeValueNotifier, | |
builder: (context, mode, child) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body: Center( | |
child: Column( | |
children: <Widget>[ | |
RadioListTile<ThemeMode>( | |
title: const Text('Light'), | |
value: ThemeMode.light, | |
groupValue: _themeMode, | |
onChanged: (value) { | |
setState(() { | |
_themeMode = value!; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue), | |
scaffoldBackgroundColor: Colors.blue[100], | |
), | |
darkTheme: ThemeData.dark(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _RecyclerViewPageState extends State<RecyclerViewPage> { | |
var movieList = [ | |
"Madras", | |
"Kaala", | |
"Kabali", | |
"Sarpatta Parambarai", | |
"Dhammam", | |
"Natchathiram Nagargirathu", | |
"Parieryum Perumal", | |
"Karnan", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
showDialog( | |
context: context, | |
builder: (BuildContext context) { | |
return alert; | |
}, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AlertDialog alert = AlertDialog( | |
title: Text("Alert Dialog"), | |
content: Text("Alert dialog with buttons"), | |
actions: [cancelButton, okButton], | |
); |
NewerOlder