Skip to content

Instantly share code, notes, and snippets.

@rubywai
Created May 1, 2023 13:23
Show Gist options
  • Save rubywai/4f8a19f97705a990b113ecb446c352a1 to your computer and use it in GitHub Desktop.
Save rubywai/4f8a19f97705a990b113ecb446c352a1 to your computer and use it in GitHub Desktop.
import 'dart:developer';
import 'package:flutter/material.dart';
//asset file network memory
void main(){
runApp(
const MaterialApp(
debugShowCheckedModeBanner: false,
home : Home()
)
);
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: const Icon(Icons.info, color: Colors.white,),
title: const Text('My Flutter apps'),
actions: const [
Icon(Icons.settings),
Icon(Icons.add, size: 40,)
],
centerTitle: true,
),
body: SingleChildScrollView(
child: Column(
children: [
Image.asset('assets/cat.jpg',
width: 300,
height: 300,
fit: BoxFit.fitWidth,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: (){
log('Click the floating action button');
},
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment