Skip to content

Instantly share code, notes, and snippets.

View SteveOye's full-sized avatar

Stephen Oyebanji SteveOye

View GitHub Profile
import 'package:app/src/common_widgets/app_bar_text_title.dart';
import 'package:app/src/constant/app_colors.dart';
import 'package:app/src/utils/size_config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../common_widgets/wallet_cards.dart';
import '../../constant/app_assets.dart';
class TransactionHistoryScreen extends StatefulWidget {
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:widget_sample/model/blog.dart';
class ListItem extends StatefulWidget {
const ListItem({
super.key,
required this.blogs,
required this.index,
import 'dart:developer';
import 'package:flutter/material.dart';
import '../data/blog_list.dart';
class ListScreen extends StatefulWidget {
const ListScreen({super.key});
@override
class SampleWidget extends StatelessWidget {
const SampleWidget({super.key});
@override
Widget build(BuildContext context) {
return const SomeWidget();
}
//helper method
Widget SomeWidget(){
//There are different ways to create listview, we will be using ListView.builder in this sample
ListView.builder(
itemCount: list.length//lengthOfListItem,
itemBuilder: (context, index) {
return ListItemWidget; //List item widget;
},
)
@SteveOye
SteveOye / main.yml
Last active February 11, 2023 11:51
Action to push tp firebase app distribution
name: Flutter
on: #events (push and pull_request)
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs: #here we specify the jobs - We could have multiple jobs
@SteveOye
SteveOye / flutter.yml
Last active February 3, 2023 17:00
Github action
name: Flutter
on: #events (push and pull_request)
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs: #here we specify the jobs - We could have multiple jobs
@SteveOye
SteveOye / main.dart
Created February 2, 2023 12:17
main
void main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
NotificationApi.init();
runApp(const DruveApp());
}
//import all packages used
void main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
NotificationApi.init();
//initial firebase
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
@SteveOye
SteveOye / notification_api.dart
Last active February 2, 2023 11:58
cloud messaging
//add the method to NotificationApi class
static pushNotification(
RemoteMessage message,
) async {
var androidPlatformChannelSpecifics = const AndroidNotificationDetails(
'channed id',
'channel name',
channelDescription: 'channel description',
importance: Importance.max,