Skip to content

Instantly share code, notes, and snippets.

View mathiazhagan01's full-sized avatar
😀

Mathiazhagan D mathiazhagan01

😀
View GitHub Profile
@mathiazhagan01
mathiazhagan01 / GoogleFonts.dart
Created August 29, 2022 08:13
GoogleFonts.dart
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);
@mathiazhagan01
mathiazhagan01 / Theme.dart
Created August 27, 2022 14:12
Theme.dart
children: <Widget>[
RadioListTile<ThemeData>(
title: const Text('Blue'),
value: blueThemeData(),
groupValue: _themeData,
onChanged: (value) {
setState(() {
_themeData = value!;
_themeModeValueNotifier.value = _themeData;
});
@mathiazhagan01
mathiazhagan01 / Theme.dart
Created August 27, 2022 14:10
Theme.dart
ThemeData blueThemeData() {
return ThemeData(
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue),
scaffoldBackgroundColor: Colors.blue[100],
);
}
ThemeData redThemeData() {
return ThemeData(
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.red),
@mathiazhagan01
mathiazhagan01 / Theme.dart
Created August 19, 2022 16:29
Theme.dart
@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),
@mathiazhagan01
mathiazhagan01 / Theme.dart
Created August 19, 2022 16:24
Theme.dart
body: Center(
child: Column(
children: <Widget>[
RadioListTile<ThemeMode>(
title: const Text('Light'),
value: ThemeMode.light,
groupValue: _themeMode,
onChanged: (value) {
setState(() {
_themeMode = value!;
@mathiazhagan01
mathiazhagan01 / Theme.dart
Created August 18, 2022 17:34
Theme.dart
@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(),
@mathiazhagan01
mathiazhagan01 / ListView.dart
Last active August 17, 2022 10:22
ListView.dart
class _RecyclerViewPageState extends State<RecyclerViewPage> {
var movieList = [
"Madras",
"Kaala",
"Kabali",
"Sarpatta Parambarai",
"Dhammam",
"Natchathiram Nagargirathu",
"Parieryum Perumal",
"Karnan",
@mathiazhagan01
mathiazhagan01 / ShowDialog.dart
Created August 11, 2022 07:30
ShowDialog.dart
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
@mathiazhagan01
mathiazhagan01 / AlertDialog.dart
Created August 11, 2022 05:48
AlertDialog.dart
AlertDialog alert = AlertDialog(
title: Text("Alert Dialog"),
content: Text("Alert dialog with buttons"),
actions: [cancelButton, okButton],
);
@mathiazhagan01
mathiazhagan01 / OkButton.dart
Created August 11, 2022 05:46
OkButton.dart
Widget okButton = TextButton(
child: Text("OK"),
onPressed: () {
print("OK button is clicked");
Navigator.of(context).pop();
},
);